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* GetUserInterfaceWidget() {
204 return fUIDockWidget;
208 inline QTabWidget* GetViewersWidget() {
213 inline QWidget* GetHistoryWidget() {
214 return fHistoryTBWidget;
218 inline QWidget* GetHelpWidget() {
219 return fHelpTBWidget;
223 bool AddViewerTab(QWidget* w, std::string title);
226 bool AddViewerTabFromFile(std::string fileName, std::string title);
232 void SessionTerminate();
240 void CreateHelpWidget();
241 void InitHelpTreeAndVisParametersWidget();
246 QTreeWidgetItem* FindTreeItem(QTreeWidgetItem *,
const QString&);
251 bool eventFilter(QObject*,QEvent*);
253 QMap<int,QString> LookForHelpStringInChildTree(
G4UIcommandTree *,
const QString&);
255 QWidget* CreateVisParametersTBWidget();
256 QWidget* CreateHelpTBWidget();
257 G4UIDockWidget* CreateCoutTBWidget();
258 QWidget* CreateHistoryTBWidget();
259 G4UIDockWidget* CreateUITabWidget();
260 QWidget* CreateSceneTreeComponentsTBWidget();
261 QWidget* CreateViewerWidget();
262 void OpenHelpTreeOnCommand(
const QString &);
263 QString GetShortCommandPath(QString);
264 QString GetLongCommandPath(QTreeWidgetItem*);
266 bool CreateVisCommandGroupAndToolBox(
G4UIcommand*, QWidget*,
int,
bool isDialog);
267 bool CreateCommandWidget(
G4UIcommand* command, QWidget* parent,
bool isDialog);
268 #ifdef G4MULTITHREADED
269 void UpdateCoutThreadFilter();
271 void FilterAllOutputTextArea();
272 QString FilterOutput(
const G4UIOutputString&,
const QString&,
const QString&);
276 QMainWindow * fMainWindow;
277 QLabel *fCommandLabel;
278 QLineEdit * fCommandArea;
279 QTextEdit *fCoutTBTextArea;
280 QTabWidget* fUITabWidget;
281 std::vector <G4UIOutputString> fG4OutputString;
282 QLineEdit * fCoutFilter;
284 QListWidget *fHistoryTBTableList;
285 QTreeWidget *fHelpTreeWidget;
286 QWidget* fHelpTBWidget;
287 QWidget* fHistoryTBWidget;
288 G4UIDockWidget* fCoutDockWidget;
289 G4UIDockWidget* fUIDockWidget;
290 QTabWidget* fSceneTreeComponentsTBWidget;
291 QLineEdit* fHelpLine;
292 G4QTabWidget* fViewerTabWidget;
294 QTextEdit *fStartPage;
295 QSplitter * fHelpVSplitter;
296 QTextEdit* fParameterHelpLabel;
297 QTableWidget* fParameterHelpTable;
299 QToolBar *fToolbarApp;
300 QToolBar *fToolbarUser;
301 QString fStringSeparator;
303 QString fLastOpenPath;
305 QPixmap* fSearchIcon;
307 QComboBox* fThreadsFilterComboBox;
308 std::string fDefaultViewerFirstPageHTMLText;
311 bool fRotateSelected;
313 bool fZoomInSelected;
314 bool fZoomOutSelected;
318 void ClearButtonCallback();
319 void CommandEnteredCallback();
320 void CommandEditedCallback(
const QString & text);
321 void ButtonCallback(
const QString&);
322 void HelpTreeClicCallback();
323 void HelpTreeDoubleClicCallback();
324 void ShowHelpCallback();
325 void CommandHistoryCallback();
326 void LookForHelpStringCallback();
327 void UpdateTabWidget(
int);
328 void ResizeTabWidget( QResizeEvent* );
329 void CoutFilterCallback(
const QString&);
330 void ThreadComboBoxCallback(
int);
331 void TabCloseCallback(
int);
332 void ToolBoxActivated(
int);
333 void VisParameterCallback(QWidget*);
334 void ChangeColorCallback(QWidget*);
335 void ChangeCursorStyle(
const QString&);
336 void ChangeSurfaceStyle(
const QString&);
337 void OpenIconCallback(
const QString&);
338 void SaveIconCallback(
const QString&);
339 void ChangePerspectiveOrtho(
const QString&);
virtual G4bool GetHelpChoice(G4int &)=0
virtual void ExitHelp() const =0
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 *)