7Kyy4MtVgozjIYKjnDVnQf changeset

Changeset376637666264 (b)
ParentNone (a)
ab
0+import sys
0+from PySide.QtCore import *
0+from PySide.QtGui import *
0+from PySide.QtMaemo5 import *
0+
0+class FreezeDialog(QMainWindow):
0+    def __init__(self):
0+        QMainWindow.__init__(self)
0+        self.cw = QWidget(self)
0+        self.setCentralWidget(self.cw)       
0+        self.vbox = QVBoxLayout(self.cw)       
0+        self.dialog = Dialog(self)
0+        self.button = QPushButton(self)
0+        self.button.setText(QString("Open Dialog"))
0+        self.connect(self.button, SIGNAL("clicked()"), self.dialog.show)
0+        self.vbox.addWidget(self.button)
0+
0+class Dialog(QDialog):
0+    def __init__(self, parent):
0+        QDialog.__init__(self)
0+        self.vbox = QVBoxLayout(self)
0+        self.button = QPushButton(self)
0+        self.button.setText(QString("Close"))
0+        self.vbox.addWidget(self.button)
0+        self.connect(self.button, SIGNAL("clicked()"), self.hideDialog)
0+    def hideDialog(self):
0+        # These two ibox rows cause problems. Without them, everything works nicely.
0+        self.ibox = QMaemo5InformationBox()
0+        self.ibox.information(self, "This message will freeze the screen", 3000)
0+        self.hide()
0+
0+if __name__ == '__main__':
0+    app = QApplication(sys.argv)
0+    fd = FreezeDialog()
0+    fd.show()
0+    sys.exit(app.exec_())
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- Revision None
+++ Revision 376637666264
@@ -0,0 +1,36 @@
+import sys
+from PySide.QtCore import *
+from PySide.QtGui import *
+from PySide.QtMaemo5 import *
+
+class FreezeDialog(QMainWindow):
+ def __init__(self):
+ QMainWindow.__init__(self)
+ self.cw = QWidget(self)
+ self.setCentralWidget(self.cw)
+ self.vbox = QVBoxLayout(self.cw)
+ self.dialog = Dialog(self)
+ self.button = QPushButton(self)
+ self.button.setText(QString("Open Dialog"))
+ self.connect(self.button, SIGNAL("clicked()"), self.dialog.show)
+ self.vbox.addWidget(self.button)
+
+class Dialog(QDialog):
+ def __init__(self, parent):
+ QDialog.__init__(self)
+ self.vbox = QVBoxLayout(self)
+ self.button = QPushButton(self)
+ self.button.setText(QString("Close"))
+ self.vbox.addWidget(self.button)
+ self.connect(self.button, SIGNAL("clicked()"), self.hideDialog)
+ def hideDialog(self):
+ # These two ibox rows cause problems. Without them, everything works nicely.
+ self.ibox = QMaemo5InformationBox()
+ self.ibox.information(self, "This message will freeze the screen", 3000)
+ self.hide()
+
+if __name__ == '__main__':
+ app = QApplication(sys.argv)
+ fd = FreezeDialog()
+ fd.show()
+ sys.exit(app.exec_())