From 476adce4a7cfc2df83f60da17dc14b821f35be13 Mon Sep 17 00:00:00 2001 From: Vladimir Belyavsky Date: Mon, 4 Dec 2023 20:40:49 +0300 Subject: [PATCH] tst_textarea: fix warnings Fix all warnings encountered in test run: - in test_alignment() QWARN Could not set initial property horizontalAlignment - in test_flickable(): QWARN Setting initial properties failed: QQuickFlickable does not have a property called selectByMouse QWARN Setting initial properties failed: QQuickFlickable does not have a property called text - in test_font_explicit_attributes(family) QWARN qt.qpa.fonts: Populating font family aliases took 130 ms. Replace uses of missing font family "Courier" with one that exists to avoid this cost. Fixes: QTBUG-119645 Task-number: QTBUG-99231 Pick-to: 6.6 6.5 Change-Id: I9939286c46eebc188610ee0b09350be8dda833b3 Reviewed-by: Mitch Curtis (cherry picked from commit ea3d7ec08b99914ccd961ca7a46ea8abdbc3f54d) Reviewed-by: Qt Cherry-pick Bot --- .../auto/quickcontrols/controls/data/tst_textarea.qml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/auto/quickcontrols/controls/data/tst_textarea.qml b/tests/auto/quickcontrols/controls/data/tst_textarea.qml index 1e03947e05..1831700345 100644 --- a/tests/auto/quickcontrols/controls/data/tst_textarea.qml +++ b/tests/auto/quickcontrols/controls/data/tst_textarea.qml @@ -207,10 +207,12 @@ TestCase { } function test_alignment(data) { - var control = createTemporaryObject(textArea, testCase, {text: data.text, placeholderText: data.placeholderText, horizontalAlignment: data.textAlignment}) + var control = createTemporaryObject(textArea, testCase, {text: data.text, placeholderText: data.placeholderText}) - if (data.textAlignment !== undefined) + if (data.textAlignment !== undefined) { + control.horizontalAlignment = data.textAlignment compare(control.horizontalAlignment, data.textAlignment) + } // The placeholder text of the Material style doesn't currently respect the alignment of the control. if (StyleInfo.styleName !== "Material") { @@ -234,7 +236,7 @@ TestCase { return [ {tag: "bold", value: true}, {tag: "capitalization", value: Font.Capitalize}, - {tag: "family", value: "Courier"}, + {tag: "family", value: "Tahoma"}, {tag: "italic", value: true}, {tag: "strikeout", value: true}, {tag: "underline", value: true}, @@ -272,7 +274,7 @@ TestCase { } function test_flickable() { - var control = createTemporaryObject(flickable, testCase, {text:"line0", selectByMouse: true}) + var control = createTemporaryObject(flickable, testCase) verify(control) var textArea = control.TextArea.flickable