Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
LuaDbgBreakpointConditionDelegate Class Reference

Item delegate for the Breakpoints list Location column (condition / hit count / log message inline editor). More...

#include <lua_debugger_breakpoints.h>

Inheritance diagram for LuaDbgBreakpointConditionDelegate:

Public Member Functions

 LuaDbgBreakpointConditionDelegate (LuaDebuggerDialog *dialog)
 Construct a LuaDbgBreakpointConditionDelegate.
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Create a QLineEdit editor for a breakpoint condition cell.
 
void setEditorData (QWidget *editor, const QModelIndex &index) const override
 Populate the editor with the cell's current condition string.
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 Write the edited condition expression back to the model.
 
void updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Position and size the editor to fill the cell rectangle.
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Return the preferred size for a condition cell.
 

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event) override
 Filter key events on the editor to control commit and cancel.
 

Detailed Description

Item delegate for the Breakpoints list Location column (condition / hit count / log message inline editor).

The editor is a single QLineEdit configured per-mode by a small mode-picker combo on the left. A hit-count comparison combo and an "also pause" toggle are embedded as children of the line edit and are shown only for the modes that own them. See the implementation file for the full design rationale.

Constructor & Destructor Documentation

◆ LuaDbgBreakpointConditionDelegate()

LuaDbgBreakpointConditionDelegate::LuaDbgBreakpointConditionDelegate ( LuaDebuggerDialog dialog)
explicit

Construct a LuaDbgBreakpointConditionDelegate.

Parameters
dialogThe owning LuaDebuggerDialog, used to coordinate commit and cancel actions with the breakpoint model.

Member Function Documentation

◆ createEditor()

QWidget * LuaDbgBreakpointConditionDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

Create a QLineEdit editor for a breakpoint condition cell.

Parameters
parentThe parent widget for the editor (the view's viewport).
optionStyle options for the cell being edited.
indexThe model index of the condition cell being edited.
Returns
A new QLineEdit widget; ownership passes to the view.

◆ eventFilter()

bool LuaDbgBreakpointConditionDelegate::eventFilter ( QObject *  watched,
QEvent *  event 
)
overrideprotected

Filter key events on the editor to control commit and cancel.

Parameters
watchedThe object that received the event (the editor widget).
eventThe event to inspect.
Returns
true if the event was consumed; false to let it propagate.

◆ setEditorData()

void LuaDbgBreakpointConditionDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const
override

Populate the editor with the cell's current condition string.

Parameters
editorThe QLineEdit created by createEditor().
indexThe model index whose data should be loaded.

◆ setModelData()

void LuaDbgBreakpointConditionDelegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const
override

Write the edited condition expression back to the model.

Parameters
editorThe QLineEdit created by createEditor().
modelThe breakpoint model to update.
indexThe model index of the condition cell being committed.

◆ sizeHint()

QSize LuaDbgBreakpointConditionDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

Return the preferred size for a condition cell.

Parameters
optionStyle options for the cell.
indexThe model index of the cell.
Returns
A QSize with the natural editor height and the base-class width.

◆ updateEditorGeometry()

void LuaDbgBreakpointConditionDelegate::updateEditorGeometry ( QWidget *  editor,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

Position and size the editor to fill the cell rectangle.

Parameters
editorThe QLineEdit to reposition.
optionStyle options supplying the cell's bounding rectangle.
indexThe model index of the cell being edited (unused here).

The documentation for this class was generated from the following files: