Results 1 to 2 of 2

Thread: Using QML timeline in a C++ framework

  1. #1
    Join Date
    Feb 2014
    Posts
    26
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Using QML timeline in a C++ framework

    Hi,

    Having quite a beefy C++ project. Starting from scratch would be last resort. New features like “Flow” layout and Timeline are quite attractive but unfortunately, never made it to the QT C++ framework. I’m wondering if it’s possible to leverage QML inside a C++ QApplication?

    More specifically, how would someone go about “creating” a QML Timeline and use it in a C++ QMainWindow?

    My guess is YES as I’ve seen this example but can’t really compile and test it on windows:

    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QGuiApplication app(argc, argv);
    4.  
    5. QSurfaceFormat::setDefaultFormat(QQuick3D::idealSurfaceFormat());
    6. qputenv("QT_QUICK_CONTROLS_STYLE", "Basic");
    7.  
    8. QQmlApplicationEngine engine;
    9. engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    10. if (engine.rootObjects().isEmpty())
    11. return -1;
    12.  
    13. return app.exec();
    14. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by neosettler; 29th June 2024 at 00:58.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,366
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using QML timeline in a C++ framework

    You would need to create a widget that can display a QtQuick scene (QQuickView or QQuickWidget) and deploy a scene there and then expose appropriate bindings between the scene and the rest of your code using context properties in the QML engine.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. How to make a timeline ?
    By azsde in forum Qt Programming
    Replies: 0
    Last Post: 27th May 2015, 13:21
  2. Qt Timeline Widget/View
    By DigiDrag in forum Jobs
    Replies: 0
    Last Post: 18th October 2013, 16:44
  3. Creating a graphic timeline
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 26th November 2012, 14:03
  4. timeline
    By franco.amato in forum Qt Programming
    Replies: 18
    Last Post: 10th December 2009, 02:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.