Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt.labs MenuBar in QtQuick.Controls 2 Application Window
Forum Update on Monday, May 27th 2025

Qt.labs MenuBar in QtQuick.Controls 2 Application Window

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 3 Posters 2.5k 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
    charlesfleche
    wrote on last edited by charlesfleche
    #1

    I'd like to attach a platform native MenuBar from Qt.labs as a QtQuick.Controls 2.1 ApplicationWindow header. However as MenuBar is an Object, not Item, that fails, and I can't find an example in the documentation.

    What is the right way to use a Qt.labs.platform.MenuBar in an ApplicationWindow ?

    1 Reply Last reply
    1
    • jpnurmiJ Offline
      jpnurmiJ Offline
      jpnurmi
      wrote on last edited by
      #2

      A native Qt Labs MenuBar is currently available on the following platforms:

      • macOS
      • Android
      • Linux (only available on desktop environments that provide a global D-Bus menu bar)

      Unfortunately, you can't take a native menu bar and use it as a visual Qt Quick Item in ApplicationWindow::header or elsewhere.

      C 1 Reply Last reply
      1
      • jpnurmiJ jpnurmi

        A native Qt Labs MenuBar is currently available on the following platforms:

        • macOS
        • Android
        • Linux (only available on desktop environments that provide a global D-Bus menu bar)

        Unfortunately, you can't take a native menu bar and use it as a visual Qt Quick Item in ApplicationWindow::header or elsewhere.

        C Offline
        C Offline
        charlesfleche
        wrote on last edited by
        #3

        @jpnurmi Thanks the answer. How are you supposed to use the Qt Labs' menu bar, then ? Is there an example documented somewhere ? Thanks !

        E 1 Reply Last reply
        0
        • C charlesfleche

          @jpnurmi Thanks the answer. How are you supposed to use the Qt Labs' menu bar, then ? Is there an example documented somewhere ? Thanks !

          E Offline
          E Offline
          Eeli K
          wrote on last edited by
          #4

          @charlesfleche Qt.labs has experimental things which are often less well documented than final supported things.

          In my opinion Controls 2 UI doesn't mix well with platform native elements. It's meant to be completely cross-platform, looking and behaving the same on all platforms, unlike this MenuBar.

          C 1 Reply Last reply
          0
          • E Eeli K

            @charlesfleche Qt.labs has experimental things which are often less well documented than final supported things.

            In my opinion Controls 2 UI doesn't mix well with platform native elements. It's meant to be completely cross-platform, looking and behaving the same on all platforms, unlike this MenuBar.

            C Offline
            C Offline
            charlesfleche
            wrote on last edited by
            #5

            @Eeli-K Do you think I should not use QML then, and go back to QtWidgets for desktop apps ? I though that QML was the future for all sort of apps, not just mobile.

            E 1 Reply Last reply
            0
            • C charlesfleche

              @Eeli-K Do you think I should not use QML then, and go back to QtWidgets for desktop apps ? I though that QML was the future for all sort of apps, not just mobile.

              E Offline
              E Offline
              Eeli K
              wrote on last edited by
              #6

              @charlesfleche That's something you have to decide yourself. Mixing Control1, Control2 and native elements may work well for you. Controls2 is the best for crossplatform mobile applications with non-native look&feel, C++ widgets for traditional desktop applications and Controls1 for crossplatform native experience with some tradeoffs. But's that's only my personal rough estimate based on imperfect experience and knowledge. It really depends on specific needs.

              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