diff options
author | Robin Burchell <robin.burchell@viroteck.net> | 2016-12-21 16:31:55 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@viroteck.net> | 2016-12-21 23:41:00 +0000 |
commit | fc9754e236b6f93d16d0b52507b0f3a71b0a84e1 (patch) | |
tree | 225663623f05d84bfaba6413791989b18a49eef3 | |
parent | 9774757312cc75e4f49bd14a7729a9fdfb4456ae (diff) |
QQuickValueTypes: Avoid QVariant boxing (and unboxing) to convert color to string
We can maintain the spoken about compatibility without the performance penalty
by inlining what qguivariant.cpp does.
Change-Id: I95a8b8d660fb9104ae2d30d0ece943bccf169679
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
-rw-r--r-- | src/quick/util/qquickvaluetypes.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/quick/util/qquickvaluetypes.cpp b/src/quick/util/qquickvaluetypes.cpp index e673df0451..4afcb07a5c 100644 --- a/src/quick/util/qquickvaluetypes.cpp +++ b/src/quick/util/qquickvaluetypes.cpp @@ -56,8 +56,7 @@ namespace QQuickValueTypes { QString QQuickColorValueType::toString() const { - // to maintain behaviour with QtQuick 1.0, we just output normal toString() value. - return QVariant(v).toString(); + return v.name(v.alpha() != 255 ? QColor::HexArgb : QColor::HexRgb); } qreal QQuickColorValueType::r() const |