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. Create QML object dynamically from C++
Forum Updated to NodeBB v4.3 + New Features

Create QML object dynamically from C++

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 498 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.
  • M Offline
    M Offline
    MartinD
    wrote on last edited by
    #1

    I have a QML component defined in C++ class.

    #ifndef MYITEM_H
    #define MYITEM_H
    
    #include <QObject>
    #include <QtQuick>
    
    class MyItem : public QQuickItem
    {
      Q_OBJECT
    public:
      explicit MyItem();
    };
    
    #endif // MYITEM_H
    
    

    How to dynamically create instance of this object in C++ and pass it do QML GUI?

    1 Reply Last reply
    0
    • benlauB Offline
      benlauB Offline
      benlau
      Qt Champions 2016
      wrote on last edited by
      #2

      Could you describe your use-case?

      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