Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
lua_debugger_variables.h
Go to the documentation of this file.
1/* lua_debugger_variables.h
2 *
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <[email protected]>
5 * Copyright 1998 Gerald Combs
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
15#ifndef LUA_DEBUGGER_VARIABLES_H
16#define LUA_DEBUGGER_VARIABLES_H
17
18#include <QHash>
19#include <QObject>
20#include <QString>
21
22#include "lua_debugger_utils.h"
23
25class QModelIndex;
26class QPoint;
27class QStandardItem;
28class QStandardItemModel;
29class QTreeView;
30
33{
34constexpr int Name = 0;
35constexpr int Value = 1;
36constexpr int Type = 2;
37constexpr int Count = 3;
38} // namespace VariablesColumn
39
44class LuaDebuggerVariablesController : public QObject
45{
46 Q_OBJECT
47
48 public:
50
51 void attach(QTreeView *tree, QStandardItemModel *model);
52
53 void configureColumns() const;
54
56 void restoreExpansionState() const;
57
60 void rebuildFromEngine();
61
67 void fetchAndAppend(QStandardItem *parent, const QString &path);
68
69 QStandardItem *findItemByPath(const QString &path) const;
70
71 QHash<QString, LuaDbgTreeSectionExpansionState> &expansionMap() { return expansion_; }
72
73 const QHash<QString, LuaDbgTreeSectionExpansionState> &expansionMap() const { return expansion_; }
74
75 public slots:
76 void showContextMenu(const QPoint &pos);
77 void onExpanded(const QModelIndex &index);
78 void onCollapsed(const QModelIndex &index);
79
80 private:
81 LuaDebuggerDialog *host_ = nullptr;
82 QTreeView *tree_ = nullptr;
83 QStandardItemModel *model_ = nullptr;
84 QHash<QString, LuaDbgTreeSectionExpansionState> expansion_;
85};
86
87#endif
Top-level dialog hosting the Lua debugger UI components.
Definition lua_debugger_dialog.h:165
Variables panel: column sizing, expansion persistence, lazy child fill on expand, context menu,...
Definition lua_debugger_variables.h:45
void rebuildFromEngine()
Clear the model, re-fetch Locals/Globals/Upvalues from the engine, and re-apply persisted expansion.
Definition lua_debugger_variables.cpp:60
void fetchAndAppend(QStandardItem *parent, const QString &path)
Append children of path under parent (or as new top-level rows when parent is null)....
Definition lua_debugger_variables.cpp:70
void restoreExpansionState() const
Re-expand Locals/Globals/Upvalues after a variables refresh.
Definition lua_debugger_variables.cpp:184
Column indices for the Variables tree model.
Definition lua_debugger_variables.h:33