Commit 579204d3 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.propertyEditor: preserve alpha value

Task-number: QTCREATORBUG-5683
Change-Id: I5101eb4bdb73938628c0f0acc3ebf16868b53cb2
Reviewed-on: http://codereview.qt.nokia.com/2522Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent ad3b92b1
......@@ -105,7 +105,11 @@ static void fixAmbigousColorNames(const QmlDesigner::ModelNode &modelNode, const
&& (modelNode.metaInfo().propertyTypeName(name) == "QColor"
|| modelNode.metaInfo().propertyTypeName(name) == "color")) {
if ((value->type() == QVariant::Color)) {
*value = QColor(value->value<QColor>().name());
QColor color = value->value<QColor>();
int alpha = color.alpha();
color = QColor(color.name());
color.setAlpha(alpha);
*value = color;
} else {
*value = QColor(value->toString()).name();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment