diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-05-22 13:03:25 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@theqtcompany.com> | 2015-06-03 04:29:06 +0000 |
commit | db9be0a9d6195bc52415ce28d605ace149d02782 (patch) | |
tree | a1b0dd262e53a08f7015efc8fb8a32ad0b82db9e /tests/auto/qml/qqmlvaluetypes | |
parent | db525935ccd64d2c5c674f8a66dbe7096d754e9f (diff) |
Add left, right, top and bottom properties to basic QML rect type.
Task-number: QTBUG-45528
Task-number: QTBUG-45530
Change-Id: I83c4056b4bde37ef2dc4424ffddd823c1654d92e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'tests/auto/qml/qqmlvaluetypes')
5 files changed, 16 insertions, 8 deletions
diff --git a/tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml b/tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml index c511c2dfc4..104e7ba1e9 100644 --- a/tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml +++ b/tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml @@ -1,10 +1,6 @@ import Test 1.0 MyTypeObject { - property int r_x: rect.x - property int r_y: rect.y - property int r_width: rect.width - property int r_height: rect.height property variant copy: rect property string tostring: rect.toString() diff --git a/tests/auto/qml/qqmlvaluetypes/data/rect_read.qml b/tests/auto/qml/qqmlvaluetypes/data/rect_read.qml index c3b37a7099..da6deddd75 100644 --- a/tests/auto/qml/qqmlvaluetypes/data/rect_read.qml +++ b/tests/auto/qml/qqmlvaluetypes/data/rect_read.qml @@ -5,6 +5,10 @@ MyTypeObject { property int r_y: rect.y property int r_width: rect.width property int r_height: rect.height + property int r_left: rect.left + property int r_right: rect.right + property int r_top: rect.top + property int r_bottom: rect.bottom property variant copy: rect } diff --git a/tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml b/tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml index 6ac4049558..eb61755bcf 100644 --- a/tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml +++ b/tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml @@ -1,10 +1,6 @@ import Test 1.0 MyTypeObject { - property real r_x: rectf.x - property real r_y: rectf.y - property real r_width: rectf.width - property real r_height: rectf.height property variant copy: rectf property string tostring: rectf.toString() diff --git a/tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml b/tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml index 6ff3ce30bf..878868254d 100644 --- a/tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml +++ b/tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml @@ -5,6 +5,10 @@ MyTypeObject { property real r_y: rectf.y property real r_width: rectf.width property real r_height: rectf.height + property real r_left: rectf.left + property real r_right: rectf.right + property real r_top: rectf.top + property real r_bottom: rectf.bottom property variant copy: rectf } diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp index 2892e746da..578004b0a1 100644 --- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp +++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp @@ -371,6 +371,10 @@ void tst_qqmlvaluetypes::rect() QCOMPARE(object->property("r_y").toInt(), 3); QCOMPARE(object->property("r_width").toInt(), 109); QCOMPARE(object->property("r_height").toInt(), 102); + QCOMPARE(object->property("r_left").toInt(), 2); + QCOMPARE(object->property("r_right").toInt(), 110); + QCOMPARE(object->property("r_top").toInt(), 3); + QCOMPARE(object->property("r_bottom").toInt(), 104); QCOMPARE(object->property("copy"), QVariant(QRect(2, 3, 109, 102))); delete object; @@ -418,6 +422,10 @@ void tst_qqmlvaluetypes::rectf() QCOMPARE(float(object->property("r_y").toDouble()), float(99.2)); QCOMPARE(float(object->property("r_width").toDouble()), float(88.1)); QCOMPARE(float(object->property("r_height").toDouble()), float(77.6)); + QCOMPARE(float(object->property("r_left").toDouble()), float(103.8)); + QCOMPARE(float(object->property("r_right").toDouble()), float(191.9)); + QCOMPARE(float(object->property("r_top").toDouble()), float(99.2)); + QCOMPARE(float(object->property("r_bottom").toDouble()), float(176.8)); QCOMPARE(object->property("copy"), QVariant(QRectF(103.8, 99.2, 88.1, 77.6))); delete object; |