From 1d3b33ae15c116bf82ff40088d5f060af1da7b5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carsten=20Gr=C3=A4ser?= <graeser@mi.fu-berlin.de>
Date: Thu, 17 Sep 2009 09:44:03 +0000
Subject: [PATCH] Get rid of warning

QMainWindow has a QLayout. We have to create the centralWidget
and set our custom QLayout for this.

[[Imported from SVN: r2917]]
---
 bin/hierarchicviewer.py | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/bin/hierarchicviewer.py b/bin/hierarchicviewer.py
index a72fff59..c386f030 100644
--- a/bin/hierarchicviewer.py
+++ b/bin/hierarchicviewer.py
@@ -76,15 +76,17 @@ class MainWindow(qt.QMainWindow):
         self.timeout = timeout
         self.autoAppend = autoAppend
 
-        self.layout = qt.QVBoxLayout(self)
-        self.controlBoxLayout = qt.QHBoxLayout(self.layout)
+        self.content = qt.QFrame(self)
+        self.setCentralWidget(self.content)
+        self.contentlayout = qt.QVBoxLayout(self.content)
+        self.controlBoxLayout = qt.QHBoxLayout(self.contentlayout)
         self.controlBoxLayout.setSpacing(20)
         self.controlBoxLayout.setMargin(10)
 
-        self.maxLevelControl = qt.QSpinBox(0,10,1,self)
-        self.followControl = qt.QCheckBox ('follow', self)
-        self.autoAppendControl = qt.QCheckBox ('auto append', self)
-        self.hview = HListView(follow, self)
+        self.maxLevelControl = qt.QSpinBox(0,10,1,self.content)
+        self.followControl = qt.QCheckBox ('follow', self.content)
+        self.autoAppendControl = qt.QCheckBox ('auto append', self.content)
+        self.hview = HListView(follow, self.content)
 
         self.followControl.setOn(self.hview.follow)
         self.autoAppendControl.setOn(self.autoAppend)
@@ -92,7 +94,7 @@ class MainWindow(qt.QMainWindow):
         self.controlBoxLayout.addWidget(self.maxLevelControl)
         self.controlBoxLayout.addWidget(self.followControl)
         self.controlBoxLayout.addWidget(self.autoAppendControl)
-        self.layout.addWidget(self.hview)
+        self.contentlayout.addWidget(self.hview)
         self.controlBoxLayout.insertStretch(-1)
 
         self.connect(self.maxLevelControl, qt.SIGNAL('valueChanged(int)'), self.hview.setMaxLevel)
-- 
GitLab