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 to edit the style of QActions?
Forum Updated to NodeBB v4.3 + New Features

How to edit the style of QActions?

Scheduled Pinned Locked Moved Solved General and Desktop
stylesheetqaction
6 Posts 2 Posters 2.8k 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.
  • R Offline
    R Offline
    rrd0
    wrote on last edited by rrd0
    #1

    By default, QActions are highlighted when hovered. I'd like to remove that effect. How can I do that on a stylesheet?

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

      Hi
      QActions are not visual
      so it must be in a menu or toolbar you mean?

      R 1 Reply Last reply
      1
      • mrjjM mrjj

        Hi
        QActions are not visual
        so it must be in a menu or toolbar you mean?

        R Offline
        R Offline
        rrd0
        wrote on last edited by
        #3

        @mrjj

        Yes. They are on QMenus and QToolBars.

        I'm looking for something like this:

        QToolBar::item:hovered {
            /* don't highlight when hovered */
        }
        
        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          well for toolbar you can do something like

          QToolButton:hover { 
          background-color: transparent;
          }
          

          Not sure for the QMenu.

          R 1 Reply Last reply
          1
          • mrjjM mrjj

            Hi
            well for toolbar you can do something like

            QToolButton:hover { 
            background-color: transparent;
            }
            

            Not sure for the QMenu.

            R Offline
            R Offline
            rrd0
            wrote on last edited by rrd0
            #5

            @mrjj said in How to edit the style of QActions?:

            Hi
            well for toolbar you can do something like

            QToolButton:hover { 
            background-color: transparent;
            }
            

            That code turns QActions into black squares. But it changed QActions' hover behaviour, so it was close. Thanks!

            1 Reply Last reply
            0
            • R Offline
              R Offline
              rrd0
              wrote on last edited by
              #6

              @mrjj show me the right path and I found a solution.

              QToolButton:!checked {
                  border: none;
              }
              
              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