Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QtQuick animation types are not accessible from C++
Forum Updated to NodeBB v4.3 + New Features

QtQuick animation types are not accessible from C++

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 278 Views 2 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.
  • G Offline
    G Offline
    gustorse
    wrote on last edited by
    #1

    Hello,

    it seems the QtQuick types for Timelines and related animations are not accessible via C++.
    I would like to pass animation objects of base type QQuickPropertyAnimation to a c++ function in order to centrally control their playback and properties. But there is no way to include related types like PropertyAnimation.

    Did I miss something?

    Platform: Qt 5.15 MinGW 64 on Windows 10 + added QtQuick Timeline Package

    raven-worxR 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Did you try the QObject way ?
      https://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.html

      I know you wont get the excact type but you should have access to all properties etc.

      1 Reply Last reply
      1
      • G gustorse

        Hello,

        it seems the QtQuick types for Timelines and related animations are not accessible via C++.
        I would like to pass animation objects of base type QQuickPropertyAnimation to a c++ function in order to centrally control their playback and properties. But there is no way to include related types like PropertyAnimation.

        Did I miss something?

        Platform: Qt 5.15 MinGW 64 on Windows 10 + added QtQuick Timeline Package

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by raven-worx
        #3

        @gustorse
        most QML types are implemented in C++ - in the private part of the library (note the Q_QUICK_PRIVATE_EXPORT specifier of the classes).
        With qmake you can add the following line in your .pro file and access those types:

        QT += quick-private

        But note that this implies it will only work with exactly this Qt version you built your binary against and will most probably crash when running it against a different version. Just to keep in mind you will loose binary compatibility.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        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