aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_abstractbutton.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/controls/data/tst_abstractbutton.qml')
-rw-r--r--tests/auto/controls/data/tst_abstractbutton.qml37
1 files changed, 32 insertions, 5 deletions
diff --git a/tests/auto/controls/data/tst_abstractbutton.qml b/tests/auto/controls/data/tst_abstractbutton.qml
index 4e635d63..ba5ee94c 100644
--- a/tests/auto/controls/data/tst_abstractbutton.qml
+++ b/tests/auto/controls/data/tst_abstractbutton.qml
@@ -40,7 +40,7 @@
import QtQuick 2.2
import QtTest 1.0
-import Qt.labs.templates 1.0
+import QtQuick.Controls 2.0
TestCase {
id: testCase
@@ -55,6 +55,11 @@ TestCase {
AbstractButton {}
}
+ Component {
+ id: item
+ Item { }
+ }
+
function test_text() {
var control = button.createObject(testCase);
verify(control);
@@ -68,12 +73,34 @@ TestCase {
control.destroy();
}
- function test_highlighted() {
+ function test_baseline() {
+ var control = button.createObject(testCase, {padding: 6})
+ verify(control)
+ compare(control.baselineOffset, 0)
+ control.contentItem = item.createObject(control, {baselineOffset: 12})
+ compare(control.baselineOffset, 18)
+ control.destroy()
+ }
+
+ function test_implicitSize() {
var control = button.createObject(testCase)
verify(control)
- compare(control.highlighted, false)
- control.highlighted = true
- compare(control.highlighted, true)
+ compare(control.implicitWidth, 0)
+ compare(control.implicitHeight, 0)
+
+ control.contentItem = item.createObject(control, {implicitWidth: 10, implicitHeight: 20})
+ compare(control.implicitWidth, 10)
+ compare(control.implicitHeight, 20)
+
+ control.background = item.createObject(control, {implicitWidth: 20, implicitHeight: 30})
+ compare(control.implicitWidth, 20)
+ compare(control.implicitHeight, 30)
+
+ control.padding = 100
+ compare(control.implicitWidth, 210)
+ compare(control.implicitHeight, 220)
+
+ control.destroy()
}
}