From a62460fb1c969c8f825d54cc1695e738bcffdfcd Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 10 Apr 2025 13:45:27 +0200 Subject: [PATCH] Editor: fix annotation tooltips for horizontally scrolled editors Fixes: QTCREATORBUG-32658 Change-Id: I6853617e1b564d25bff1ec40735b5f1d0e79f0ae Reviewed-by: Eike Ziller --- src/plugins/texteditor/texteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index fc562fc7a79..97d15a5df14 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -4969,7 +4969,7 @@ bool TextEditorWidget::viewportEvent(QEvent *event) // Only handle tool tip for text cursor if mouse is within the block for the text cursor, // and not if the mouse is e.g. in the empty space behind a short line. if (line.isValid()) { - const QRectF blockGeometry = blockBoundingGeometry(block); + const QRectF blockGeometry = blockBoundingGeometry(block).translated(contentOffset()); const int width = block == d->m_suggestionBlock ? blockGeometry.width() : line.naturalTextRect().right(); if (pos.x() <= blockGeometry.left() + width) {