diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-11-11 12:49:44 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-11-15 13:59:18 +0100 |
commit | 2193e9938e98af39a16f5035789c555f2574020b (patch) | |
tree | 3a1900aa3535ee3cd62ecb219f5bd22f81914993 /tests | |
parent | d04c7121acf66af75f557147ce8d055c62262608 (diff) |
Make ToolTips wrap
Otherwise the text will go outside the window.
Change-Id: I3d50a195b1ee6c9b5d49952ef6c49d17c61372fa
Fixes: QTBUG-62350
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_tooltip.qml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml index 70579c70..d98a7cc8 100644 --- a/tests/auto/controls/data/tst_tooltip.qml +++ b/tests/auto/controls/data/tst_tooltip.qml @@ -421,4 +421,26 @@ TestCase { compare(button2.down, false) tryCompare(button2.ToolTip, "visible", false) } + + Component { + id: wrapComponent + + Item { + ToolTip.text: "This is some very very very very very very very very very very very very" + + " very very very very very very very very very very very very very very" + + " very very very very very very very very very very very very long text" + } + } + + // QTBUG-62350 + function test_wrap() { + var item = createTemporaryObject(wrapComponent, testCase) + verify(item) + + // Avoid "cannot find window to popup in" warning that can occur if it's made visible too early. + item.ToolTip.visible = true + tryCompare(item.ToolTip.toolTip, "opened", true) + compare(item.ToolTip.toolTip.contentItem.wrapMode, Text.Wrap) + verify(item.ToolTip.toolTip.contentItem.width < item.ToolTip.toolTip.contentItem.implicitWidth) + } } |