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 Qt Quick Controls fully programmatically?
Forum Update on Monday, May 27th 2025

Create Qt Quick Controls fully programmatically?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.2k Views
  • 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.
  • J Offline
    J Offline
    jpcolcom
    wrote on 3 Sept 2014, 10:47 last edited by
    #1

    Hi guy's

    is it possible to create qt quick controls without using QML files?
    Therefore fully programmatically by Qt C++ Code?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      t3685
      wrote on 3 Sept 2014, 10:50 last edited by
      #2

      Yes:

      http://qt-project.org/doc/qt-5/qquickitem.html#details

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jpcolcom
        wrote on 3 Sept 2014, 10:57 last edited by
        #3

        Great, works. Thanks!

        @TestObject:: TestObject(QQuickItem *parent) : QQuickItem (parent) {
        this->setFlag(ItemHasContents, true);
        }

        QSGNode * TestObject::updatePaintNode(QSGNode *node, UpdatePaintNodeData *) {

        QSGSimpleRectNode *pNode = static_cast<QSGSimpleRectNode *>(node);
        if (! pNode) {
        pNode = new QSGSimpleRectNode();
        pNode->setColor(Qt::red);
        }
        pNode->setRect(boundingRect());
        return pNode;
        }@

        1 Reply Last reply
        0

        1/3

        3 Sept 2014, 10:47

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved