MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / operateTooltip

Method operateTooltip

widgets/CompletionProgressHandler.cpp:64–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void CompletionProgressHandler::operateTooltip(
65 TextEditor::TextEditorWidget *editorWidget, const QPoint &point)
66{
67 if (!editorWidget)
68 return;
69
70 if (m_progressWidget) {
71 delete m_progressWidget;
72 }
73
74 m_progressWidget = new ProgressWidget(editorWidget);
75
76 if (m_cancelCallback) {
77 m_progressWidget->setCancelCallback(m_cancelCallback);
78 }
79
80 const QRect cursorRect = editorWidget->cursorRect(editorWidget->textCursor());
81 QPoint globalPos = editorWidget->viewport()->mapToGlobal(cursorRect.topLeft());
82 QPoint localPos = editorWidget->mapFromGlobal(globalPos);
83
84 localPos.rx() += 5;
85 localPos.ry() -= m_progressWidget->height() + 5;
86
87 if (localPos.y() < 0) {
88 localPos.ry() = cursorRect.bottom() + 5;
89 }
90
91 m_progressWidget->move(localPos);
92 m_progressWidget->show();
93 m_progressWidget->raise();
94}
95
96} // namespace QodeAssist

Callers

nothing calls this directly

Calls 2

setCancelCallbackMethod · 0.45
raiseMethod · 0.45

Tested by

no test coverage detected