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. How do I create a window with the menu in the title bar?

How do I create a window with the menu in the title bar?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 5.3k 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
    gvanvoor
    wrote on last edited by
    #1

    Hi,

    I'ld like to create a window with a menu in the title bar, like Visual Studio 2019 does.
    See screenshot:
    Clipboard01.png

    Is this possible in Qt and if so, what window flags do I need to use? (I don't need a cross platform solution; I only need it on windows).

    I've managed to get close to this by using a frameless QMainWindow and adding the minimise/close buttons as a corner widget to its menu bar but this breaks the ability to minimise the application by clicking the app icon in the task bar.

    A 1 Reply Last reply
    2
    • G gvanvoor

      Hi,

      I'ld like to create a window with a menu in the title bar, like Visual Studio 2019 does.
      See screenshot:
      Clipboard01.png

      Is this possible in Qt and if so, what window flags do I need to use? (I don't need a cross platform solution; I only need it on windows).

      I've managed to get close to this by using a frameless QMainWindow and adding the minimise/close buttons as a corner widget to its menu bar but this breaks the ability to minimise the application by clicking the app icon in the task bar.

      A Offline
      A Offline
      anil_arise
      wrote on last edited by
      #2

      @gvanvoor this git code will help you.
      MenuBar

      G 1 Reply Last reply
      0
      • A anil_arise

        @gvanvoor this git code will help you.
        MenuBar

        G Offline
        G Offline
        gvanvoor
        wrote on last edited by
        #3

        @anil_arise said in How do I create a window with the menu in the title bar?:

        @gvanvoor this git code will help you.

        No it doesn't. That's exactly the same as what I already tried: a frameless QMainWindow. The resulting window needs to have a "real" minimise button in order for the click on the application icon in the taskbar to minimise the application.

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

          Hi
          Basically you cannot do this with Qt in any easy way.

          Its a custom solution reimplementing all the features like min/max and resize.

          The best i could find was
          https://github.com/dfct/TrueFramelessWindow

          G 1 Reply Last reply
          7
          • mrjjM mrjj

            Hi
            Basically you cannot do this with Qt in any easy way.

            Its a custom solution reimplementing all the features like min/max and resize.

            The best i could find was
            https://github.com/dfct/TrueFramelessWindow

            G Offline
            G Offline
            gvanvoor
            wrote on last edited by
            #5

            @mrjj said in How do I create a window with the menu in the title bar?:

            Hi
            Basically you cannot do this with Qt in any easy way.

            Its a custom solution reimplementing all the features like min/max and resize.

            The best i could find was
            https://github.com/dfct/TrueFramelessWindow

            That does exactly what I need. Thanks.

            1 Reply Last reply
            2
            • SGaistS SGaist referenced this topic on

            • Login

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