MCPcopy Create free account
hub / github.com/GilesBathgate/RapCAD / event

Method event

src/ui/codeeditor.cpp:256–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256bool CodeEditor::event(QEvent* event)
257{
258 if(!showTooltips)
259 return QPlainTextEdit::event(event);
260
261 if(event->type()==QEvent::ToolTip) {
262 auto* helpEvent = dynamic_cast<QHelpEvent*>(event);
263 QTextCursor cursor = cursorForPosition(helpEvent->pos());
264 cursor.select(QTextCursor::WordUnderCursor);
265 Module* m = moduleNames.value(cursor.selectedText());
266 if(m) {
267 QRect r=cursorRect(cursor);
268 QToolTip::showText(mapToGlobal(QPoint(r.x(),r.y())), m->getDescription());
269 } else {
270 QToolTip::hideText();
271 }
272 return true;
273 }
274 if(event->type()==QEvent::KeyPress) {
275 QToolTip::hideText();
276 }
277 return QPlainTextEdit::event(event);
278}
279
280void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent* event)
281{

Callers

nothing calls this directly

Calls 4

valueMethod · 0.80
xMethod · 0.80
yMethod · 0.80
getDescriptionMethod · 0.45

Tested by

no test coverage detected