1 #ifndef XGUI_MAINWINDOW_H
2 #define XGUI_MAINWINDOW_H
10 class XGUI_ViewWindow;
13 class PyConsole_EnhConsole;
16 /**\class XGUI_MainWindow
18 * \brief Main window of the application (Desktop).
19 * It contains: Object Browser, 3d Viewer, Python console, property panel, main menu
21 class XGUI_EXPORT XGUI_MainWindow : public QMainWindow
26 XGUI_MainWindow(QWidget* parent = 0);
27 virtual ~XGUI_MainWindow();
29 //! Returns main menu object
30 XGUI_MainMenu* menuObject() const
36 QMdiArea* mdiArea() const;
39 XGUI_Viewer* viewer() const
45 void showPythonConsole();
46 void hidePythonConsole();
47 //! Python console can be a dock widget
48 void dockPythonConsole();
49 //! or can be a tab in the main menu.
50 void undockPythonConsole();
52 void createSubWindow();
54 /// Add name of current directory into title of desktop window
55 void setCurrentDir(const QString& theDir, bool toUpdate = true);
57 /// Add asterisk to a title of the window
58 void setModifiedState(bool isModified, bool toUpdate = true);
60 /// Returns current state of modification
61 bool isModifiedState() const { return myIsModified; }
66 void cascadeWindows();
67 void onViewCreated(XGUI_ViewWindow* theWindow);
68 void onDeleteView(XGUI_ViewWindow* theWindow);
70 void onViewActivated(QMdiSubWindow* theSubWnd);
73 void exitKeySequence();
76 void closeEvent(QCloseEvent* event);
77 void createMainMenu();
80 XGUI_MainMenu* myMenuBar;
81 XGUI_Viewer* myViewer;
87 PyConsole_EnhConsole* myPythonConsole;
90 class XGUI_EXPORT CloseEventWatcher : public QObject
95 CloseEventWatcher(QObject* theParent);
101 bool eventFilter(QObject *obj, QEvent *);