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. How to customize menubar menu title?
Forum Updated to NodeBB v4.3 + New Features

How to customize menubar menu title?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 389 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.
  • N Offline
    N Offline
    noxnivi
    wrote on last edited by
    #1

    Good day,

    I'm trying to create a menubar with QML where one of the titles of the menu has a different color background, but I found it not possible as haven't found anything on how to modify the title of the Menu.

    In the docs on customizing elements it's said that we can create a custom menubar, though nothing said on how to tweak titles.
    This is what i get:
    6de64efc-298a-4995-b865-6353d5009052-image.png

    This is what i want:
    2f68c294-0938-4149-bdaa-9a31b39762a6-image.png

    without being selected nor hovered. Is this possible?

    I would appreciate any hint on this topic.

    Regards,
    noxnivi

    JoeCFDJ 1 Reply Last reply
    0
    • N noxnivi

      Good day,

      I'm trying to create a menubar with QML where one of the titles of the menu has a different color background, but I found it not possible as haven't found anything on how to modify the title of the Menu.

      In the docs on customizing elements it's said that we can create a custom menubar, though nothing said on how to tweak titles.
      This is what i get:
      6de64efc-298a-4995-b865-6353d5009052-image.png

      This is what i want:
      2f68c294-0938-4149-bdaa-9a31b39762a6-image.png

      without being selected nor hovered. Is this possible?

      I would appreciate any hint on this topic.

      Regards,
      noxnivi

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      @noxnivi sure it is possible. Qt version and OS?

      N 1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        @noxnivi sure it is possible. Qt version and OS?

        N Offline
        N Offline
        noxnivi
        wrote on last edited by
        #3

        Good day @JoeCFD,

        I'm using Qt6, actually PySide6, on Arch Linux. If it's possible, maybe I've missed something in the docs. I'm still a newbie with QML.

        Thanks in advance.
        Regards,
        noxnivi

        N 1 Reply Last reply
        0
        • N noxnivi

          Good day @JoeCFD,

          I'm using Qt6, actually PySide6, on Arch Linux. If it's possible, maybe I've missed something in the docs. I'm still a newbie with QML.

          Thanks in advance.
          Regards,
          noxnivi

          N Offline
          N Offline
          noxnivi
          wrote on last edited by
          #4

          Good day,

          I went back through the Qt QML documentation, after @JoeCFD said it was possible, and found a way. Not sure if it's the right one, but last night I tried and it worked.

          The 'answer' is to use a MenuBarItem item in the MenuBar. Though for what I've read, it's not supposed to be used as it's implicitly called when creating a <Menu>, adding a <MenuBarItem> inside the Menubar allows to fully customize the MenuBar element, as all the properties available to MenuBarItem will be accesible.

          There might be a better solution to this question, but for now, what I just pointed out seems to work (needs deep testing anyway).
          Be this the answer, can mark the issue as solved. If not, please let me know the proper way to achieve this.

          Thanks again @JoeCFD.

          Regards,
          noxnivi

          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