diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2020-10-23 12:03:19 +0200 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2020-10-23 13:47:37 +0200 |
commit | 1596dbf081ff52d3fe07fdccfd69ffdf1b28e92c (patch) | |
tree | ad7aebcf3fb3f79f7f8c24399606dbcbf42b5296 /src/qml/qml/qqmlvaluetype.cpp | |
parent | b5501e9043cabcbf74d3d53b424ece5deb706a27 (diff) |
qqmlvaluetypes: Add a few missing toString methods
Implements toString for QQmlPointValueType, QQmlRectValueType and
QQmlSizeValueType.
Change-Id: Ia8dad072453caea24f6f351cf3da9d0ed085b2a1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlvaluetype.cpp')
-rw-r--r-- | src/qml/qml/qqmlvaluetype.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlvaluetype.cpp b/src/qml/qml/qqmlvaluetype.cpp index e996717051..9f19f21664 100644 --- a/src/qml/qml/qqmlvaluetype.cpp +++ b/src/qml/qml/qqmlvaluetype.cpp @@ -348,6 +348,11 @@ void QQmlPointFValueType::setY(qreal y) } +QString QQmlPointValueType::toString() const +{ + return QString::asprintf("QPoint(%d, %d)", v.x(), v.y()); +} + int QQmlPointValueType::x() const { return v.x(); @@ -395,6 +400,11 @@ void QQmlSizeFValueType::setHeight(qreal h) } +QString QQmlSizeValueType::toString() const +{ + return QString::asprintf("QSize(%d, %d)", v.width(), v.height()); +} + int QQmlSizeValueType::width() const { return v.width(); @@ -480,6 +490,12 @@ qreal QQmlRectFValueType::bottom() const return v.bottom(); } + +QString QQmlRectValueType::toString() const +{ + return QString::asprintf("QRect(%d, %d, %d, %d)", v.x(), v.y(), v.width(), v.height()); +} + int QQmlRectValueType::x() const { return v.x(); |