gui
Loading...
Searching...
No Matches
gui.h
Go to the documentation of this file.
1#pragma once
2
3// qt
4#include <QStackedWidget> // rightContent
5#include <QLineEdit> // nEvents
6#include <QLabel> // eventNumberLabel
7#include <QTimer> // gtimer
8#include <QHBoxLayout> // createTopButtons
9
10// gemc
11#include "gQtButtonsWidget.h"
12#include "eventDispenser.h"
14
15// gboard
16#include "gui_session.h"
17
35class GemcGUI : public QWidget
36{
37 // metaobject required for non-qt slots
38 Q_OBJECT
39
40public:
56 GemcGUI(std::shared_ptr<GOptions> gopts,
57 std::shared_ptr<EventDispenser> ed,
59 QWidget* parent = nullptr);
60
67 ~GemcGUI() override;
68
69private:
76 GQTButtonsWidget* leftButtons; // left bar buttons
77
84 QStackedWidget* rightContent; // pages controlled by left bar buttons
85
95 QLineEdit* nEvents;
96
105 QLabel* eventNumberLabel;
106
113 QTimer* gtimer; // for cycling events
114
123 std::shared_ptr<EventDispenser> eventDispenser;
124
131 std::unique_ptr<GUI_Session> guiSession;
132
133private:
139 void createLeftButtons();
140
150 void createRightContent(std::shared_ptr<GOptions> gopts,
152 GBoard* gb);
153
159 void createTopButtons(QHBoxLayout* topLayout);
160
167 void updateGui();
168
169private slots:
176 void neventsChanged();
177
184 void beamOn();
185
192 void cycleBeamOn();
193
197 void stopCycleBeamOn();
198
204 void gquit();
205
215 void change_page(QListWidgetItem* current, QListWidgetItem* previous);
216};
Main GEMC Qt widget that assembles the GUI layout and connects user actions to event processing.
Definition gui.h:36
GemcGUI(std::shared_ptr< GOptions > gopts, std::shared_ptr< EventDispenser > ed, GDetectorConstruction *dc, QWidget *parent=nullptr)
Construct the main GUI widget.
Definition gui.cc:6
~GemcGUI() override
Destroy the GUI widget and release explicitly owned resources.
Definition gui.cc:70