[PyQt] com.apple.xbs Error-- Please help- Thank you
Barry Scott
barry at barrys-emacs.org
Sun Mar 26 13:41:10 BST 2017
> On 25 Mar 2017, at 17:25, Grant Fraser <grantrf93 at hotmail.com> wrote:
>
> Mac OS Python 3 PyQt5
> Program that causes error from tutorial but 'works' for the site owner (http://zetcode.com/gui/pyqt5/menustoolbars/ <http://zetcode.com/gui/pyqt5/menustoolbars/>):
I ran the code in your email and it works error free.
macOs 10.12.3
python 3.5.2 and 3.6.0 with PyQt5 5.7 and 5.8.1
What versions are you using?
I put your code into file a.py and run it from the command line as:
$ python3.6 a.py
Note: that this example bumps into macOS specific handling of menus.
The File>Exit menu is automatically moved to the Python menu as Quit with Cmd-Q as the short cut the icon does show up.
Barry
>
> Menus and toolbars in PyQt5 - ZetCode <http://zetcode.com/gui/pyqt5/menustoolbars/>
> zetcode.com <http://zetcode.com/>
> Menus and toolbars in PyQt5. In this part of the PyQt5 tutorial, we will create menus and toolbars. A menu is a group of commands located in a menubar.
>
> import sys
> from PyQt5.QtWidgets import QMainWindow, QAction, qApp, QApplication
> from PyQt5.QtGui import QIcon
>
>
> class Example(QMainWindow):
> def __init__(self):
> super().__init__()
>
> self.initUI()
>
> def initUI(self):
> exitAction = QAction(QIcon('exit.png'), '&Exit', self)
> exitAction.setShortcut('Ctrl+Q')
> exitAction.setStatusTip('Exit application')
> exitAction.triggered.connect(qApp.quit)
>
> self.statusBar()
>
> menubar = self.menuBar()
> fileMenu = menubar.addMenu('&File')
> fileMenu.addAction(exitAction)
>
> self.setGeometry(300, 300, 300, 200)
> self.setWindowTitle('Menubar')
> self.show()
>
>
> if __name__ == '__main__':
> app = QApplication(sys.argv)
> ex = Example()
> sys.exit(app.exec_())
> Error:
> 2017-03-23 23:25:08.606 Python[96170:2827344] *** Assertion failure in -[NSBitmapImageRep initWithCGImage:], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1504.81.100/AppKit.subproj/NSBitmapImageRep.m:1296
> 2017-03-23 23:25:08.608 Python[96170:2827344] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: cgImage != NULL'
> *I have looked everywhere for this com.apple.xbs folder, including other computers. I cannot find it anywhere on other computers or online. What is the issue? Apparently it is only for developers? I have signed up as a developer and still cannot find it. I do not see the correlation between apple and this PyQt5 program though. I also do not see anywhere in the code that would mention needing this folder.
> *I have even checked hidden folders.
> *Perhaps you could try running it yourself and seeing if you get the same error. I would really appreciate any help. Thank you.
>
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com <mailto:PyQt at riverbankcomputing.com>
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt <https://www.riverbankcomputing.com/mailman/listinfo/pyqt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170326/7a382a96/attachment.html>
More information about the PyQt
mailing list