Important: Please read the Qt Code of Conduct -

[SOLVED]Create dynamic C++ objects into QML

  • 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

  • Which method is not called??

  • virtual void paint(QPanter*) inherited by QQuickPaintedItem

  • solved by setting parent correctly.

Log in to reply