Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Solved How to edit the style of QActions?

    General and Desktop
    stylesheet qaction
    2
    6
    1058
    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.
    • R
      rrd0 last edited by rrd0

      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 Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

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

        R 1 Reply Last reply Reply Quote 1
        • R
          rrd0 @mrjj last edited by

          @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 Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion last edited by

            Hi
            well for toolbar you can do something like

            QToolButton:hover { 
            background-color: transparent;
            }
            

            Not sure for the QMenu.

            R 1 Reply Last reply Reply Quote 1
            • R
              rrd0 @mrjj last edited by rrd0

              @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 Reply Quote 0
              • R
                rrd0 last edited by

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

                QToolButton:!checked {
                    border: none;
                }
                
                1 Reply Last reply Reply Quote 1
                • First post
                  Last post