| 17 | } |
| 18 | |
| 19 | void EditorChatButtonHandler::showButton(TextEditor::TextEditorWidget *widget) |
| 20 | { |
| 21 | if (!widget) |
| 22 | return; |
| 23 | |
| 24 | m_widget = widget; |
| 25 | |
| 26 | identifyMatch(widget, widget->textCursor().position(), [this](auto priority) { |
| 27 | if (priority != Priority_None && m_widget) { |
| 28 | const QTextCursor cursor = m_widget->textCursor(); |
| 29 | const QRect selectionRect = m_widget->cursorRect(cursor); |
| 30 | m_cursorPosition = m_widget->viewport()->mapToGlobal(selectionRect.topLeft()) |
| 31 | - Utils::ToolTip::offsetFromPosition(); |
| 32 | operateTooltip(m_widget, m_cursorPosition); |
| 33 | } |
| 34 | }); |
| 35 | } |
| 36 | |
| 37 | void EditorChatButtonHandler::hideButton() |
| 38 | { |