[PyQt] multiple dialog boxes simultaneously

Pradnyesh Sawant spradml at gmail.com
Thu Nov 29 10:34:46 GMT 2007


Thanks for replying, but I got what I wanted to do. Here's the code:
**********************************************************************
from time import sleep
import sys
from PyQt4 import QtGui, QtCore

class Journal(QtGui.QDialog):
    wndLst = []
    firstFlag = False
    def __init__(self, parent = None):
        QtGui.QDialog.__init__(self, parent)
        if not Journal.firstFlag:
            Journal.firstFlag = True
            while True:
                sleep(1)
                self.makeEntry()
    def makeEntry(self):
        jrnl = Journal()
        Journal.wndLst.append(jrnl)
        jrnl.show()

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    jrnl = Journal()
    sys.exit(jrnl.exec_())
**********************************************************************
On 13:21, 29 Nov, Oleg Klimov wrote:
> > Basically, I want a dialog box to come up every 15 minutes. It should
> > take
> > a text input from me, and close when I press the ok/cancel button. It
> > should, on the other hand, stay there itself till I press one of the
> > buttons.
> > It's a rather simple task, but I don't understand as to how do I get all
> > the dialogs to stay open at the same time.
> 
> I'm not sure I've got you right. I think you need timer and some logic
> in the dialog. Several dialogs is not a problem at all,
> 
> d1 = QDialog()
> d2 = QDialog()
> d1.show()
> d2.show()
> 
> application.exec_()
> 
> 
> Event loop in the QDialog class is needed only for modal type of
> dialogs.
> 
> 
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

-- 
warm regards,
Pradnyesh Sawant
--
Nothing clarifies your ideas like trying to write them down. --Montaigne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20071129/51970e21/attachment.bin


More information about the PyQt mailing list