32 #if defined(G4UI_BUILD_QT_SESSION) || defined(G4UI_USE_QT)
41 #include <qstringlist.h>
42 #include <qtabwidget.h>
43 #include <qdockwidget.h>
50 class QTreeWidgetItem;
82 class G4QTabWidget :
public QTabWidget {
85 G4QTabWidget(QWidget* aParent,
int sizeX,
int sizeY);
86 void paintEvent ( QPaintEvent * event );
87 inline void setTabSelected(
bool a) { fTabSelected =
a; };
88 inline void setLastTabCreated(
int a) { fLastCreated =
a; };
89 inline bool isTabSelected() {
return fTabSelected; };
94 inline void setPreferredSize(QSize
s) {
95 fPreferedSizeX = s.width() + 6;
96 fPreferedSizeY = s.height() + 58;
98 inline QSize sizeHint ()
const {
99 return QSize(fPreferedSizeX, fPreferedSizeY);
103 class G4UIOutputString {
105 G4UIOutputString(QString text,
G4String thread =
"",
G4String outputstream=
"info");
106 inline QString GetOutputList() {
return " all info warning error ";};
113 class G4UIDockWidget :
public QDockWidget {
115 G4UIDockWidget(QString txt);
116 void closeEvent(QCloseEvent *);
128 void AddMenu(
const char*,
const char*);
133 void AddButton(
const char*,
const char*,
const char*);
139 void AddIcon(
const char* userLabel,
const char* iconFile,
const char* command,
const char* file_name=
"");
147 bool AddTabWidget(QWidget*,QString);
150 QTabWidget* GetSceneTreeComponentsTBWidget();
153 bool IsSplitterReleased();
155 inline bool IsIconMoveSelected() {
156 return fMoveSelected;
158 inline bool IsIconRotateSelected() {
159 return fRotateSelected;
161 inline bool IsIconPickSelected() {
162 return fPickSelected;
164 inline bool IsIconZoomInSelected() {
165 return fZoomInSelected;
167 inline bool IsIconZoomOutSelected() {
168 return fZoomOutSelected;
171 void SetIconMoveSelected();
172 void SetIconRotateSelected();
173 void SetIconPickSelected();
174 void SetIconZoomInSelected();
175 void SetIconZoomOutSelected();
176 void SetIconHLHSRSelected();
177 void SetIconHLRSelected();
178 void SetIconSolidSelected();
179 void SetIconWireframeSelected();
180 void SetIconPerspectiveSelected();
181 void SetIconOrthoSelected();
183 inline QMainWindow * GetMainWindow() {
188 inline QPixmap* getSearchIcon() {
return fSearchIcon;};
190 inline QPixmap* getClearIcon() {
return fClearIcon;};
193 void SetStartPage(
const std::string&);
198 inline QWidget* GetCoutWidget() {
199 return fCoutDockWidget->widget();
203 inline G4UIDockWidget* GetCoutDockWidget() {
204 return fCoutDockWidget;
208 inline G4UIDockWidget* GetUserInterfaceWidget() {
209 return fUIDockWidget;
213 inline QTabWidget* GetViewersWidget() {
218 inline QWidget* GetHistoryWidget() {
219 return fHistoryTBWidget;
223 inline QWidget* GetHelpWidget() {
224 return fHelpTBWidget;
228 bool AddViewerTab(QWidget*
w, std::string title);
231 bool AddViewerTabFromFile(std::string fileName, std::string title);
237 void SessionTerminate();
245 void CreateHelpWidget();
246 void InitHelpTreeAndVisParametersWidget();
251 QTreeWidgetItem* FindTreeItem(QTreeWidgetItem *,
const QString&);
256 bool eventFilter(QObject*,QEvent*);
258 QMap<int,QString> LookForHelpStringInChildTree(
G4UIcommandTree *,
const QString&);
260 QWidget* CreateVisParametersTBWidget();
261 QWidget* CreateHelpTBWidget();
262 G4UIDockWidget* CreateCoutTBWidget();
263 QWidget* CreateHistoryTBWidget();
264 G4UIDockWidget* CreateUITabWidget();
265 QWidget* CreateSceneTreeComponentsTBWidget();
266 void CreateViewerWidget();
267 void OpenHelpTreeOnCommand(
const QString &);
268 QString GetShortCommandPath(QString);
269 QString GetLongCommandPath(QTreeWidgetItem*);
271 bool CreateVisCommandGroupAndToolBox(
G4UIcommand*, QWidget*,
int,
bool isDialog);
272 bool CreateCommandWidget(
G4UIcommand* command, QWidget* parent,
bool isDialog);
273 #ifdef G4MULTITHREADED
274 void UpdateCoutThreadFilter();
276 void FilterAllOutputTextArea();
277 QString FilterOutput(
const G4UIOutputString&,
const QString&,
const QString&);
281 QMainWindow * fMainWindow;
282 QLabel *fCommandLabel;
283 QLineEdit * fCommandArea;
284 QTextEdit *fCoutTBTextArea;
285 QTabWidget* fUITabWidget;
286 std::vector <G4UIOutputString> fG4OutputString;
287 QLineEdit * fCoutFilter;
289 QListWidget *fHistoryTBTableList;
290 QTreeWidget *fHelpTreeWidget;
291 QWidget* fHelpTBWidget;
292 QWidget* fHistoryTBWidget;
293 G4UIDockWidget* fCoutDockWidget;
294 G4UIDockWidget* fUIDockWidget;
295 QTabWidget* fSceneTreeComponentsTBWidget;
296 QLineEdit* fHelpLine;
297 G4QTabWidget* fViewerTabWidget;
299 QTextEdit *fStartPage;
300 QSplitter * fHelpVSplitter;
301 QTextEdit* fParameterHelpLabel;
302 QTableWidget* fParameterHelpTable;
304 QToolBar *fToolbarApp;
305 QToolBar *fToolbarUser;
306 QString fStringSeparator;
308 QString fLastOpenPath;
310 QPixmap* fSearchIcon;
312 QComboBox* fThreadsFilterComboBox;
313 std::string fDefaultViewerFirstPageHTMLText;
316 bool fRotateSelected;
318 bool fZoomInSelected;
319 bool fZoomOutSelected;
323 void ClearButtonCallback();
324 void CommandEnteredCallback();
325 void CommandEditedCallback(
const QString & text);
326 void ButtonCallback(
const QString&);
327 void HelpTreeClicCallback();
328 void HelpTreeDoubleClicCallback();
329 void ShowHelpCallback();
330 void CommandHistoryCallback();
331 void LookForHelpStringCallback();
332 void UpdateTabWidget(
int);
333 void ResizeTabWidget( QResizeEvent* );
334 void CoutFilterCallback(
const QString&);
335 void ThreadComboBoxCallback(
int);
336 void TabCloseCallback(
int);
337 void ToolBoxActivated(
int);
338 void VisParameterCallback(QWidget*);
339 void ChangeColorCallback(QWidget*);
340 void ChangeCursorStyle(
const QString&);
341 void ChangeSurfaceStyle(
const QString&);
342 void OpenIconCallback(
const QString&);
343 void SaveIconCallback(
const QString&);
344 void ChangePerspectiveOrtho(
const QString&);
virtual G4bool GetHelpChoice(G4int &)=0
virtual void ExitHelp() const =0
const G4double w[NPOINTSGL]
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 *)