Results 1 to 4 of 4

Thread: Create dynamic QML components from within C++?

  1. #1
    Join Date
    Apr 2014
    Posts
    125
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Question Create dynamic QML components from within C++?

    Hello

    How to create a dynamic QML components from within C++?

    I have tried this but it fails (below QObject pointer is Null):

    QUrl t = QUrl(QStringLiteral("qrc:/path1/path11/path111/file.qml"));
    QQmlComponent component(m_qmlEngine, t);
    QObject *object = component.create(); // why object is NULL?

    Is there another way to create a QML object from a .qml file?

    Thanks

    Mut

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Create dynamic QML components from within C++?

    Please tell me you did not just post the same question three times.

    Cheers,
    _

  3. #3
    Join Date
    Apr 2014
    Posts
    125
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Default Re: Create dynamic QML components from within C++?

    Thanks for the reply. No at all, they have the same title.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Create dynamic QML components from within C++?

    They all seem to be about loading a QML component from C++.

    But lets for a moment assume that you are not spamming and want your account to be disabled, then the question is: have you checked the component's errors?

    Cheers,
    _

Similar Threads

  1. Replies: 1
    Last Post: 20th October 2012, 11:47
  2. Create dynamic QML components from within C++! How to?
    By jackmack in forum Qt Programming
    Replies: 1
    Last Post: 12th October 2012, 08:52
  3. Replies: 0
    Last Post: 29th March 2012, 19:56
  4. How should I create a view with dynamic fields?
    By ls4f in forum Qt Programming
    Replies: 10
    Last Post: 22nd December 2011, 16:36
  5. Replies: 1
    Last Post: 20th January 2011, 17:17

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.