[Interest] Debugging an OSX app bundle with Qt5
Glenn Ramsey
gr at componic.co.nz
Mon Apr 8 03:04:37 CEST 2013
Hi,
I am having some trouble with an OSX app built by PyInstaller using PyQt4 and
Qt5. It used to work with PyQt4 + Qt4 so I assume that my issue is related to
Qt5. I'm developing on OSX 10.8.3.
My test app, hello.py, simply shows a message box:
import sys
from PyQt4.QtGui import QApplication, QMessageBox
def main():
print "Hello"
a = QApplication(sys.argv)
m = QMessageBox(QMessageBox.Information, "Title", "Hello")
m.show()
a.exec_()
if __name__=="__main__":
main()
When packaging a python program PyInstaller creates a directory with all the
required files and then packages that into an app bundle. If I execute the
program from the build directory (./dist/hello/hello) then the program runs and
the message box shows. However if I run the .app (open ./dist/hello.app or
./dist/hello.app/Contents/MacOS/hello) the program runs but the message box
never appears.
I suspected that this may have been due to a problem with the qt_menu.nib dir. I
had to modify PyInstaller so it could find it in
$QTDIR/qtbase/src/plugins/platforms/cocoa. PyInstaller puts it in both
Contents/MacOS and Contents/Resources but dtruss tells me that Qt is looking in
Contents/MacOS/qt4_plugins/platforms/. However copying it there doesn't help. Of
course the issue may be unrelated to qt_menu.nib because I don't see any error
messages about it.
What else could be going wrong? How do I debug this?
Glenn
More information about the Interest
mailing list