diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-11 09:46:28 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-11 15:29:12 +0000 |
commit | 2adaf05d4a2afad43bf511882ecc974ca071b72f (patch) | |
tree | ba912229ba9b20b788d269005881d3bc3b853b7d | |
parent | a06018e742ab913338b0056ff2834d3e380e7129 (diff) |
Test Material fonts
Change-Id: Id80b0e851c82eecd6a8ae32f436b1a4bde0df40a
Task-number: QTBUG-50984
Task-number: QTBUG-51696
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
-rw-r--r-- | tests/auto/material/data/tst_material.qml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/material/data/tst_material.qml b/tests/auto/material/data/tst_material.qml index 6cd704eb..2636bec0 100644 --- a/tests/auto/material/data/tst_material.qml +++ b/tests/auto/material/data/tst_material.qml @@ -371,4 +371,45 @@ TestCase { control.destroy() } + + function test_font_data() { + return [ + {tag: "Button:pixelSize", type: "Button", attribute: "pixelSize", value: 14}, + {tag: "Button:weight", type: "Button", attribute: "weight", value: Font.Medium}, + {tag: "Button:capitalization", type: "Button", attribute: "capitalization", value: Font.AllUppercase}, + + {tag: "TabButton:pixelSize", type: "TabButton", attribute: "pixelSize", value: 14}, + {tag: "TabButton:weight", type: "TabButton", attribute: "weight", value: Font.Medium}, + {tag: "TabButton:capitalization", type: "TabButton", attribute: "capitalization", value: Font.AllUppercase}, + + {tag: "ToolButton:pixelSize", type: "ToolButton", attribute: "pixelSize", value: 14}, + {tag: "ToolButton:weight", type: "ToolButton", attribute: "weight", value: Font.Normal}, + {tag: "ToolButton:capitalization", type: "ToolButton", attribute: "capitalization", value: Font.AllUppercase}, + + {tag: "ItemDelegate:pixelSize", type: "ItemDelegate", attribute: "pixelSize", value: 14}, + {tag: "ItemDelegate:weight", type: "ItemDelegate", attribute: "weight", value: Font.Medium}, + {tag: "ItemDelegate:capitalization", type: "ItemDelegate", attribute: "capitalization", value: Font.MixedCase}, + + {tag: "CheckBox:pixelSize", type: "CheckBox", attribute: "pixelSize", value: 16}, + {tag: "CheckBox:weight", type: "CheckBox", attribute: "weight", value: Font.Normal}, + {tag: "CheckBox:capitalization", type: "CheckBox", attribute: "capitalization", value: Font.MixedCase}, + + {tag: "RadioButton:pixelSize", type: "RadioButton", attribute: "pixelSize", value: 16}, + {tag: "RadioButton:weight", type: "RadioButton", attribute: "weight", value: Font.Normal}, + {tag: "RadioButton:capitalization", type: "RadioButton", attribute: "capitalization", value: Font.MixedCase}, + + {tag: "MenuItem:pixelSize", type: "MenuItem", attribute: "pixelSize", value: 16}, + {tag: "MenuItem:weight", type: "MenuItem", attribute: "weight", value: Font.Normal}, + {tag: "MenuItem:capitalization", type: "MenuItem", attribute: "capitalization", value: Font.MixedCase} + ] + } + + function test_font(data) { + var control = Qt.createQmlObject("import Qt.labs.controls 1.0; " + data.type + " { }", testCase) + verify(control) + + compare(control.font[data.attribute], data.value) + + control.destroy() + } } |