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. menubar->sizehint()->height() in ubuntu is 0
Qt 6.11 is out! See what's new in the release blog

menubar->sizehint()->height() in ubuntu is 0

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.9k Views 2 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.
  • MegamouseM Offline
    MegamouseM Offline
    Megamouse
    wrote on last edited by Megamouse
    #1

    Hi folks,

    I use the sizehint()->height() of the menubar as a factor in another size calculation.
    It works fine in windows, but in ubuntu it will equal 0, which causes the layout to be bugged.

    We use it in Init() btw.

    Any fix for that? we use

    int height = menubar()->sizehint()->height();
    
    if (height <= 0) height = menubar()->size()->height();
    

    as a workaround (with different outcome though)

    thx,
    Megamouse

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

      Hi,

      Isn't the menubar show at the top of the screen in Ubuntu a bit like on macOS so it technically has a size of 0 regarding the application.

      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
      • MegamouseM Offline
        MegamouseM Offline
        Megamouse
        wrote on last edited by
        #3

        yeah thx that seemed to be the Reason. I now use the iconSize to calculate it

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          Just as a note.
          You can disable that global menu so make sure u handle both cases.

          1 Reply Last reply
          1

          • Login

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