Solved QList<QColor> exposed to QML via model role
-
Hi
I have QList<QColor> and I'm exposing it via role from cpp model to QML like this:case GradientColorRole: { QVariantList vl; for(QColor color:p->gradient_color) { vl.append(QVariant(color)); } return vl; }
Is there simpler one line method ?
on QML side I have array gradient_color[0...n]Best,
Marek -
If you want the list of colors at QML side, this is the only option.
-
@dheerendra thanks, no more question on that subject ;)