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. QMenuBar CSS problem
Qt 6.11 is out! See what's new in the release blog

QMenuBar CSS problem

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 4.9k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    Aouache
    wrote on last edited by
    #1

    Hi every body,

    i have a problèm with stylesheet for QMenuBar i want to customize my bar menu on color gray (see the picture)

    http://i.stack.imgur.com/rYqyP.png

    please i need your help i used all technique Stylesheet and pallette it does’nt work :(

    1 Reply Last reply
    0
    • francescmmF Offline
      francescmmF Offline
      francescmm
      wrote on last edited by
      #2

      You have to set styles to the item:

      @QMenuBar::item {}@

      and to style the selected item:

      @QMenuBar::item:selected { }@

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Aouache
        wrote on last edited by
        #3

        it doesn't work i use this style :

        @
        background-color: rgb(125, 125, 125);
        QMenuBar::item {background-color: rgb(125, 125, 125)}
        QMenuBar::item:selected {background-color: rgb(125, 125, 125)}
        @

        1 Reply Last reply
        0
        • francescmmF Offline
          francescmmF Offline
          francescmm
          wrote on last edited by
          #4

          I'm sorry! Try this:

          @QMenu::item
          {
          background-color: rgb(125, 125, 125)
          }

          QMenu::item:selected
          {
          background-color: rgb(125, 125, 125)
          }

          QMenu::item:disabled
          {
          background-color: rgb(125, 125, 125)
          }@

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Aouache
            wrote on last edited by
            #5

            oh yeh it works thank you very much

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bjanuario
              wrote on last edited by
              #6

              mark as solved ;)

              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