From fb1d80b3210d7ebedc6865b57d61f2260e87b2f0 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 25 Jun 2021 11:38:37 +0200 Subject: Revert "ToolTip: use contentWidth of Text contentItem to account for newlines" This reverts commit a063cd0be5e8f108a0084831856f4af8c0e9159c. It causes QTBUG-94764. Task-number: QTBUG-83630 Task-number: QTBUG-94764 Change-Id: Ib27d827e25d4e4cea805d0f8e3c32b8aa843ec6a Reviewed-by: Fabian Kosmale Reviewed-by: Richard Moe Gustavsen (cherry picked from commit 009a0262bc0436d4822a3438fc99e02ed15dfc69) Reviewed-by: Qt Cherry-pick Bot --- .../auto/quickcontrols2/controls/data/tst_tooltip.qml | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'tests') diff --git a/tests/auto/quickcontrols2/controls/data/tst_tooltip.qml b/tests/auto/quickcontrols2/controls/data/tst_tooltip.qml index 2f98a5f3d2..b4e992a46a 100644 --- a/tests/auto/quickcontrols2/controls/data/tst_tooltip.qml +++ b/tests/auto/quickcontrols2/controls/data/tst_tooltip.qml @@ -75,11 +75,6 @@ TestCase { SignalSpy { } } - Component { - id: itemComponent - Item {} - } - QtObject { id: object } @@ -451,19 +446,6 @@ TestCase { verify(item.ToolTip.toolTip.contentItem.width < item.ToolTip.toolTip.contentItem.implicitWidth) } - // QTBUG-83630: Test that newlines are accounted for in the implicit contentWidth. - function test_newLines() { - var item = createTemporaryObject(itemComponent, testCase) - verify(item) - - item.ToolTip.show("This is one line of text\nThis is another line of text") - - // The implicitWidth of the Text item for the text above will be larger than - // its contentWidth. ToolTip's implicitWidth uses contentWidth in its calculation, - // so we check that it's less than the Text's implicitWidth. - verify(item.ToolTip.toolTip.implicitWidth < item.ToolTip.toolTip.contentItem.implicitWidth) - } - function test_timeoutAfterOpened() { let control = createTemporaryObject(toolTipWithExitTransition, testCase, { timeout: 1, exit: null }) verify(control) -- cgit v1.2.3