32 #if defined(G4UI_BUILD_QT_SESSION) || defined(G4UI_USE_QT)
41 #include <qstringlist.h>
42 #include <qtabwidget.h>
43 #include <qdockwidget.h>
51 class QTreeWidgetItem;
64 class QStandardItemModel;
87 class G4QTabWidget :
public QTabWidget {
90 G4QTabWidget(QWidget* aParent,
int sizeX,
int sizeY);
91 void paintEvent ( QPaintEvent * event );
92 inline void setTabSelected(
bool a) { fTabSelected =
a; };
93 inline void setLastTabCreated(
int a) { fLastCreated =
a; };
94 inline bool isTabSelected() {
return fTabSelected; };
99 inline void setPreferredSize(QSize
s) {
100 fPreferedSizeX = s.width() + 6;
101 fPreferedSizeY = s.height() + 58;
103 inline QSize sizeHint ()
const {
104 return QSize(fPreferedSizeX, fPreferedSizeY);
108 class G4UIOutputString {
110 G4UIOutputString(QString text,
G4String thread =
"",
G4String outputstream=
"info");
111 inline QString GetOutputList() {
return " all info warning error ";};
118 class G4UIDockWidget :
public QDockWidget {
120 G4UIDockWidget(QString txt);
121 void closeEvent(QCloseEvent *);
133 void AddMenu(
const char*,
const char*);
138 void AddButton(
const char*,
const char*,
const char*);
144 void AddIcon(
const char* userLabel,
const char* iconFile,
const char* command,
const char* file_name=
"");
155 bool AddTabWidget(QWidget*,QString);
158 inline QTabWidget* GetViewerTabWidget() {
159 return fViewerTabWidget;
162 QWidget* GetSceneTreeWidget();
165 QWidget* GetViewerPropertiesWidget();
168 QWidget* GetPickInfosWidget();
171 bool IsSplitterReleased();
173 inline bool IsIconMoveSelected() {
174 return fMoveSelected;
176 inline bool IsIconRotateSelected() {
177 return fRotateSelected;
179 inline bool IsIconPickSelected() {
180 return fPickSelected;
182 inline bool IsIconZoomInSelected() {
183 return fZoomInSelected;
185 inline bool IsIconZoomOutSelected() {
186 return fZoomOutSelected;
189 void SetIconMoveSelected();
190 void SetIconRotateSelected();
191 void SetIconPickSelected();
192 void SetIconZoomInSelected();
193 void SetIconZoomOutSelected();
194 void SetIconHLHSRSelected();
195 void SetIconHLRSelected();
196 void SetIconSolidSelected();
197 void SetIconWireframeSelected();
198 void SetIconPerspectiveSelected();
199 void SetIconOrthoSelected();
201 inline QMainWindow * GetMainWindow() {
206 inline QPixmap* getSearchIcon() {
return fSearchIcon;};
208 inline QPixmap* getClearIcon() {
return fClearIcon;};
211 void SetStartPage(
const std::string&);
216 inline QWidget* GetCoutWidget() {
217 return fCoutDockWidget->widget();
221 inline G4UIDockWidget* GetCoutDockWidget() {
222 return fCoutDockWidget;
226 inline G4UIDockWidget* GetUserInterfaceWidget() {
227 return fUIDockWidget;
231 inline QTabWidget* GetUITabWidget() {
236 inline QWidget* GetHistoryWidget() {
237 return fHistoryTBWidget;
241 inline QWidget* GetHelpWidget() {
242 return fHelpTBWidget;
246 bool AddViewerTab(QWidget* w, std::string title);
249 bool AddViewerTabFromFile(std::string fileName, std::string title);
255 void SessionTerminate();
263 void CreateHelpWidget();
264 void InitHelpTreeAndVisParametersWidget();
266 void UpdateCommandCompleter();
269 void SetDefaultIconsToolbar();
272 QTreeWidgetItem* FindTreeItem(QTreeWidgetItem *,
const QString&);
277 bool eventFilter(QObject*,QEvent*);
279 QMap<int,QString> LookForHelpStringInChildTree(
G4UIcommandTree *,
const QString&);
281 QWidget* CreateVisParametersTBWidget();
282 QWidget* CreateHelpTBWidget();
283 G4UIDockWidget* CreateCoutTBWidget();
284 QWidget* CreateHistoryTBWidget();
285 G4UIDockWidget* CreateUITabWidget();
286 QWidget* CreateSceneTreeWidget();
287 void CreateViewerWidget();
288 void OpenHelpTreeOnCommand(
const QString &);
289 QString GetShortCommandPath(QString);
290 QString GetLongCommandPath(QTreeWidgetItem*);
292 bool CreateVisCommandGroupAndToolBox(
G4UIcommand*, QWidget*,
int,
bool isDialog);
293 bool CreateCommandWidget(
G4UIcommand* command, QWidget* parent,
bool isDialog);
294 void CreateViewerPropertiesDialog();
295 void CreatePickInfosDialog();
296 #ifdef G4MULTITHREADED
297 void UpdateCoutThreadFilter();
299 void FilterAllOutputTextArea();
300 QString FilterOutput(
const G4UIOutputString&,
const QString&,
const QString&);
302 bool CheckG4EnvironmentVariable(
char* txt,
char* version);
303 QStandardItemModel* CreateCompleterModel(
G4String aCmd);
304 void CreateEmptyViewerPropertiesWidget();
305 void CreateEmptyPickInfosWidget();
308 QMainWindow * fMainWindow;
309 QLabel *fCommandLabel;
310 QLineEdit * fCommandArea;
311 QTextEdit *fCoutTBTextArea;
312 QTabWidget* fUITabWidget;
313 std::vector <G4UIOutputString> fG4OutputString;
314 QLineEdit * fCoutFilter;
315 QCompleter* fCompleter;
318 QListWidget *fHistoryTBTableList;
319 QTreeWidget *fHelpTreeWidget;
320 QWidget* fHelpTBWidget;
321 QWidget* fHistoryTBWidget;
322 G4UIDockWidget* fCoutDockWidget;
323 G4UIDockWidget* fUIDockWidget;
324 QWidget* fSceneTreeWidget;
325 QWidget* fViewerPropertiesWidget;
326 QWidget* fPickInfosWidget;
327 QLineEdit* fHelpLine;
328 G4QTabWidget* fViewerTabWidget;
330 QTextEdit *fStartPage;
331 QSplitter * fHelpVSplitter;
332 QTextEdit* fParameterHelpLabel;
333 QTableWidget* fParameterHelpTable;
335 QToolBar *fToolbarApp;
336 QToolBar *fToolbarUser;
337 QString fStringSeparator;
339 QString fLastOpenPath;
340 QToolButton* fViewModePopupButton;
341 QToolButton* fSurfaceModePopupButton;
343 QPixmap* fSearchIcon;
348 QPixmap* fRotateIcon;
350 QPixmap* fZoomInIcon;
351 QPixmap* fZoomOutIcon;
352 QPixmap* fWireframeIcon;
354 QPixmap* fHiddenLineRemovalIcon;
355 QPixmap* fHiddenLineAndSurfaceRemovalIcon;
356 QPixmap* fPerspectiveIcon;
358 QPixmap* fCommandIcon;
362 QPixmap* fPickTargetIcon;
364 #ifdef G4MULTITHREADED
365 QComboBox* fThreadsFilterComboBox;
367 std::string fDefaultViewerFirstPageHTMLText;
369 QDialog* fViewerPropertiesDialog;
370 QDialog* fPickInfosDialog;
373 bool fRotateSelected;
375 bool fZoomInSelected;
376 bool fZoomOutSelected;
380 void ClearButtonCallback();
381 void SaveOutputCallback();
382 void CommandEnteredCallback();
383 void CommandEditedCallback(
const QString & text);
384 void ButtonCallback(
const QString&);
385 void HelpTreeClicCallback();
386 void HelpTreeDoubleClicCallback();
387 void ShowHelpCallback();
388 void CommandHistoryCallback();
389 void LookForHelpStringCallback();
390 void UpdateTabWidget(
int);
391 void ResizeTabWidget( QResizeEvent* );
392 void CoutFilterCallback(
const QString&);
393 void ThreadComboBoxCallback(
int);
394 void TabCloseCallback(
int);
395 void ToolBoxActivated(
int);
396 void VisParameterCallback(QWidget*);
397 void ChangeColorCallback(QWidget*);
398 void ChangeCursorAction(
const QString&);
399 void ChangeSurfaceStyle(
const QString&);
400 void OpenIconCallback(
const QString&);
401 void SaveIconCallback(
const QString&);
402 void ViewerPropertiesIconCallback(
int);
403 void ChangePerspectiveOrtho(
const QString&);
virtual void DefaultIcons(bool)
virtual G4bool GetHelpChoice(G4int &)=0
static constexpr double s
virtual void ExitHelp() const =0
std::vector< ExP01TrackerHit * > a
virtual G4int ReceiveG4cout(const G4String &coutString)
virtual void AddMenu(const char *, const char *)
virtual void PauseSessionStart(const G4String &Prompt)=0
virtual G4UIsession * SessionStart()=0
virtual void AddButton(const char *, const char *, const char *)
virtual G4int ReceiveG4cerr(const G4String &cerrString)
virtual void AddIcon(const char *, const char *, const char *, const char *)