MainWindow/unified toolbar buttons breaking for app bundle on Mac.
-
When I run QMainWindow and
unifiedTitleAndToolBarOnMac = true
Qt-5.3.1 in an app bundle (using PyQt5 and cx_freeze), the tool buttons incorrectly show rectangle backgrounds (see screenshot 1) when they should only be showing the png assinged to them (see screenshot 2). Everything looks great when I run it from the command line using the system-installed Qt libs (via homebrew).!http://content.screencast.com/users/patrickkidd/folders/Snagit/media/567d7fb9-e40e-4741-afe0-3a07dd805ebd/2014-10-29_20-44-22.jpeg(Screenshot 1)!
!http://content.screencast.com/users/patrickkidd/folders/Snagit/media/303427c6-d0d2-45a7-8fa3-95f5de53124c/2014-10-29_20-52-30.jpeg(Screenshot 2)!
Thanks!
-
I have no idea what is initially causing this problem, but a workaround appears to be using the following stylesheet:
@QToolButton {
background: transparent;
} @ -
Hi,
Can you reproduce that with a minimal example in C++ ?
-
I wish I could, but I'm using PyQt and it would take too much work, sorry. Plus, I bet this isn't a problem in C++. I'm not versed enough in the libs to make an educated guess as to what is breaking it for a frozen app bundle in PyQt5.
-
There's no need for something overly complicated. Since it's a toolbar thing, you could simply create a default QMainWindow application, add a toolbar, set an icon on it and use the same flags as your PyQt app.
If it's not a problem on C++ then you can report your findings to the PyQt guys otherwise on the "bug report sysm":http://bugreports.qt-project.org
-
Thanks for your considerate reply. I made a simple qt application with the unified title and tool bar and a png icon on mac and unsurprisingly the bug does not occur (with 5.3.2). There are a few other peculiar bugs from deploying a PyQt application, and I'll take them up in the appropriate forum/list.
Thanks!
-
You're welcome !
In this case, is the bug easily reproducible with a minimal amount of code in python ?
-
yes, any QMainWindow with unified title and toolbar and transparent icons deployed with cx_Freeze will do it. For me, this is one of those cases where I'm reluctant to dive in because it's hard to pinpoint which part in the Qt-PyQt-cx_Freeze stack it's breaking. it could be a factor of any one of the three, since I've seen both Qt and PyQt show subtle differences (retina clarity, for example) on their own when deployed apart from the original installation directory. Things can get complicated really fast.
This thread was a shot in the dark hoping that someone would notice this behavior as a common side effect of some situation, like missing a plugin in a static path or something.
-
Does it happen only when the application is "frozen" ?
-
Yep, that's right.