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. What's the best way to animate an image

What's the best way to animate an image

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 555 Views 3 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.
  • M Offline
    M Offline
    Mizmas
    wrote on last edited by
    #1

    Hello, I'm looking for an approach to animate the knobs of an image, using QT Designer and PYQT6

    I want to be able to import an image, for example, such as this, and animate the knobs based on the hardware input:
    Screenshot_1.png

    As I understand, two images cannot be stacked on top of another in a layout. My first idea was to separate the knobs into another image and animate them on the background image, but that seems impossible.

    This is how my gui looks right now with a placeholder image:
    Screenshot_3.png

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

      Hi,

      It looks like you want to implement a custom QSlider and a custom QDial, aren't you ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        It looks like you want to implement a custom QSlider and a custom QDial, aren't you ?

        M Offline
        M Offline
        Mizmas
        wrote on last edited by
        #3

        @SGaist Yes, I could import an image of a slider knob and use it as a resource on the slider widget's handle, but you can't put a slider widget on top of a label widget in a layout, can you? In the gui, I want to keep the black background, and I also want to import an image to represent the physical hardware midi controller that has slider/fader potentiometers.

        SGaistS M 2 Replies Last reply
        0
        • M Mizmas

          @SGaist Yes, I could import an image of a slider knob and use it as a resource on the slider widget's handle, but you can't put a slider widget on top of a label widget in a layout, can you? In the gui, I want to keep the black background, and I also want to import an image to represent the physical hardware midi controller that has slider/fader potentiometers.

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Mizmas you can use a QStackedWidget for that.

          You could also set a background image on your widget.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • M Mizmas

            @SGaist Yes, I could import an image of a slider knob and use it as a resource on the slider widget's handle, but you can't put a slider widget on top of a label widget in a layout, can you? In the gui, I want to keep the black background, and I also want to import an image to represent the physical hardware midi controller that has slider/fader potentiometers.

            M Offline
            M Offline
            mpergand
            wrote on last edited by mpergand
            #5

            @Mizmas said in What's the best way to animate an image:

            I also want to import an image to represent the physical hardware midi controller that has slider/fader potentiometers.

            Draw your own controllers starting by subclassing QAbstractButton.
            All the widgets in the following pictures are drawn with QPainterPath & QGradiant, nothing else.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SamiV123
              wrote on last edited by
              #6

              You could also look into using a style engine with SVG support. for example kvAntum.

              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