Editable code editor supporting gutter breakpoints and highlighting.
More...
#include <lua_debugger_code_editor.h>
|
| void | breakpointToggled (const QString &filename, qint32 line, bool toggleActive) |
| | Emitted when a breakpoint icon is clicked within the gutter (right margin).
|
| |
| void | breakpointGutterMenuRequested (const QString &filename, qint32 line, const QPoint &globalPos) |
| | Request an Edit / Disable (Enable) / Remove popup for the breakpoint at filename:line, anchored at globalPos.
|
| |
|
| | LuaDebuggerCodeView (QWidget *parent=nullptr) |
| | Create the code view and configure the line number gutter.
|
| |
| void | lineNumberAreaPaintEvent (QPaintEvent *event) |
| | Paint the custom gutter that hosts line numbers and breakpoints.
|
| |
| qint32 | lineNumberAreaWidth () |
| | Compute the width required for the gutter, including icons.
|
| |
|
void | setFilename (const QString &f) |
| |
|
QString | getFilename () const |
| |
|
void | setCurrentLine (qint32 line) |
| | Set the debugger "execution paused" line (amber bar) and move the caret to that line. Pass <= 0 to clear only the paused-line bar.
|
| |
|
void | clearCurrentLineHighlight () |
| | Clear the debugger paused-line highlight (caret stripe unchanged).
|
| |
|
void | moveCaretToLineStart (qint32 line) |
| | Move the caret to the start of a line without changing the paused line (e.g. go-to-line).
|
| |
|
void | setEditorFont (const QFont &font) |
| | Apply a monospace font to both editor text and gutter.
|
| |
|
void | updateBreakpointMarkers () |
| | Refresh breakpoint markers in the gutter area.
|
| |
|
void | applyTheme () |
| | Re-apply theme colors from the current preference.
|
| |
| QString | luaIdentifierUnderCursor (const QTextCursor &cursor) const |
| | Return the Lua identifier under the given cursor position, or an empty string if the position is not on an identifier.
|
| |
|
QString | watchExpressionForContextMenu (const QPoint &viewportPos) const |
| | Watch text for the editor context menu: trimmed selection if any, otherwise the Lua identifier at viewportPos (viewport coordinates).
|
| |
|
|
void | resizeEvent (QResizeEvent *event) override |
| | Update margins whenever Qt reports a size change.
|
| |
|
bool | eventFilter (QObject *watched, QEvent *event) override |
| | Forward Esc to LuaDebuggerDialog (keys go to viewport, not the dialog).
|
| |
Editable code editor supporting gutter breakpoints and highlighting.
◆ LuaDebuggerCodeView()
| LuaDebuggerCodeView::LuaDebuggerCodeView |
( |
QWidget * |
parent = nullptr | ) |
|
Create the code view and configure the line number gutter.
- Parameters
-
| parent | Optional parent widget for ownership. |
◆ breakpointGutterMenuRequested
| void LuaDebuggerCodeView::breakpointGutterMenuRequested |
( |
const QString & |
filename, |
|
|
qint32 |
line, |
|
|
const QPoint & |
globalPos |
|
) |
| |
|
signal |
Request an Edit / Disable (Enable) / Remove popup for the breakpoint at filename:line, anchored at globalPos.
Emitted in two cases:
- A plain left-click on the gutter that lands on a "rich" breakpoint (one carrying a condition, hit-count target, or log message). The popup guards those user-typed extras against accidental loss; plain breakpoints keep the original add-or-remove-on-click behaviour and emit breakpointToggled instead.
- A context-menu gesture (right-click on Win/Linux, Ctrl- click or two-finger trackpad tap on macOS) on any existing breakpoint, regardless of whether it carries extras. The same popup is offered, so the destructive Remove always sits behind an explicit menu choice.
◆ breakpointToggled
| void LuaDebuggerCodeView::breakpointToggled |
( |
const QString & |
filename, |
|
|
qint32 |
line, |
|
|
bool |
toggleActive |
|
) |
| |
|
signal |
Emitted when a breakpoint icon is clicked within the gutter (right margin).
- Parameters
-
| toggleActive | If true, the click should enable/disable the breakpoint without removing it (currently mapped to Shift+click); otherwise add or remove on plain click. |
◆ lineNumberAreaPaintEvent()
| void LuaDebuggerCodeView::lineNumberAreaPaintEvent |
( |
QPaintEvent * |
event | ) |
|
Paint the custom gutter that hosts line numbers and breakpoints.
- Parameters
-
| event | Exposes the area to repaint. |
◆ lineNumberAreaWidth()
| qint32 LuaDebuggerCodeView::lineNumberAreaWidth |
( |
| ) |
|
Compute the width required for the gutter, including icons.
- Returns
- Width in device-independent pixels.
◆ luaIdentifierUnderCursor()
| QString LuaDebuggerCodeView::luaIdentifierUnderCursor |
( |
const QTextCursor & |
cursor | ) |
const |
Return the Lua identifier under the given cursor position, or an empty string if the position is not on an identifier.
Lua identifiers are [A-Za-z_][A-Za-z0-9_]*. The bracket grammar that the Watch panel accepts (a.b[1], a.b["k"]) is not synthesized here — only the bare identifier at cursor's position is returned, mirroring the "double-click to select word" affordance Qt's text editors offer.
The documentation for this class was generated from the following files: