summaryrefslogtreecommitdiff
path: root/client/widgets/window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/window.cc')
-rw-r--r--client/widgets/window.cc34
1 files changed, 4 insertions, 30 deletions
diff --git a/client/widgets/window.cc b/client/widgets/window.cc
index c385d04..84e370c 100644
--- a/client/widgets/window.cc
+++ b/client/widgets/window.cc
@@ -25,29 +25,17 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include "window.h"
-#include <QVBoxLayout>
-#include <QHBoxLayout>
+#include "common.h"
Window::Window(QDomNode &node, MacroWindow *macrowindow)
: QWidget(NULL), Widget(node, macrowindow)
{
setWindowFlags(Qt::WindowContextHelpButtonHint | Qt::WindowSystemMenuHint);
- QDomElement elem = node.toElement();
-
- if(elem.hasAttribute("width")) {
- setMinimumWidth(elem.attribute("width").toInt());
- resize(elem.attribute("width").toInt(), height());
- }
+ setCommonAttributes(this, node);
+ setCommonLayout(this, node);
- if(elem.hasAttribute("height")) {
- setMinimumHeight(elem.attribute("height").toInt());
- resize(width(), elem.attribute("height").toInt());
- }
-
- if(elem.hasAttribute("help")) {
- setToolTip(elem.attribute("help"));
- }
+ QDomElement elem = node.toElement();
if(elem.hasAttribute("fixed")) {
if(elem.attribute("fixed") == "true") {
@@ -57,19 +45,5 @@ Window::Window(QDomNode &node, MacroWindow *macrowindow)
if(elem.hasAttribute("caption")) {
setWindowTitle(elem.attribute("caption"));
- } else {
- setWindowTitle(elem.attribute(""));
}
-
- if(elem.hasAttribute("layout")) {
- if(elem.attribute("layout") == "hbox") {
- QHBoxLayout *layout = new QHBoxLayout();
- setLayout(layout);
- } else if (elem.attribute("layout") == "vbox") {
- QVBoxLayout *layout = new QVBoxLayout();
- setLayout(layout);
- }
- }
-
- setContentsMargins(0,0,0,0);
}