g4dialog
Loading...
Searching...
No Matches
gcommands.h
Go to the documentation of this file.
1#pragma once
2
3// qt
4#include <QtWidgets>
5
6// G4 headers
7#include "G4UImanager.hh"
8#include "G4UIcommandTree.hh"
9
27class G4Commands : public QWidget
28{
29 Q_OBJECT
30
31public:
37 explicit G4Commands(QWidget* parent = nullptr);
38
39private:
40 // --- UI elements ---
41 QLineEdit* w_search = nullptr;
42 QTreeView* w_commands = nullptr;
43 QTextEdit* w_help = nullptr;
44 QListWidget* w_history = nullptr;
45 QLineEdit* w_command = nullptr;
46
58 void create_child_help_tree(QStandardItem* aParent, G4UIcommandTree* aCommandTree);
59
72 QString get_command_g4help(const G4UIcommand* aCommand);
73
81 void filterTreeItems();
82
95 bool filterItem(QStandardItem* item, const QString& search_text);
96
97private slots:
107 void execute_command();
108
114 void recall_history_item_on_double_click(QListWidgetItem* item);
115
124 void display_help_from_selection();
125
132 void paste_help_selection_item();
133
137 void create_geant4_commands_widget();
138};
Qt widget that exposes a searchable Geant4 UI command tree with contextual help.
Definition gcommands.h:28
G4Commands(QWidget *parent=nullptr)
Construct the commands widget.
Definition gcommands.cc:4