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. [SOLVED]Create dynamic C++ objects into QML
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]Create dynamic C++ objects into QML

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 1.0k 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.
  • Z Offline
    Z Offline
    Zondar
    wrote on last edited by Zondar
    #1

    Hi,

    Is there a way to create dynamically object, which inherits from QQuickPaintedItem?
    For example I have some class A, which take care of creating instances of class B, which inherits from QQuickPaintedItem. So I have in createAnotherObject method of class A, something like
    B* newObject = new B;
    It will create an object, but paint method is not called even after calling update

    Thanks in advance

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kofr
      wrote on last edited by
      #2

      Which method is not called??

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zondar
        wrote on last edited by Zondar
        #3

        virtual void paint(QPanter*) inherited by QQuickPaintedItem

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          Zondar
          wrote on last edited by
          #4

          solved by setting parent correctly.

          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