QT 4.7.4 SDK 1.1.3 error : QColor::setNamedColor: Unknown color name ’...’
-
i download the new version of SDK 1.1.3 and i tried to run an application that i write before (for the previous version of SDK), but then i get this error all the time:
QColor::setNamedColor: Unknown color name 'true'
QColor::setNamedColor: Unknown color name 'false'why is this error appear ? and how can i fix this?
tnx
-
The errors seem to suggest that you are using "true" and "false" as color names... those are indeed not valid color names.
Looks like some boolean value is converted into a string to me. I'd recommend checking whatever you use to set the colors.
-
Hi,
This is most likely due to some of the QML optimizations done for QtQuick 1.1 (in certain cases, when QML needs to convert from a string to a type, it will go through all it's available "string convertors" (including string->color) and do a trial conversion). The warning has been removed for 4.8.
The extra warning shouldn't impact the actual results, but if you'd like to get rid of the messages I'd suggest looking for any instances where you use the strings 'true'/'false', and see if they can be converted to use true/false boolean values instead. (If you can find the exact code causing the issue there might be other workarounds as well)
Regards,
Michael -
In the case of "true" and "false", simply search your source for "true" and "false" (with the quotes) and remove the quotes.
I had this happen with the following code:
@PropertyAction { target: foo; property: "visible"; value: "true" }@The correct way is:
@PropertyAction { target: foo; property: "visible"; value: true }@If you can't figure out where the error is coming from, place a breakpoint in QColor::setNamedColor(), at the point where the warning is printed. The backtrace will tell you in which .qml file this happens, as some of the internal variables used in the declarative engine reveal the URL.
-
Hey,
I have a Button as like:
@
ToolButton {
enabled: false
id: btn_settings
caption: ""
icon: "icons/settings2.png"
}
@
this is the unique "icons/settings2.png" where i'm using it. What i must to do for fixing that kind of Warnings.Edit: Formatted code. please wrap code in @ tags; mlong
-
Hi nightroad,
What's the property type for the icon property? I'm guessing variant, if you are getting this warning? If that is the case, changing the property type to string or url should fix the issue (assuming you are able to change the component definition).
Regards,
Michael