Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Macros | Functions | Variables
lua_debugger_utils.cpp File Reference
#include <config.h>
#include "lua_debugger_utils.h"
#include <ui_lua_debugger_dialog.h>
#include <QAbstractItemModel>
#include <QAction>
#include <QApplication>
#include <QBrush>
#include <QCoreApplication>
#include <QFontMetricsF>
#include <QGuiApplication>
#include <QKeyEvent>
#include <QKeySequence>
#include <QList>
#include <QMetaObject>
#include <QObject>
#include <QPainter>
#include <QPalette>
#include <QPen>
#include <QPersistentModelIndex>
#include <QPixmap>
#include <QPointer>
#include <QSizePolicy>
#include <QStandardItem>
#include <QStandardItemModel>
#include <QStyle>
#include <QTimer>
#include <QToolButton>
#include <QTreeView>
#include <QWidget>
#include <algorithm>
#include <glib.h>
#include "app/application_flavor.h"
#include "lua_debugger_breakpoints.h"
#include "lua_debugger_code_editor.h"
#include "lua_debugger_dialog.h"
#include "lua_debugger_pause.h"
#include "wsutil/filesystem.h"
#include <epan/wslua/wslua_debugger.h>
#include <ui/qt/utils/color_utils.h>
#include <ui/qt/utils/qt_ui_utils.h>
#include <ui/qt/utils/theme_manager.h>
#include <ui/qt/utils/themes/color_math.h>

Macros

#define LUA_DEBUGGER_SETTINGS_FILE   "lua_debugger.json"
 

Functions

QString luaDebuggerSettingsFilePath ()
 Returns the file path for Lua debugger settings.
 
void luaDbgRecordTreeSectionRootExpansion (QHash< QString, LuaDbgTreeSectionExpansionState > &map, const QString &rootKey, bool expanded)
 Record / clear root-level expansion for rootKey in map. Mutates map in place; collapsing a root with no remembered subpaths drops the entry entirely so the map stays minimal.
 
void luaDbgRecordTreeSectionSubpathExpansion (QHash< QString, LuaDbgTreeSectionExpansionState > &map, const QString &rootKey, const QString &key, bool expanded)
 Add / remove one descendant subpath key under rootKey in map. Mirrors luaDbgRecordTreeSectionRootExpansion: removing the last subpath of a collapsed root erases the root entry too.
 
QStringList luaDbgTreeSectionExpandedSubpaths (const QHash< QString, LuaDbgTreeSectionExpansionState > &map, const QString &rootKey)
 Expanded-descendant subpaths recorded for rootKey, or empty.
 
const QKeySequence kLuaDbgCtxGoToLine (QKeySequence(Qt::CTRL|Qt::Key_G))
 
const QKeySequence kLuaDbgCtxRunToLine (QKeySequence(Qt::CTRL|Qt::Key_F10))
 
const QKeySequence kLuaDbgCtxWatchEdit (Qt::Key_F2)
 
const QKeySequence kLuaDbgCtxWatchCopyValue (QKeySequence(Qt::CTRL|Qt::SHIFT|Qt::Key_C))
 
const QKeySequence kLuaDbgCtxWatchDuplicate (QKeySequence(Qt::CTRL|Qt::SHIFT|Qt::Key_D))
 
const QKeySequence kLuaDbgCtxWatchRemoveAll (QKeySequence(Qt::CTRL|Qt::SHIFT|Qt::Key_K))
 
const QKeySequence kLuaDbgCtxAddWatch (QKeySequence(Qt::CTRL|Qt::SHIFT|Qt::Key_W))
 
const QKeySequence kLuaDbgCtxToggleBreakpoint (QKeySequence(Qt::CTRL|Qt::SHIFT|Qt::Key_B))
 
const QKeySequence kLuaDbgCtxReloadLuaPlugins (QKeySequence(Qt::CTRL|Qt::SHIFT|Qt::Key_L))
 
const QKeySequence kLuaDbgCtxRemoveAllBreakpoints (QKeySequence(Qt::CTRL|Qt::SHIFT|Qt::Key_F9))
 
QKeySequence luaDbgSeqFromKeyEvent (const QKeyEvent *ke)
 Build a key sequence from a key event for matching against QAction shortcuts. Wraps the Qt5/Qt6 modifier-encoding split so callers do not have to repeat the version check.
 
LuaDbgInvalidFilterColors LuaDebuggerPath::invalidFilterColors ()
 Return the foreground and background colors used to indicate an invalid filter expression in the Lua debugger.
 
bool LuaDebuggerPath::watchSpecIsGlobalScoped (const QString &spec)
 Check whether a watch specification is globally scoped.
 
bool LuaDebuggerPath::variablesPathIsGlobalScoped (const QString &path)
 Check whether a variables path is globally scoped.
 
QString LuaDebuggerPath::changeKey (int stackLevel, const QString &path)
 Return the change key for a variable at a given stack level and path.
 
QString LuaDebuggerPath::watchSpecFromChangeKey (const QString &key)
 Return the watch specification corresponding to a change key.
 
QString LuaDebuggerPath::stripWatchExpressionErrorPrefix (const QString &errStr)
 Strip the error prefix from a watch expression error string.
 
QString LuaDebuggerPath::variableSectionRootKeyFromItem (const QStandardItem *item)
 Return the root key of the variable section containing an item.
 
bool LuaDebuggerPath::watchSpecUsesPathResolution (const QString &spec)
 Check whether a watch specification uses path resolution.
 
QString LuaDebuggerPath::variableTreeChildPath (const QString &parentPath, const QString &nameText)
 Return the path of a child node in the variable tree.
 
QString LuaDebuggerPath::expressionWatchChildSubpath (const QString &parentSubpath, const QString &nameText)
 Return the subpath of a child node in an expression watch tree.
 
bool LuaDebuggerPath::variableChildrenShouldSortByName (const QString &parentPath)
 Check whether children of a variable node should be sorted by name.
 
VariableRowFields LuaDebuggerPath::readVariableRowFields (const wslua_variable_t &v, const QString &parentPath)
 Read the display fields of a variable row from a Lua variable.
 
void LuaDebuggerPath::applyVariableExpansionIndicator (QStandardItem *anchor, bool canExpand, bool enabledOnlyPlaceholder, int columnCount=3)
 Apply an expansion indicator to a variable row anchor item.
 
QString LuaDebuggerPath::watchVariablePathForSpec (const QString &spec)
 Return the variable path for a watch specification.
 
QString LuaDebuggerPath::watchResolvedVariablePathForTooltip (const QString &spec)
 Return the resolved variable path for a watch tooltip.
 
void LuaDebuggerPath::watchRootSetVariablePathRoleFromSpec (QStandardItem *row, const QString &spec)
 Set the variable path role on a watch root row item from a watch specification.
 
QString LuaDebuggerPath::watchPathOriginSuffix (const QStandardItem *item, const QString &spec)
 Return the origin suffix for a watch path tooltip.
 
QString LuaDebuggerPath::capWatchTooltipText (const QString &s)
 Truncate a watch tooltip text string to a reasonable length.
 
QString LuaDebuggerPath::watchPathParentKey (const QString &path)
 Return the parent key of a watch path.
 
void LuaDebuggerPath::applyWatchChildRowTextAndTooltip (QStandardItem *specItem, const QString &rawVal, const QString &typeText)
 Apply the raw value and type text to a watch child row item.
 
int LuaDebuggerPath::watchSubpathBoundaryCount (const QString &subpath)
 Return the number of subpath boundaries in a watch subpath.
 
QStandardItem * LuaDebuggerPath::findWatchItemBySubpathOrPathKey (QStandardItem *subtree, const QString &key)
 Find a watch item in a subtree by its subpath or path key.
 
QStandardItem * LuaDebuggerPath::findVariableTreeItemByPathKey (QStandardItem *subtree, const QString &key)
 Find a variable tree item in a subtree by its path key.
 
void LuaDebuggerPath::reexpandTreeDescendantsByPathKeys (QTreeView *tree, QStandardItemModel *model, QStandardItem *subtree, QStringList pathKeys, TreePathKeyFinder findByKey)
 Re-expand previously expanded descendants of a subtree by their path keys.
 
void LuaDebuggerPath::reexpandWatchDescendantsByPathKeys (QTreeView *tree, QStandardItemModel *model, QStandardItem *subtree, QStringList pathKeys)
 Re-expand previously expanded watch descendants of a subtree by their path keys.
 
void LuaDebuggerPath::clearWatchFilterErrorChrome (QStandardItem *specItem, QTreeView *tree)
 Clear the filter error chrome from a watch specification item.
 
void LuaDebuggerPath::applyWatchFilterErrorChrome (QStandardItem *specItem, QTreeView *tree)
 Apply filter error chrome to a watch specification item.
 
void LuaDebuggerPath::setupWatchRootItemFromSpec (QStandardItem *specItem, QStandardItem *valueItem, const QString &spec)
 Set up a watch root item from a watch specification.
 
QStandardItem * LuaDebuggerPath::findVariableItemByPathRecursive (QStandardItem *node, const QString &path)
 Find a variable item by path in a subtree, searching recursively.
 
QString LuaDebuggerPath::watchItemExpansionKey (const QStandardItem *item)
 Return the expansion key for a watch item.
 
void luaDbgDrawBreakpointDot (QPainter &painter, qreal dotLeft, qreal dotTop, qreal radius, bool enabled, bool hasExtras, int alpha)
 Draws a breakpoint dot on the given painter.
 
QIcon luaDbgBreakpointHeaderIconForMode (const QFont *editorFont, LuaDbgBpHeaderIconMode mode, int headerSide, qreal dpr)
 Return the appropriate breakpoint header icon for the given mode.
 
QIcon luaDbgPaintedGlyphIcon (const QString &glyph, int side, qreal dpr, const QFont &baseFont, const QColor &color, int margin)
 Paint a glyph centred into a square pixmap and return it as an icon.
 
QIcon luaDbgPaintedGlyphButtonIcon (const QString &glyph, int side, qreal dpr, const QFont &baseFont, const QPalette &palette, int margin)
 Creates an icon for a painted glyph button.
 
void styleLuaDebuggerHeaderBreakpointToggleButton (QToolButton *btn, int side)
 Style a Lua debugger header breakpoint toggle button.
 
void styleLuaDebuggerHeaderFittedTextButton (QToolButton *btn, int side, const QFont &titleFont, const QStringList &glyphs)
 Style a Lua debugger header button with fitted text glyphs.
 
void styleLuaDebuggerHeaderPlusMinusButton (QToolButton *btn, int side, const QFont &titleFont)
 Style a Lua debugger header plus/minus button.
 
void styleLuaDebuggerHeaderIconOnlyButton (QToolButton *btn, int side)
 Style a Lua debugger header icon-only button.
 
QIcon luaDbgErrorBreakHeaderIcon (bool checked, int side, qreal dpr, const QFont &titleFont, const QPalette &palette)
 Build a colored Break-on-Error toggle icon for the breakpoints section header.
 
QIcon luaDbgMakeSelectionAwareIcon (const QIcon &base, const QPalette &palette)
 Create a selection-aware icon for tree icons (breakpoints, variables, and watch) that applies a selected-row tint.
 

Variables

const QString kLuaDbgHeaderPlus {QStringLiteral("\uFF0B")}
 
const QString kLuaDbgHeaderMinus {QStringLiteral("\uFF0D")}
 
const QString kLuaDbgHeaderEdit {QStringLiteral("\u2699")}
 
const QString kLuaDbgHeaderRemoveAll {QStringLiteral("\u24CD")}
 
const QString kLuaDbgRowLog {QStringLiteral("\u2630")}
 
const QString kLuaDbgRowExtras {QStringLiteral("\u2699")}
 
const QString kLuaDbgHeaderToolButtonStyle {QStringLiteral("QToolButton { border: none; padding: 0px; margin: 0px; }")}
 

Detailed Description

Shared helpers used across the debugger panels.

Function Documentation

◆ applyVariableExpansionIndicator()

void LuaDebuggerPath::applyVariableExpansionIndicator ( QStandardItem *  anchor,
bool  canExpand,
bool  enabledOnlyPlaceholder,
int  columnCount = 3 
)

Apply an expansion indicator to a variable row anchor item.

Parameters
anchorThe anchor item in the variable tree.
canExpandWhether the item can be expanded.
enabledOnlyPlaceholderWhether to use an enabled-only placeholder.
columnCountThe number of columns in the tree (default 3).

◆ applyWatchChildRowTextAndTooltip()

void LuaDebuggerPath::applyWatchChildRowTextAndTooltip ( QStandardItem *  specItem,
const QString &  rawVal,
const QString &  typeText 
)

Apply the raw value and type text to a watch child row item.

Parameters
specItemThe watch specification item.
rawValThe raw value string.
typeTextThe type text string.

◆ applyWatchFilterErrorChrome()

void LuaDebuggerPath::applyWatchFilterErrorChrome ( QStandardItem *  specItem,
QTreeView *  tree 
)

Apply filter error chrome to a watch specification item.

Parameters
specItemThe watch specification item.
treeThe tree view.

◆ capWatchTooltipText()

QString LuaDebuggerPath::capWatchTooltipText ( const QString &  s)

Truncate a watch tooltip text string to a reasonable length.

Parameters
sThe tooltip text string.
Returns
The capped tooltip text string.

◆ changeKey()

QString LuaDebuggerPath::changeKey ( int  stackLevel,
const QString &  path 
)

Return the change key for a variable at a given stack level and path.

Parameters
stackLevelThe stack level of the variable.
pathThe path of the variable.
Returns
The change key string.

◆ clearWatchFilterErrorChrome()

void LuaDebuggerPath::clearWatchFilterErrorChrome ( QStandardItem *  specItem,
QTreeView *  tree 
)

Clear the filter error chrome from a watch specification item.

Parameters
specItemThe watch specification item.
treeThe tree view.

◆ expressionWatchChildSubpath()

QString LuaDebuggerPath::expressionWatchChildSubpath ( const QString &  parentSubpath,
const QString &  nameText 
)

Return the subpath of a child node in an expression watch tree.

Parameters
parentSubpathThe subpath of the parent node.
nameTextThe name of the child node.
Returns
The subpath of the child node.

◆ findVariableItemByPathRecursive()

QStandardItem * LuaDebuggerPath::findVariableItemByPathRecursive ( QStandardItem *  node,
const QString &  path 
)

Find a variable item by path in a subtree, searching recursively.

Parameters
nodeThe root item of the subtree to search.
pathThe path to search for.
Returns
The matching item, or nullptr if not found.

◆ findVariableTreeItemByPathKey()

QStandardItem * LuaDebuggerPath::findVariableTreeItemByPathKey ( QStandardItem *  subtree,
const QString &  key 
)

Find a variable tree item in a subtree by its path key.

Parameters
subtreeThe root item of the subtree to search.
keyThe path key to search for.
Returns
The matching item, or nullptr if not found.

◆ findWatchItemBySubpathOrPathKey()

QStandardItem * LuaDebuggerPath::findWatchItemBySubpathOrPathKey ( QStandardItem *  subtree,
const QString &  key 
)

Find a watch item in a subtree by its subpath or path key.

Parameters
subtreeThe root item of the subtree to search.
keyThe subpath or path key to search for.
Returns
The matching item, or nullptr if not found.

◆ invalidFilterColors()

LuaDbgInvalidFilterColors LuaDebuggerPath::invalidFilterColors ( )

Return the foreground and background colors used to indicate an invalid filter expression in the Lua debugger.

Background is read from ThemeManager::FilterInvalid; foreground is derived locally via ColorMath::contrastingText against that background (WCAG luminance pick — black on light tints, white on dark).

Returns
A struct containing the foreground and background colors.

◆ luaDbgBreakpointHeaderIconForMode()

QIcon luaDbgBreakpointHeaderIconForMode ( const QFont *  editorFont,
LuaDbgBpHeaderIconMode  mode,
int  headerSide,
qreal  dpr 
)

Return the appropriate breakpoint header icon for the given mode.

Parameters
editorFontThe font used in the editor.
modeThe breakpoint header icon mode.
headerSideThe side length of the header icon in pixels.
dprThe device pixel ratio for HiDPI scaling.
Returns
A QIcon for the breakpoint header in the given mode.

◆ luaDbgDrawBreakpointDot()

void luaDbgDrawBreakpointDot ( QPainter &  painter,
qreal  dotLeft,
qreal  dotTop,
qreal  radius,
bool  enabled,
bool  hasExtras = false,
int  alpha = 255 
)

Draws a breakpoint dot on the given painter.

Parameters
painterThe QPainter object to draw on.
dotLeftThe left coordinate of the dot.
dotTopThe top coordinate of the dot.
radiusThe radius of the dot.
enabledWhether the breakpoint is enabled.
hasExtrasWhether the dot has additional extras.
alphaThe transparency level of the dot.

◆ luaDbgErrorBreakHeaderIcon()

QIcon luaDbgErrorBreakHeaderIcon ( bool  checked,
int  side,
qreal  dpr,
const QFont &  titleFont,
const QPalette &  palette 
)

Build a colored Break-on-Error toggle icon for the breakpoints section header.

Paints a warning-sign glyph, red (#DC3545) when checked (active), gray (disabled text color) when unchecked.

Parameters
checkedtrue to paint yellow, false to paint gray
sideicon size in pixels
dprdevice pixel ratio
titleFontfont to use for glyph rendering
palettepalette for disabled text color
Returns
colored warning-sign icon

◆ luaDbgMakeSelectionAwareIcon()

QIcon luaDbgMakeSelectionAwareIcon ( const QIcon &  base,
const QPalette &  palette 
)

Create a selection-aware icon for tree icons (breakpoints, variables, and watch) that applies a selected-row tint.

Parameters
baseThe base icon to tint.
paletteThe palette to derive the selection tint from.
Returns
A QIcon that applies a tint when the row is selected.

◆ luaDbgPaintedGlyphButtonIcon()

QIcon luaDbgPaintedGlyphButtonIcon ( const QString &  glyph,
int  side,
qreal  dpr,
const QFont &  baseFont,
const QPalette &  palette,
int  margin = 2 
)

Creates an icon for a painted glyph button.

Returns a header-button-flavoured QIcon with two pixmaps painted from glyph: a Normal pixmap in palette.color(Active, ButtonText) and a Disabled pixmap in palette.color(Disabled, ButtonText). The Disabled pixmap is added so QToolButton renders it directly when the button is disabled instead of falling back to QStyle::generatedIcon- Pixmap()'s synthesised filter (which on Linux produces a darker tone than the palette's disabled-text gray used by neighbouring text-only buttons).

Parameters
glyphThe glyph to be displayed on the button.
sideThe size of the icon in pixels.
dprThe device pixel ratio.
baseFontThe base font for rendering the glyph.
paletteThe color palette to use for rendering the glyph.
marginThe margin around the glyph.
Returns
QIcon The created icon with both active and disabled states.

◆ luaDbgPaintedGlyphIcon()

QIcon luaDbgPaintedGlyphIcon ( const QString &  glyph,
int  side,
qreal  dpr,
const QFont &  baseFont,
const QColor &  color,
int  margin = 1 
)

Paint a glyph centred into a square pixmap and return it as an icon.

Paints glyph centred into a square side x side pixmap (scaled by dpr for HiDPI), sized so the glyph's inked extent fills the cell.

Parameters
glyphThe glyph string to paint.
sideThe side length of the square pixmap in pixels.
dprThe device pixel ratio for HiDPI scaling.
baseFontThe font to use for painting the glyph.
colorThe color to paint the glyph with.
marginThe margin around the glyph in pixels (default 1).
Returns
A QIcon containing the painted glyph.

◆ luaDbgRecordTreeSectionRootExpansion()

void luaDbgRecordTreeSectionRootExpansion ( QHash< QString, LuaDbgTreeSectionExpansionState > &  map,
const QString &  rootKey,
bool  expanded 
)

Record / clear root-level expansion for rootKey in map. Mutates map in place; collapsing a root with no remembered subpaths drops the entry entirely so the map stays minimal.

Parameters
mapReference to the hash map that stores the expansion state of tree sections.
rootKeyThe key representing the root section whose expansion state is to be recorded or cleared.
expandedBoolean indicating whether the root section should be expanded (true) or collapsed (false).

◆ luaDbgRecordTreeSectionSubpathExpansion()

void luaDbgRecordTreeSectionSubpathExpansion ( QHash< QString, LuaDbgTreeSectionExpansionState > &  map,
const QString &  rootKey,
const QString &  key,
bool  expanded 
)

Add / remove one descendant subpath key under rootKey in map. Mirrors luaDbgRecordTreeSectionRootExpansion: removing the last subpath of a collapsed root erases the root entry too.

Parameters
mapReference to the hash map that stores the expansion state of tree sections.
rootKeyThe root key under which the subpath is being expanded or collapsed.
keyThe subpath key to be added or removed.
expandedBoolean indicating whether the subpath is being expanded (true) or collapsed (false).

◆ luaDbgSeqFromKeyEvent()

QKeySequence luaDbgSeqFromKeyEvent ( const QKeyEvent *  ke)

Build a key sequence from a key event for matching against QAction shortcuts. Wraps the Qt5/Qt6 modifier-encoding split so callers do not have to repeat the version check.

Parameters
kePointer to the QKeyEvent object containing the key event information.
Returns
QKeySequence The constructed key sequence based on the key event.

◆ luaDbgTreeSectionExpandedSubpaths()

QStringList luaDbgTreeSectionExpandedSubpaths ( const QHash< QString, LuaDbgTreeSectionExpansionState > &  map,
const QString &  rootKey 
)

Expanded-descendant subpaths recorded for rootKey, or empty.

Parameters
mapHash containing expansion states for LuaDbgTreeSection objects.
rootKeyKey of the root section to retrieve expanded subpaths for.
Returns
QStringList List of expanded subpaths under the specified rootKey.

◆ luaDebuggerSettingsFilePath()

QString luaDebuggerSettingsFilePath ( )

Returns the file path for Lua debugger settings.

Global personal config path — debugger settings are not profile-specific.

Returns
QString The file path for Lua debugger settings.

◆ readVariableRowFields()

VariableRowFields LuaDebuggerPath::readVariableRowFields ( const wslua_variable_t v,
const QString &  parentPath 
)

Read the display fields of a variable row from a Lua variable.

Parameters
vThe Lua variable to read from.
parentPathThe path of the parent variable node.
Returns
A VariableRowFields struct containing the display fields.

◆ reexpandTreeDescendantsByPathKeys()

void LuaDebuggerPath::reexpandTreeDescendantsByPathKeys ( QTreeView *  tree,
QStandardItemModel *  model,
QStandardItem *  subtree,
QStringList  pathKeys,
TreePathKeyFinder  findByKey 
)

Re-expand previously expanded descendants of a subtree by their path keys.

Parameters
treeThe tree view.
modelThe tree model.
subtreeThe root item of the subtree to re-expand.
pathKeysThe list of path keys to re-expand.
findByKeyThe function to find an item by path key.

◆ reexpandWatchDescendantsByPathKeys()

void LuaDebuggerPath::reexpandWatchDescendantsByPathKeys ( QTreeView *  tree,
QStandardItemModel *  model,
QStandardItem *  subtree,
QStringList  pathKeys 
)

Re-expand previously expanded watch descendants of a subtree by their path keys.

Parameters
treeThe tree view.
modelThe tree model.
subtreeThe root item of the subtree to re-expand.
pathKeysThe list of path keys to re-expand.

◆ setupWatchRootItemFromSpec()

void LuaDebuggerPath::setupWatchRootItemFromSpec ( QStandardItem *  specItem,
QStandardItem *  valueItem,
const QString &  spec 
)

Set up a watch root item from a watch specification.

Parameters
specItemThe watch specification item.
valueItemThe watch value item.
specThe watch specification string.

◆ stripWatchExpressionErrorPrefix()

QString LuaDebuggerPath::stripWatchExpressionErrorPrefix ( const QString &  errStr)

Strip the error prefix from a watch expression error string.

Parameters
errStrThe error string to strip.
Returns
The error string with the watch expression error prefix removed.

◆ styleLuaDebuggerHeaderBreakpointToggleButton()

void styleLuaDebuggerHeaderBreakpointToggleButton ( QToolButton *  btn,
int  side 
)

Style a Lua debugger header breakpoint toggle button.

Parameters
btnThe tool button to style.
sideThe side length of the button in pixels.

◆ styleLuaDebuggerHeaderFittedTextButton()

void styleLuaDebuggerHeaderFittedTextButton ( QToolButton *  btn,
int  side,
const QFont &  titleFont,
const QStringList &  glyphs 
)

Style a Lua debugger header button with fitted text glyphs.

Parameters
btnThe tool button to style.
sideThe side length of the button in pixels.
titleFontThe font used for sizing the glyphs.
glyphsThe list of glyph strings to fit within the button.

◆ styleLuaDebuggerHeaderIconOnlyButton()

void styleLuaDebuggerHeaderIconOnlyButton ( QToolButton *  btn,
int  side 
)

Style a Lua debugger header icon-only button.

Parameters
btnThe tool button to style.
sideThe side length of the button in pixels.

◆ styleLuaDebuggerHeaderPlusMinusButton()

void styleLuaDebuggerHeaderPlusMinusButton ( QToolButton *  btn,
int  side,
const QFont &  titleFont 
)

Style a Lua debugger header plus/minus button.

Parameters
btnThe tool button to style.
sideThe side length of the button in pixels.
titleFontThe font used for sizing the plus/minus glyph.

◆ variableChildrenShouldSortByName()

bool LuaDebuggerPath::variableChildrenShouldSortByName ( const QString &  parentPath)

Check whether children of a variable node should be sorted by name.

Parameters
parentPathThe path of the parent variable node.
Returns
true if children should be sorted by name, false otherwise.

◆ variableSectionRootKeyFromItem()

QString LuaDebuggerPath::variableSectionRootKeyFromItem ( const QStandardItem *  item)

Return the root key of the variable section containing an item.

Parameters
itemThe item in the variable tree.
Returns
The root key string of the variable section.

◆ variablesPathIsGlobalScoped()

bool LuaDebuggerPath::variablesPathIsGlobalScoped ( const QString &  path)

Check whether a variables path is globally scoped.

Parameters
pathThe variables path string.
Returns
true if the path is globally scoped, false otherwise.

◆ variableTreeChildPath()

QString LuaDebuggerPath::variableTreeChildPath ( const QString &  parentPath,
const QString &  nameText 
)

Return the path of a child node in the variable tree.

Parameters
parentPathThe path of the parent node.
nameTextThe name of the child node.
Returns
The path of the child node.

◆ watchItemExpansionKey()

QString LuaDebuggerPath::watchItemExpansionKey ( const QStandardItem *  item)

Return the expansion key for a watch item.

Parameters
itemThe watch item.
Returns
The expansion key string used to restore expansion state.

◆ watchPathOriginSuffix()

QString LuaDebuggerPath::watchPathOriginSuffix ( const QStandardItem *  item,
const QString &  spec 
)

Return the origin suffix for a watch path tooltip.

Parameters
itemThe item in the watch tree.
specThe watch specification string.
Returns
The origin suffix string.

◆ watchPathParentKey()

QString LuaDebuggerPath::watchPathParentKey ( const QString &  path)

Return the parent key of a watch path.

Parameters
pathThe watch path string.
Returns
The parent key string.

◆ watchResolvedVariablePathForTooltip()

QString LuaDebuggerPath::watchResolvedVariablePathForTooltip ( const QString &  spec)

Return the resolved variable path for a watch tooltip.

Parameters
specThe watch specification string.
Returns
The resolved variable path string for display in a tooltip.

◆ watchRootSetVariablePathRoleFromSpec()

void LuaDebuggerPath::watchRootSetVariablePathRoleFromSpec ( QStandardItem *  row,
const QString &  spec 
)

Set the variable path role on a watch root row item from a watch specification.

Parameters
rowThe root row item.
specThe watch specification string.

◆ watchSpecFromChangeKey()

QString LuaDebuggerPath::watchSpecFromChangeKey ( const QString &  key)

Return the watch specification corresponding to a change key.

Parameters
keyThe change key string.
Returns
The watch specification string.

◆ watchSpecIsGlobalScoped()

bool LuaDebuggerPath::watchSpecIsGlobalScoped ( const QString &  spec)

Check whether a watch specification is globally scoped.

Parameters
specThe watch specification string.
Returns
true if the specification is globally scoped, false otherwise.

◆ watchSpecUsesPathResolution()

bool LuaDebuggerPath::watchSpecUsesPathResolution ( const QString &  spec)

Check whether a watch specification uses path resolution.

Parameters
specThe watch specification string.
Returns
true if the specification uses path resolution, false otherwise.

◆ watchSubpathBoundaryCount()

int LuaDebuggerPath::watchSubpathBoundaryCount ( const QString &  subpath)

Return the number of subpath boundaries in a watch subpath.

Parameters
subpathThe watch subpath string.
Returns
The number of subpath boundaries.

◆ watchVariablePathForSpec()

QString LuaDebuggerPath::watchVariablePathForSpec ( const QString &  spec)

Return the variable path for a watch specification.

Parameters
specThe watch specification string.
Returns
The variable path string.

Variable Documentation

◆ kLuaDbgHeaderEdit

const QString kLuaDbgHeaderEdit {QStringLiteral("\u2699")}

Gear (U+2699 + U+FE0E text presentation) for the Edit Breakpoint header button.

◆ kLuaDbgHeaderPlus

const QString kLuaDbgHeaderPlus {QStringLiteral("\uFF0B")}

Fullwidth +/- and flat tool button style for section headers.

◆ kLuaDbgHeaderRemoveAll

const QString kLuaDbgHeaderRemoveAll {QStringLiteral("\u24CD")}

Circled Latin capital letter X (U+24CD) for the Remove All header buttons (Watch and Breakpoints).

◆ kLuaDbgRowExtras

const QString kLuaDbgRowExtras {QStringLiteral("\u2699")}

Reference mark (U+203B) for the Active-column condition / hit-count row indicator.

◆ kLuaDbgRowLog

const QString kLuaDbgRowLog {QStringLiteral("\u2630")}

Three stacked horizontal lines (U+2630 trigram for heaven) for the Active-column logpoint row indicator.