[PyKDE] return value of app.exec_() ?

Dave S eric3 at pusspaws.net
Sat Sep 30 22:12:38 BST 2006


On Saturday 30 September 2006 17:45, Dave S wrote:
> On Saturday 30 September 2006 17:14, Dave S wrote:
> > Well porting my app from Linux QT3 to Windows QT4 is ... err....
> > interesting
> >
> > Latest snag ...
> >
> > qt4 designer; designed a pure QT4 login dialog with
> >
> > login button - linked to - accept()
> > quit button - linked to close()
>
> Sorry typo
> quit button - linked to reject()
>
> > which in QT3 returns 0 or 1 from app.exec_loop() which I can use.
> > In QT4 app.exec_() it returns 0 no matter which I press. Googling I think
> > it is supposed to return different values but its all in C ! - can you
> > clarify ?
> >
> > Dave
> >
> > PS can anyone tell me how to implement a QTable.setColumnStretchable() in
> > QT4 QTableWidget ?
> >
> > def LoginDialog1(self):
> >         while True:
> >
> >             app = QtGui.QApplication(sys.argv)
> >             login_dialog = QtGui.QDialog()
> >             os.chdir(self.config.get('paths','dialogs'))  # Use
> > 'os.chdir' else ui PNGs are lost
> >             uic.loadUi('login.ui', login_dialog)
> >             login_dialog.lineEdit_2.setEchoMode(QtGui.QLineEdit.Password)
> >             login_dialog.show()
> >
> >             if app.exec_():
> >                 self.username = login_dialog.lineEdit_2.text()
> >                 password = login_dialog.lineEdit.text()
> >                 if password == '1111' and len(self.username) > 2:
> >                     break
> >             else:
> >                 sys.exit()

OK I stumbled across some usefull documentation 
deleted app = QtGui.QApplication(sys.argv), & login_dialog.show(), 
changed if app.exec_(): to if login_dialog.exec_(): and all is well - sorry 
for bothering you guys :)

Cheers

Dave

> >
> > _______________________________________________
> > PyKDE mailing list    PyKDE at mats.imk.fraunhofer.de
> > http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
>
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde




More information about the PyQt mailing list