aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2021-08-13 09:31:27 +0200
committerChristian Stenger <christian.stenger@qt.io>2021-08-18 08:34:45 +0000
commitbfee48ab0b74338d669773b43b8d32497f97e333 (patch)
tree1ccf08bfc32ee3f154a897b0d9ee908db28cde92
parentc9e18ce53809b7bf5c935f127360d9726e3ff05a (diff)
TextEditor: Limit size of tool tips
Otherwise we may end up in crashes deep inside Qt code on Windows. Fixes: QTCREATORBUG-26112 Change-Id: Iabdd544271a99b680adad3abb84341db2bf2c1f3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--src/libs/utils/tooltip/tooltip.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libs/utils/tooltip/tooltip.cpp b/src/libs/utils/tooltip/tooltip.cpp
index 94d8a4c164..681524372d 100644
--- a/src/libs/utils/tooltip/tooltip.cpp
+++ b/src/libs/utils/tooltip/tooltip.cpp
@@ -155,6 +155,8 @@ void ToolTip::show(
{
if (content && content->count()) {
auto tooltipWidget = new FakeToolTip;
+ // limit the size of the widget to 90% of the screen size to have some context around it
+ tooltipWidget->setMaximumSize(QGuiApplication::screenAt(pos)->availableSize() * 0.9);
if (contextHelp.isNull()) {
tooltipWidget->setLayout(content);
} else {