aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2021-08-13 15:16:38 +0200
committerMitch Curtis <mitch.curtis@qt.io>2021-08-16 11:23:52 +0200
commit05522a30193a3090dd7cae26b36d675ae1f18e08 (patch)
treeeec5f50d0cc86cf292ab8a40ed46a50b7fc19e01 /tests
parent78cd4d19cd8ae60f9a0e795337006bf6d504580d (diff)
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 (adapted from from commit 009a0262bc0436d4822a3438fc99e02ed15dfc69) Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_tooltip.qml22
1 files changed, 2 insertions, 20 deletions
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml
index 154eb2bf..6d45b09d 100644
--- a/tests/auto/controls/data/tst_tooltip.qml
+++ b/tests/auto/controls/data/tst_tooltip.qml
@@ -75,11 +75,6 @@ TestCase {
SignalSpy { }
}
- Component {
- id: itemComponent
- Item {}
- }
-
QtObject {
id: object
}
@@ -223,8 +218,8 @@ TestCase {
}
function test_warning() {
- ignoreWarning(new RegExp(".*QML QtObject: ToolTip must be attached to an Item"))
- ignoreWarning(new RegExp(".*QML ToolTip: cannot find any window to open popup in."))
+ ignoreWarning(Qt.resolvedUrl("tst_tooltip.qml") + ":78:5: QML QtObject: ToolTip must be attached to an Item")
+ ignoreWarning("<Unknown File>:1:30: QML ToolTip: cannot find any window to open popup in.")
object.ToolTip.show("") // don't crash (QTBUG-56243)
}
@@ -479,17 +474,4 @@ TestCase {
compare(item.ToolTip.toolTip.contentItem.wrapMode, Text.Wrap)
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)
- }
}