Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Rotating a push button
Forum Updated to NodeBB v4.3 + New Features

Rotating a push button

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 3 Posters 3.4k 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.
  • J Offline
    J Offline
    JoMath
    wrote on last edited by
    #1

    hi,

    How to rotate a push button( or any widget )using QPropertyAnimation.

    Thank you .

    J.HilkJ 1 Reply Last reply
    0
    • A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      The example here http://doc.qt.io/qt-5/qpropertyanimation.html shows how to modify properties. In your case instead of moving it you will be changing the QRect from a new location to a new size.

      In that case though it won't be a rotation but more of a morph from a horizontal size to a vertical one.

      If you want an actual rotation you will probably need to write a custom RotationAnimation class to handle the actual rotation using a pathing animation.

      Or you could just use QML for your mobile GUI (that's what it was really made for), and then use http://doc.qt.io/qt-5/qml-qtquick-rotationanimation.html.

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      1 Reply Last reply
      0
      • J JoMath

        hi,

        How to rotate a push button( or any widget )using QPropertyAnimation.

        Thank you .

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @JoMath hi,
        maybe check out the official transformation example
        you should be able to make a roatated QPushbutton out of it. However I'm not sure if you can tie a QpPropertyAnimation to it. (At least with QWidgets)


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        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