source: projectionDesigner/tag/ProjectionDesigner_1.1.5/projdesigner/src/gui/QConnectionDialog.cpp @ 2

Last change on this file since 2 was 2, checked in by Torben Dannhauer, 10 years ago
File size: 1.3 KB
Line 
1#include "gui/QConnectionDialog.h"
2
3using namespace distortion;
4
5QConnectionDialog::QConnectionDialog(QWidget* pParent, Qt::WFlags flags)
6    : QDialog(pParent, flags)
7{
8    ui.setupUi(this);
9}
10
11QConnectionDialog::~QConnectionDialog()
12{
13    exit(0);
14}
15
16void QConnectionDialog::on_closeButton_clicked()
17{
18    exit(0);
19}
20
21void QConnectionDialog::initFromDOMElement(const QDomElement& element)
22{
23    if (!element.isNull())
24    {
25        int posX = 16;
26        int posY = 16;
27        int width = 0;
28        int height = 0;
29
30        QDomElement geom = element.firstChildElement("Geometry");
31        posX = geom.attribute("posX").toInt();
32        posY = geom.attribute("posY").toInt();
33        width = geom.attribute("width").toInt();
34        height = geom.attribute("height").toInt();
35
36        move(posX, posY);
37        if (width!=0 && height!=0)
38            resize(width, height);
39    }
40}
41
42QDomElement QConnectionDialog::domElement(QDomDocument& document) const
43{
44    QDomElement de = document.createElement("ConnectionDialog");
45
46    QDomElement geom = document.createElement("Geometry");
47    geom.setAttribute("posX", pos().x());
48    geom.setAttribute("posY", pos().y());
49    geom.setAttribute("width", width());
50    geom.setAttribute("height", height());
51    de.appendChild(geom);
52
53    return de;
54}
Note: See TracBrowser for help on using the repository browser.