[Qt-qml] QColor::setNamedColor: Unknown color and QVariant properties

Girish Ramakrishnan girish at forwardbias.in
Fri May 6 13:55:17 CEST 2011


Hi,
I have tried to debug this twice before and given up :)

In our code, we have been seeing "QColor::setNamedColor: Unknown color
name 'visbile'" from our application for quite sometime now. I usually
run with QT_FATAL_WARNINGS=1 and that warning was driving me mad. I
narrowed it down finally to this seemingly harmless code:
                    PropertyAction { target: selectedElement;
property: "state"; value: "visible" }

It turns out PropertyAction uses QVariant properties. The QML engine
attempts to convert strings to standard QVariant's (variantFromString)
and fails while attempting various standard conversions one of them
being QColor.

I opened QTBUG-19098.

Girish


More information about the Qt-qml mailing list