Unsolved How to set different colors from cpp to the rectangle in Qml
-
This post is deleted! -
Hi,
You should share a minimal compilable example. Otherwise its impossible to guess what is going wrong.
-
I need to set x and y position and color from Cpp model instead of setting in qml , how can i set it using QStandardItemModel?
-
@sush123 See my answer of similar question in SO: https://stackoverflow.com/questions/51300494/drawing-multiple-rectangles-into-image-in-qml Or https://stackoverflow.com/questions/54858514/qml-nested-rectangles, The last post is written for PySide2 but the logic can be translated for Qt/C++
-
This post is deleted! -
This post is deleted! -
@sush123 Which exact line in your code causes this error?
The error message already suggest you a solution: https://doc.qt.io/qt-5/qmetatype.html#Q_DECLARE_METATYPE -
This post is deleted!