QtQuick animation types are not accessible from C++
-
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
-
Hi
Did you try the QObject way ?
https://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.htmlI know you wont get the excact type but you should have access to all properties etc.
-
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
@gustorse
most QML types are implemented in C++ - in the private part of the library (note theQ_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.