From ed52bc55df7a9f2bcc9f1149a82483c00a8107c2 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 9 Apr 2026 18:00:35 +0100 Subject: [PATCH] Backport Qt implementation of calltips in Scintilla * Taken from https://sourceforge.net/p/scintilla/code/ci/a82b87a88556f0bc23b7ff6 f4bdfd5241ef44a62/ upstream --- .../qt/ScintillaEditBase/ScintillaQt.cpp | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/qrenderdoc/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.cpp b/qrenderdoc/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.cpp index b872b1363..777f0dedf 100644 --- a/qrenderdoc/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.cpp +++ b/qrenderdoc/3rdparty/scintilla/qt/ScintillaEditBase/ScintillaQt.cpp @@ -616,11 +616,36 @@ void ScintillaQt::StartDrag() SetDragPosition(SelectionPosition(invalidPosition)); } +class CallTipImpl : public QWidget { +public: + CallTipImpl(CallTip *pct_) + : QWidget(nullptr, Qt::ToolTip), + pct(pct_) + { + setWindowFlag(Qt::WindowTransparentForInput); + } + + void paintEvent(QPaintEvent *) override + { + if (pct->inCallTipMode) { + Surface *surfaceWindow = Surface::Allocate(0); + surfaceWindow->Init(this); + surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == pct->codePage); + surfaceWindow->SetDBCSMode(pct->codePage); + pct->PaintCT(surfaceWindow); + delete surfaceWindow; + } + } + +private: + CallTip *pct; +}; + void ScintillaQt::CreateCallTipWindow(PRectangle rc) { if (!ct.wCallTip.Created()) { - QWidget *pCallTip = new QWidget(0, Qt::ToolTip); + QWidget *pCallTip = new CallTipImpl(&ct); ct.wCallTip = pCallTip; pCallTip->move(rc.left, rc.top); pCallTip->resize(rc.Width(), rc.Height());