summaryrefslogtreecommitdiff
path: root/client/widgets/window.cc
diff options
context:
space:
mode:
authordeva <deva>2008-08-28 14:13:48 +0000
committerdeva <deva>2008-08-28 14:13:48 +0000
commit477c9fd7f038cd43207c8634d53d0949814ecb4c (patch)
tree4d4f849c281aa4402c3f7bd95546c21ebe287e55 /client/widgets/window.cc
parentb74d14e7e8625ce1a148105f69e3406f7d88ecd6 (diff)
Added common stuff in central file. Fixed help text reformatting.
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);
}