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

  • 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)


  • Lifetime Qt Champion


    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.

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

  • Qt Champions 2017

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

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.