#include "gui/QConnectionDialog.h" using namespace distortion; QConnectionDialog::QConnectionDialog(QWidget* pParent, Qt::WFlags flags) : QDialog(pParent, flags) { ui.setupUi(this); } QConnectionDialog::~QConnectionDialog() { exit(0); } void QConnectionDialog::on_closeButton_clicked() { exit(0); } void QConnectionDialog::initFromDOMElement(const QDomElement& element) { if (!element.isNull()) { int posX = 16; int posY = 16; int width = 0; int height = 0; QDomElement geom = element.firstChildElement("Geometry"); posX = geom.attribute("posX").toInt(); posY = geom.attribute("posY").toInt(); width = geom.attribute("width").toInt(); height = geom.attribute("height").toInt(); move(posX, posY); if (width!=0 && height!=0) resize(width, height); } } QDomElement QConnectionDialog::domElement(QDomDocument& document) const { QDomElement de = document.createElement("ConnectionDialog"); QDomElement geom = document.createElement("Geometry"); geom.setAttribute("posX", pos().x()); geom.setAttribute("posY", pos().y()); geom.setAttribute("width", width()); geom.setAttribute("height", height()); de.appendChild(geom); return de; }