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. Cannot Obtain Correct Size for QMenuBar on Windows Before Showing QMainWindow

Cannot Obtain Correct Size for QMenuBar on Windows Before Showing QMainWindow

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.4k Views
  • 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.
  • G Offline
    G Offline
    GBWarren
    wrote on last edited by
    #1

    I need to be able to get the menubar and toolbar sizes for my window so that I can size the window to give a certain size client/central-widget area. I can get the sizes of the menubar and toolbar after creating them and having them adjustSize(). This works fine for the toolbar, but the menubar tells me it is 20 pixels tall until I show() its main window, then it is actually 21 pixels in height.

    I am using Qt 4.7.1 on Windows 7 when this happens. This problem does not occur with the same Qt version on Linux (OpenSUSE).

    Anyone have any idea why I get this difference?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      So, the interesting thing is, what do you want to achieve. If want to achieve a minimum client area size, set a minimum size to the client are (centralWidget).
      Then the rest will resize to fit.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      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