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_())