Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Animation Framework documentation
Forum Updated to NodeBB v4.3 + New Features

Animation Framework documentation

Scheduled Pinned Locked Moved Unsolved Qt for Python
6 Posts 3 Posters 607 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.
  • S Offline
    S Offline
    Strangelove
    wrote on last edited by
    #1

    Hello,

    I am learning Qt for Python from the docs, scattered tutorials and a few, rare, YouTube videos. The experience has been particularily difficult, especially compared to other frameworks (e.g. SwiftUI), due to the scarcity of well-organised learning material. The official documentation especially is often very terse and uses C++ for its examples, which doesn't help.

    I have managed to build a couple of interactive applications, though, from what I've learned and I wish to continue my understanding of the framework.

    A major hurdle for me is the Animation Framework. I've tried to use it to animate very basic stuff — a QGraphicsItem's opacity for example — but up to now nothing has worked. I've read the docs for QPropertyAnimation and Property, and tried to follow some web tutorials which go through the same examples. But I can't find a detailed explanation of the class which could help me design my own animations. For example, I couldn't find an explanation of what the 'geometry' string refers to in the following code, or a list of other string which can be passed in this case:

    animation = QPropertyAnimation(myWidget, "geometry")
    

    Is the any resource you could recommend for learning about this part of the framework, especially when it comes to animating QGraphicsItem objects?

    Thank you for your patience.

    jsulmJ 1 Reply Last reply
    0
    • S Strangelove

      Hello,

      I am learning Qt for Python from the docs, scattered tutorials and a few, rare, YouTube videos. The experience has been particularily difficult, especially compared to other frameworks (e.g. SwiftUI), due to the scarcity of well-organised learning material. The official documentation especially is often very terse and uses C++ for its examples, which doesn't help.

      I have managed to build a couple of interactive applications, though, from what I've learned and I wish to continue my understanding of the framework.

      A major hurdle for me is the Animation Framework. I've tried to use it to animate very basic stuff — a QGraphicsItem's opacity for example — but up to now nothing has worked. I've read the docs for QPropertyAnimation and Property, and tried to follow some web tutorials which go through the same examples. But I can't find a detailed explanation of the class which could help me design my own animations. For example, I couldn't find an explanation of what the 'geometry' string refers to in the following code, or a list of other string which can be passed in this case:

      animation = QPropertyAnimation(myWidget, "geometry")
      

      Is the any resource you could recommend for learning about this part of the framework, especially when it comes to animating QGraphicsItem objects?

      Thank you for your patience.

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Strangelove said in Animation Framework documentation:

      I couldn't find an explanation of what the 'geometry' string refers to in the following code

      It refers to the "geometry" property of the QWidget class: https://doc.qt.io/qt-5/qwidget.html#geometry-prop
      QPropertyAnimation animates properties, so you have to provide name of the property you want to animate.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

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

        Hi and welcome to devnet,

        The Python documentation is generated from the C++ documentation but not all the C++ snippets have been translated yet (work in progress on that front).

        That said, most of the C++ examples and snippets should not be too complicated to translated to Python.

        As for your question about "geometry", it's literally the name of the property you are going to animate.

        QObject based classes can have a number of Q_PROPERTY, these are the ones you can modify using QPropertyAnimation provided that said property is writable.

        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
        • S Offline
          S Offline
          Strangelove
          wrote on last edited by
          #4

          Thank you for your quick replies. I've followed @jsulm's link and was surprised to see a list of properties. I wondered how I could have missed that. Then I went to the equivalent page in the Python docs, where the list is presented as part of the "functions" list, where functions and properties are mixed together. I understood then why it didn't click for me, as this is far from obvious to a beginner IMHO.

          I presume I can now animate properties of QWidget, but I still can't figure out how to do the same with a QGraphicsItem. I really miss a comprehensive introduction to the framework using Python, since all of the existing books I saw use C++ (which is far from trivial to pick up, especially if you're already struggling with a new GUI framework).

          Any ideas on:

          • QGraphicsItem animation using Python?
          • Leaning resources I might have missed?

          Thanks again.

          jsulmJ 1 Reply Last reply
          0
          • S Strangelove

            Thank you for your quick replies. I've followed @jsulm's link and was surprised to see a list of properties. I wondered how I could have missed that. Then I went to the equivalent page in the Python docs, where the list is presented as part of the "functions" list, where functions and properties are mixed together. I understood then why it didn't click for me, as this is far from obvious to a beginner IMHO.

            I presume I can now animate properties of QWidget, but I still can't figure out how to do the same with a QGraphicsItem. I really miss a comprehensive introduction to the framework using Python, since all of the existing books I saw use C++ (which is far from trivial to pick up, especially if you're already struggling with a new GUI framework).

            Any ideas on:

            • QGraphicsItem animation using Python?
            • Leaning resources I might have missed?

            Thanks again.

            jsulmJ Online
            jsulmJ Online
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Strangelove There is https://doc.qt.io/qtforpython/PySide6/QtWidgets/QWidget.html#groups-of-functions-and-properties But it is also not really clean and obvious. You should also check C++ Qt documentation for now, maybe the Python documentation will improve one day :-)

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            S 1 Reply Last reply
            0
            • jsulmJ jsulm

              @Strangelove There is https://doc.qt.io/qtforpython/PySide6/QtWidgets/QWidget.html#groups-of-functions-and-properties But it is also not really clean and obvious. You should also check C++ Qt documentation for now, maybe the Python documentation will improve one day :-)

              S Offline
              S Offline
              Strangelove
              wrote on last edited by
              #6

              @jsulm said in Animation Framework documentation:

              maybe the Python documentation will improve one day :-)

              I certainly hope so. Thanks.

              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