16#ifndef LUA_DEBUGGER_BREAKPOINTS_H
17#define LUA_DEBUGGER_BREAKPOINTS_H
25#include <QStyledItemDelegate>
33class QAbstractItemModel;
45class QStandardItemModel;
46class QStyleOptionViewItem;
60constexpr int Active = 0;
61constexpr int Hits = 1;
62constexpr int Line = 2;
63constexpr int Location = 3;
64constexpr int Count = 4;
103 const char *placeholder;
104 const char *valueTooltip;
206 void setEmbeddedWidgets(QComboBox *modeCombo, QComboBox *hitModeCombo, QToolButton *pauseButton);
239 QComboBox *modeCombo_ =
nullptr;
240 QComboBox *hitModeCombo_ =
nullptr;
241 QToolButton *pauseButton_ =
nullptr;
274 QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
275 const QModelIndex &index)
const override;
283 void setEditorData(QWidget *editor,
const QModelIndex &index)
const override;
292 void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index)
const override;
302 const QModelIndex &index)
const override;
311 QSize
sizeHint(
const QStyleOptionViewItem &option,
312 const QModelIndex &index)
const override;
322 bool eventFilter(QObject *watched, QEvent *event)
override;
330 int preferredEditorHeight()
const;
333 mutable int cachedPreferredHeight_ = 0;
364 void attach(QTreeView *tree, QStandardItemModel *model);
377 void attachHeaderButtons(QToolButton *breakOnError, QToolButton *toggleAll, QToolButton *remove,
378 QToolButton *removeAll, QToolButton *edit, QAction *removeAllAction);
488 void moveAtLine(
const QString &file, qint32 fromLine, qint32 toLine);
526 void onModelDataChanged(
const QModelIndex &topLeft,
const QModelIndex &bottomRight,
const QVector<int> &roles);
533 void showGutterMenu(
const QString &filename, qint32 line,
const QPoint &globalPos);
537 void refreshAllOpenTabMarkers()
const;
542 void refreshOpenTabMarkers(
const QSet<QString> &files)
const;
545 QTreeView *tree_ =
nullptr;
546 QStandardItemModel *model_ =
nullptr;
548 QToolButton *breakOnErrorButton_ =
nullptr;
549 QToolButton *toggleAllButton_ =
nullptr;
550 QToolButton *removeButton_ =
nullptr;
551 QToolButton *removeAllButton_ =
nullptr;
552 QToolButton *editButton_ =
nullptr;
553 QAction *removeAllAction_ =
nullptr;
561 QIcon headerIconCache_[3];
562 QString headerIconCacheKey_;
569 bool tabsPrimed_ =
false;
578 bool suppressItemChanged_ =
false;
Inline editor for the Breakpoints "Location" column.
Definition lua_debugger_breakpoints.h:195
void relayout()
Definition lua_debugger_breakpoints.cpp:396
void resizeEvent(QResizeEvent *e) override
Handle resize events.
Definition lua_debugger_breakpoints.cpp:503
void showEvent(QShowEvent *e) override
Handle show events.
Definition lua_debugger_breakpoints.cpp:509
void setEmbeddedWidgets(QComboBox *modeCombo, QComboBox *hitModeCombo, QToolButton *pauseButton)
Definition lua_debugger_breakpoints.cpp:387
void paintEvent(QPaintEvent *e) override
Handle paint events.
Definition lua_debugger_breakpoints.cpp:520
Item delegate for the Breakpoints list Location column (condition / hit count / log message inline ed...
Definition lua_debugger_breakpoints.h:257
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Position and size the editor to fill the cell rectangle.
Definition lua_debugger_breakpoints.cpp:1049
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Create a QLineEdit editor for a breakpoint condition cell.
Definition lua_debugger_breakpoints.cpp:578
bool eventFilter(QObject *watched, QEvent *event) override
Filter key events on the editor to control commit and cancel.
Definition lua_debugger_breakpoints.cpp:1083
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Write the edited condition expression back to the model.
Definition lua_debugger_breakpoints.cpp:981
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Return the preferred size for a condition cell.
Definition lua_debugger_breakpoints.cpp:1067
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Populate the editor with the cell's current condition string.
Definition lua_debugger_breakpoints.cpp:910
Owns the breakpoints panel: tree wiring, model rebuild from the engine, inline edit dispatch,...
Definition lua_debugger_breakpoints.h:349
void startInlineEdit(int row)
Focus column 2 and open the delegate editor when editable.
Definition lua_debugger_breakpoints.cpp:1345
void configureColumns() const
Configure the columns in the breakpoints tree.
Definition lua_debugger_breakpoints.cpp:1301
void shiftToggleAtLine(const QString &file, qint32 line)
Pre-arm a breakpoint at file:@p line — the Shift+click gutter gesture. If absent, creates the breakpo...
Definition lua_debugger_breakpoints.cpp:2282
void onItemDoubleClicked(const QModelIndex &index)
Double-click on a breakpoint row to edit its condition.
Definition lua_debugger_breakpoints.cpp:1365
void setActiveFromUser(const QString &file, qint32 line, bool active)
Set the active flag of an existing breakpoint at file:@p line. Used by the gutter context menu's Enab...
Definition lua_debugger_breakpoints.cpp:2312
bool removeRows(const QList< int > &rows)
Remove the breakpoints in the given (deduped) model rows.
Definition lua_debugger_breakpoints.cpp:2047
void toggleAtLine(const QString &file, qint32 line)
Add the breakpoint at file:@p line if absent, otherwise remove it. Drives F9 in the editor,...
Definition lua_debugger_breakpoints.cpp:2251
bool removeSelected()
Remove every selected breakpoint row.
Definition lua_debugger_breakpoints.cpp:2091
void updateHeaderButtonState()
Refresh header dot icon + button enable states.
Definition lua_debugger_breakpoints.cpp:2149
void restoreFrom(const QVariantMap &settingsMap)
Apply the Breakpoints array from settingsMap to the engine. Missing keys fall back to the engine's de...
Definition lua_debugger_breakpoints.cpp:2532
void toggleAllActive()
Activate-all / deactivate-all toggle (header).
Definition lua_debugger_breakpoints.cpp:2113
void moveAtLine(const QString &file, qint32 fromLine, qint32 toLine)
Move a breakpoint in file from fromLine to toLine, preserving metadata. No-op if either line is inval...
Definition lua_debugger_breakpoints.cpp:2341
void serializeTo(QVariantMap &settingsMap) const
Snapshot the engine breakpoint list (file/line/active + condition / hit-count / log-message) into set...
Definition lua_debugger_breakpoints.cpp:2479
void showContextMenu(const QPoint &pos)
Show context menu for a right-click in the breakpoint tree.
Definition lua_debugger_breakpoints.cpp:1389
void refreshFromEngine()
Rebuild tree rows from the engine; refreshes header chrome.
Definition lua_debugger_breakpoints.cpp:1556
void removeAtLine(const QString &file, qint32 line)
Remove the breakpoint at file:@p line and refresh chrome. Drives the gutter context menu's Remove act...
Definition lua_debugger_breakpoints.cpp:2328
void onItemChanged(QStandardItem *item)
Active-checkbox toggle from the model.
Definition lua_debugger_breakpoints.cpp:1814
void showGutterMenu(const QString &filename, qint32 line, const QPoint &globalPos)
Show Edit/Disable/Remove popup for a click in an editor gutter.
Definition lua_debugger_breakpoints.cpp:1970
void attachHeaderButtons(QToolButton *breakOnError, QToolButton *toggleAll, QToolButton *remove, QToolButton *removeAll, QToolButton *edit, QAction *removeAllAction)
Bind the section-header strip and its shortcut action. Wires button clicks; safe to call before or af...
Definition lua_debugger_breakpoints.cpp:1228
void clearAll()
Confirm-and-clear all breakpoints (header / shortcut).
Definition lua_debugger_breakpoints.cpp:1533
void onModelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
Role-based dispatch for delegate-driven inline edits.
Definition lua_debugger_breakpoints.cpp:1849
void attach(QTreeView *tree, QStandardItemModel *model)
Bind the tree + model and wire their signals.
Definition lua_debugger_breakpoints.cpp:1205
void toggleOnCodeViewLine(LuaDebuggerCodeView *codeView, qint32 line)
Convenience overload that resolves the file path from a LuaDebuggerCodeView. Silently ignores null vi...
Definition lua_debugger_breakpoints.cpp:2273
Editable code editor supporting gutter breakpoints and highlighting.
Definition lua_debugger_code_editor.h:136
Top-level dialog hosting the Lua debugger UI components.
Definition lua_debugger_dialog.h:189
Column indices for the Breakpoints tree model.
Definition lua_debugger_breakpoints.h:59
Inline editor mode metadata for the Breakpoints "Location" column.
Definition lua_debugger_breakpoints.cpp:91
QIcon makePauseIcon(const QPalette &palette)
Definition lua_debugger_breakpoints.cpp:256
Mode
Selects the operational mode of a conditional breakpoint or debug action.
Definition lua_debugger_breakpoints.h:89
QString translatedLabel(const ModeSpec &spec)
Definition lua_debugger_breakpoints.cpp:136
constexpr int kModeCount
Definition lua_debugger_breakpoints.h:108
QToolButton * editorPauseToggle(QWidget *editor)
Definition lua_debugger_breakpoints.cpp:164
QString pauseToggleStyleSheet()
Definition lua_debugger_breakpoints.cpp:316
const ModeSpec kBreakpointEditModes[kModeCount]
Definition lua_debugger_breakpoints.cpp:93
const char * draftPropertyName(Mode m)
Definition lua_debugger_breakpoints.cpp:141
QComboBox * editorHitModeCombo(QWidget *editor)
Definition lua_debugger_breakpoints.cpp:155
void applyEditorMode(QWidget *editor, int modeIndex)
Definition lua_debugger_breakpoints.cpp:173
Definition lua_debugger_breakpoints.h:100