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>
This commit is contained in:
Christian Stenger
2021-08-13 09:31:27 +02:00
parent c9e18ce538
commit bfee48ab0b

View File

@@ -155,6 +155,8 @@ void ToolTip::show(
{ {
if (content && content->count()) { if (content && content->count()) {
auto tooltipWidget = new FakeToolTip; 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()) { if (contextHelp.isNull()) {
tooltipWidget->setLayout(content); tooltipWidget->setLayout(content);
} else { } else {