[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyKDE] QDialog
From:       Eiji Katagiri <katagiri () teikokupr ! co ! jp>
Date:       2000-11-17 8:35:12
[Download RAW message or body]

Hi. I've try to use a QDialog, but I can't pass the argument
for 'Modal' mode. Here is a simple sample for the Dialog Window.

---

import sys
>from qt import *

class MyWidget(QDialog):
        def __init__(self, *args):
                apply(QDialog.__init__, (self,)+args)
                btn = QPushButton('Close', self)
                self.connect(btn, SIGNAL('clicked()'), self.close)
                self.adjustSize()

class WindowCreator(QWidget):
        def __init__(self, *args):
                apply(QWidget.__init__, (self,)+args)
                vbox = QVBox(self)
                newbtn =  QPushButton('New', vbox)
                quit   =  QPushButton('Quit', vbox)
                self.connect(newbtn, SIGNAL('clicked()'), self.createNew)
                self.connect(quit, SIGNAL('clicked()'), qApp, SLOT('quit()'))
                vbox.adjustSize()
                self.adjustSize()

        def createNew(self):
                self.dialog = MyWidget()
#               self.dialog.exec_loop()
                self.dialog.show()

app = QApplication(sys.argv)
win = WindowCreator()
app.setMainWidget(win)
win.show()
app.exec_loop()

---

Thanks for any help,

Eiji Katagiri


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic