diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-16 12:24:53 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-16 12:24:53 +0100 |
commit | 3087a43e482789d90474bca42bef317a9a87da10 (patch) | |
tree | fc6100b366e4a4d1d36329cb1a62f7ec80af8511 /tests/auto/controls/data/tst_control.qml | |
parent | ef885485a19f0e70273650d88312af0195c32920 (diff) | |
parent | 495ef4fbb9766a766dcc6390636f785bf7bb09d9 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
src/controls/qquickstyle.cpp
src/templates/qquickcontrol.cpp
src/templates/qquickcontrol_p.h
src/templates/qquickpopup.cpp
tests/auto/controls/data/tst_combobox.qml
tests/auto/controls/data/tst_control.qml
Change-Id: Ib7853d5ee5c4444872cd5c2d789e20d229c955d1
Diffstat (limited to 'tests/auto/controls/data/tst_control.qml')
-rw-r--r-- | tests/auto/controls/data/tst_control.qml | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_control.qml b/tests/auto/controls/data/tst_control.qml index fae20829..115d1f81 100644 --- a/tests/auto/controls/data/tst_control.qml +++ b/tests/auto/controls/data/tst_control.qml @@ -61,6 +61,11 @@ TestCase { T.Button { } } + Component { + id: signalSpy + SignalSpy { } + } + SignalSpy { id: mirroredSpy signalName: "mirroredChanged" @@ -631,6 +636,49 @@ TestCase { control4.destroy() } + function test_font_explicit_attributes_data() { + return [ + {tag: "bold", value: true}, + {tag: "capitalization", value: Font.Capitalize}, + {tag: "family", value: "Courier"}, + {tag: "italic", value: true}, + {tag: "strikeout", value: true}, + {tag: "underline", value: true}, + {tag: "weight", value: Font.Black}, + {tag: "wordSpacing", value: 55} + ] + } + + function test_font_explicit_attributes(data) { + var control = component.createObject(testCase) + verify(control) + + var child = component.createObject(control) + verify(child) + + var controlSpy = signalSpy.createObject(control, {target: control, signalName: "fontChanged"}) + verify(controlSpy.valid) + + var childSpy = signalSpy.createObject(child, {target: child, signalName: "fontChanged"}) + verify(childSpy.valid) + + var defaultValue = control.font[data.tag] + child.font[data.tag] = defaultValue + + compare(child.font[data.tag], defaultValue) + compare(childSpy.count, 0) + + control.font[data.tag] = data.value + + compare(control.font[data.tag], data.value) + compare(controlSpy.count, 1) + + compare(child.font[data.tag], defaultValue) + compare(childSpy.count, 0) + + control.destroy() + } + function test_locale() { var control = component.createObject(testCase) verify(control) |