Hi,
I am using PySide 1.1.0. And I would like to use it inside a C++
application that already uses Qt and provides an embedded Python
interpreter.
I tried something like that:
from PySide import QtGui
app = QtGui.QApplication.instance()
print app
wid = QtGui.QLabel("Whatever")
wid.resize(450, 150)
wid.setWindowTitle('Simple')
wid.show()
Since there is already a running QApplication, I do not create a new one.
There is also a running event loop in another thread since the application
interface reacts.
This code snippet works partially:
a new window is created, with a "simple" title, but the text inside it is
never displayed and the windows does not react at all:
I can't move it, resize it or anything.
If I call "wid.repaint()", the text inside the window is correctly
refreshed; however the window still does not react to any event.
I also tried to create a message box like that:
QtGui.QMessageBox.question(wid, 'Message', "Existing app: %r" % app,
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.No)
This time the message box reacts correctly: it is correctly displayed, it
shows the existing QApplication object and the buttons react.
A screenshot of the result can be seen here:
http://dl.free.fr/dey2Tzig3
It seems as if the QLabel I created does not receive any event.
Do you have any idea of how I can fix that? Should I open a bug concerning
this behavior?
Thanks in advance
Sébastien Sablé
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside