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. Menu bar questions
Forum Updated to NodeBB v4.3 + New Features

Menu bar questions

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 227 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.
  • C Offline
    C Offline
    clarify
    wrote on last edited by
    #1

    Question 1:
    Why is it necessary to add the various widgets into a window before adding the menubar and statusbar?

    Question 2:
    Why, if I add the menubar at the wrong time, does its height() function return the window height?
    Thanks.

    Christian EhrlicherC JonBJ 2 Replies Last reply
    0
    • C clarify

      Question 1:
      Why is it necessary to add the various widgets into a window before adding the menubar and statusbar?

      Question 2:
      Why, if I add the menubar at the wrong time, does its height() function return the window height?
      Thanks.

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @clarify said in Menu bar questions:

      Question 1:
      Why is it necessary to add the various widgets into a window before adding the menubar and statusbar?

      No, this is not necessary.

      Please show how you add your menubar and the widget in a minimal, compilable example.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • C clarify

        Question 1:
        Why is it necessary to add the various widgets into a window before adding the menubar and statusbar?

        Question 2:
        Why, if I add the menubar at the wrong time, does its height() function return the window height?
        Thanks.

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @clarify said in Menu bar questions:

        Question 2:
        Why, if I add the menubar at the wrong time, does its height() function return the window height?

        As @Christian-Ehrlicher says it does not matter what order you add things in. However, visual measurement functions like height() may not give you a meaningful result until the menubar/widget is actually shown, so if you are querying it before then that might be the reason.

        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