All Classes Namespaces Functions Variables Enumerations Properties Pages
camerapropertiesdialog.cpp
1 /*
2 
3 Pencil2D - Traditional Animation Software
4 Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5 Copyright (C) 2012-2020 Matthew Chiawen Chang
6 
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; version 2 of the License.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 */
17 
18 #include "camerapropertiesdialog.h"
19 #include "ui_camerapropertiesdialog.h"
20 
21 CameraPropertiesDialog::CameraPropertiesDialog(const QString& name, int width, int height) :
22  QDialog(),
23  ui(new Ui::CameraPropertiesDialog)
24 {
25  ui->setupUi(this);
26 
27  ui->nameBox->setText(name);
28  ui->widthBox->setValue(width);
29  ui->heightBox->setValue(height);
30 }
31 
32 CameraPropertiesDialog::~CameraPropertiesDialog()
33 {
34  delete ui;
35 }
36 
37 QString CameraPropertiesDialog::getName()
38 {
39  return ui->nameBox->text();
40 }
41 
42 void CameraPropertiesDialog::setName(const QString& name)
43 {
44  ui->nameBox->setText(name);
45 }
46 
47 int CameraPropertiesDialog::getWidth()
48 {
49  return ui->widthBox->value();
50 }
51 
52 void CameraPropertiesDialog::setWidth(int width)
53 {
54  ui->widthBox->setValue(width);
55 }
56 
57 int CameraPropertiesDialog::getHeight()
58 {
59  return ui->heightBox->value();
60 }
61 
62 void CameraPropertiesDialog::setHeight(int height)
63 {
64  ui->heightBox->setValue(height);
65 }
void setupUi(QWidget *widget)