diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2010-08-13 13:26:44 +0200 |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2010-08-13 13:28:45 +0200 |
commit | 6ec2174791ad254f82ce89618a3642eb3e0689c7 (patch) | |
tree | 11dc32754d013588a7585b3ae7bbd16600306bd6 /src/libs/qmleditorwidgets | |
parent | b1e1692e2328889a14e188e801cd8de042c70b6e (diff) | |
download | qt-creator-6ec2174791ad254f82ce89618a3642eb3e0689c7.tar.gz |
QmlJS: Use QmlJS::toQColor to convert a string to a QColor.
The QColor constructor prints a warning if the string it gets passed
isn't a known color name. Also, it doesn't know about the alpha value
in strings like "#ff00ff00".
Reviewed-by: Thomas Hartmann
Diffstat (limited to 'src/libs/qmleditorwidgets')
-rw-r--r-- | src/libs/qmleditorwidgets/contextpanewidgetrectangle.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/qmleditorwidgets/contextpanewidgetrectangle.cpp b/src/libs/qmleditorwidgets/contextpanewidgetrectangle.cpp index 193d86903d..e80df1aabd 100644 --- a/src/libs/qmleditorwidgets/contextpanewidgetrectangle.cpp +++ b/src/libs/qmleditorwidgets/contextpanewidgetrectangle.cpp @@ -31,6 +31,7 @@ #include "ui_contextpanewidgetrectangle.h" #include "contextpanewidget.h" #include <qmljs/qmljspropertyreader.h> +#include <qmljs/qmljscheck.h> #include <customcolordialog.h> #include <QDebug> @@ -79,7 +80,7 @@ void ContextPaneWidgetRectangle::setProperties(QmlJS::PropertyReader *propertyRe if (propertyReader->hasProperty(QLatin1String("color"))) { QString str = propertyReader->readProperty("color").toString(); - if (QColor(str).alpha() == 0) + if (QmlJS::toQColor(str).alpha() == 0) m_none = true; ui->colorColorButton->setColor(str); |