[PyQt] Using PyQt within an application

andYpsilon andreasfrickinger at me.com
Sun Aug 17 15:14:32 BST 2008


Theres nothing special to the code I am using. It's what is coming out of
Designer, modified for having the functionality I need.

starter is the function I call to start my dialog:

...

class MeinDialog(QtGui.QDialog, Dlg): 
    def __init__(self): 
        QtGui.QDialog.__init__(self) 
        self.setupUi(self)

def starter():
    app = QtGui.QApplication(sys.argv) 
    dialog = MeinDialog()
    dialog.setModal(False)
    dialog.show()
    sys.exit(app.exec_())

...

in the interface class this is the SIGNAL I am using to quit with a button:

...
        self.retranslateUi(Dialog)
       
QtCore.QObject.connect(self.pushButton,QtCore.SIGNAL("clicked()"),self.close)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
...


any ideas what could be wrong???

thx,
andy





David Boddie-4 wrote:
> 
> On Fri Aug 15 15:37:09 BST 2008, andYpsilon wrote:
> 
>> Nuke (the application I am using) is not using pyqt, but python and I am
>> starting the dialog through a python command.
> 
> Can you post some code, perhaps just a code snippet?
> 
>> Does the property u sent me end the main event loop? because it needs to
>> be
>> stopped, otherwise I can't use the application, because it crashes while
>> doing something with the main event loop running.
> 
> In a normal PyQt application, if you only create one window and start the
> application's event loop, then closing that window will cause the event
> loop to stop running. The property I mentioned will tell PyQt to keep
> running the event loop even when the last/only window has been closed.
> 
> It shouldn't cause Python to quit as well. That depends on what else is
> happening in the program.
> 
> David
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-PyQt-within-an-application-tp18988310p19020213.html
Sent from the PyQt mailing list archive at Nabble.com.



More information about the PyQt mailing list