Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved MenuBar inner working

    QML and Qt Quick
    1
    2
    450
    Loading More Posts
    • 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.
    • JanW
      JanW last edited by

      Hi,

      I'm trying to understand the inner working of the menubar control (not how to use it, but how it is implemented). I already figured out that MenuBar.qml uses MenuBarPrivate, which is actually a QQuickMenuBar object (same for the Menu - QQuickMenu). What I'm failing to understand is how the MenuBar uses the Menu components which are defined inside. I can see that the MenuBar uses a Repeater (model is the QQuickMenuBar menus property), but I can't figure out how that list is populated with the menus that are defined in the MenuBar component.
      Anybody an idea how that is done, I'm sure i'm overlooking something stupid...
      Thanks,

      Jan

      1 Reply Last reply Reply Quote 0
      • JanW
        JanW last edited by

        Got it, in the qquickmenubar I see: Q_CLASSINFO("DefaultProperty", "menus"). This will fill the menus list with the inner defined components.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post