Revision 376637666264 () - Diff

Link to this snippet: https://friendpaste.com/7Kyy4MtVgozjIYKjnDVnQf
Embed:
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
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_())