From 2adaf05d4a2afad43bf511882ecc974ca071b72f Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 11 Mar 2016 09:46:28 +0100 Subject: Test Material fonts Change-Id: Id80b0e851c82eecd6a8ae32f436b1a4bde0df40a Task-number: QTBUG-50984 Task-number: QTBUG-51696 Reviewed-by: Liang Qi --- tests/auto/material/data/tst_material.qml | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'tests/auto') 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() + } } -- cgit v1.2.3