Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MainWindow/unified toolbar buttons breaking for app bundle on Mac.
Qt 6.11 is out! See what's new in the release blog

MainWindow/unified toolbar buttons breaking for app bundle on Mac.

Scheduled Pinned Locked Moved General and Desktop
10 Posts 2 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    patrickkidd
    wrote on last edited by
    #1

    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!

    https://alaskafamilysystems.com/

    1 Reply Last reply
    0
    • P Offline
      P Offline
      patrickkidd
      wrote on last edited by
      #2

      I have no idea what is initially causing this problem, but a workaround appears to be using the following stylesheet:

      @QToolButton {
      background: transparent;
      } @

      https://alaskafamilysystems.com/

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Can you reproduce that with a minimal example in C++ ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • P Offline
          P Offline
          patrickkidd
          wrote on last edited by
          #4

          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.

          https://alaskafamilysystems.com/

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            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

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • P Offline
              P Offline
              patrickkidd
              wrote on last edited by
              #6

              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!

              https://alaskafamilysystems.com/

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                You're welcome !

                In this case, is the bug easily reproducible with a minimal amount of code in python ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  patrickkidd
                  wrote on last edited by
                  #8

                  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.

                  https://alaskafamilysystems.com/

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Does it happen only when the application is "frozen" ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      patrickkidd
                      wrote on last edited by
                      #10

                      Yep, that's right.

                      https://alaskafamilysystems.com/

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved