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. Rotate Image of QPushButton
Qt 6.11 is out! See what's new in the release blog

Rotate Image of QPushButton

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 3.3k 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
    Anh Phan
    wrote on last edited by
    #1

    Hi everyone. I wonder if there is a possibility that I can rotate my pushbutton's background image everytime I move my cursor on it.

    Anh

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Carmoneer
      wrote on last edited by Carmoneer
      #2

      I would take a look at this. That should be what you're looking for in theory to handle when the cursor 'hovers' over the button. Instead, load a rotated version of the same image.

      Alternatively, there may be more elegant approaches. Hope this helps!

      A 1 Reply Last reply
      0
      • C Carmoneer

        I would take a look at this. That should be what you're looking for in theory to handle when the cursor 'hovers' over the button. Instead, load a rotated version of the same image.

        Alternatively, there may be more elegant approaches. Hope this helps!

        A Offline
        A Offline
        Anh Phan
        wrote on last edited by
        #3

        @Carmoneer I mean it's a animation or movement. Not just only changing background image in the hover stylesheet.

        Anh

        mrjjM 1 Reply Last reply
        0
        • A Anh Phan

          @Carmoneer I mean it's a animation or movement. Not just only changing background image in the hover stylesheet.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Anh-Phan
          hi
          you can create your own button and use the
          http://doc.qt.io/qt-5/animation-overview.html
          for the animation.

          I also had good results using gif animation and a QLabel child.

          A 1 Reply Last reply
          1
          • mrjjM mrjj

            @Anh-Phan
            hi
            you can create your own button and use the
            http://doc.qt.io/qt-5/animation-overview.html
            for the animation.

            I also had good results using gif animation and a QLabel child.

            A Offline
            A Offline
            Anh Phan
            wrote on last edited by
            #5

            @mrjj Yup!! This is exactly what i need. Thank u alot, bro.

            Anh

            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