Open Source 2D CAD
Go to the documentation of this file.
23 #include "gui_global.h"
25 #include <QDockWidget>
26 #include <QMainWindow>
27 #include <QKeyEvent>
28 #include <QToolBar>
30 #include "RCloseCurrentEvent.h"
31 #include "RMainWindow.h"
32 #include "RObject.h"
34 class QMdiArea;
35 class QMdiSubWindow;
37 class RBlockListener;
39 class RDocument;
40 class RDocumentInterface;
41 class RFocusListener;
42 class RGraphicsView;
43 class RLayerListener;
44 class RMdiArea;
45 class RMdiChildQt;
47 class RPenListener;
49 class RPropertyListener;
50 class RSelectionListener;
51 class RSnapListener;
52 class RUcsListener;
53 class RViewFocusListener;
54 class RViewListener;
63 class QCADGUI_EXPORT RMainWindowQt: public QMainWindow, public RMainWindow {
66 public:
67  RMainWindowQt(QWidget* parent = 0, bool hasMdiArea = true);
68  virtual ~RMainWindowQt();
69  static RMainWindowQt* getMainWindow();
70  virtual int getWidth();
71  virtual int getHeight();
72  virtual int getPositionX();
73  virtual int getPositionY();
74  virtual void resize(int width, int height);
75  virtual void move(int x, int y);
76  virtual void disable() {
77  setEnabled(false);
78  }
79  virtual void enable() {
80  setEnabled(true);
81  }
82  virtual RDocument* getDocument();
85  virtual void handleUserMessage(const QString& message);
86  virtual void handleUserInfo(const QString& message);
87  virtual void handleUserWarning(const QString& message, bool messageBox = false);
88  virtual void handleUserCommand(const QString& message);
90  virtual void postSelectionChangedEvent();
91  virtual void postTransactionEvent(
92  RTransaction& t,
93  bool onlyChanges=false,
94  RS::EntityType entityTypeFilter = RS::EntityAll
95  );
96  virtual void postCloseEvent();
98  RMdiChildQt* getMdiChild();
99  QTabBar* getTabBar();
100  RMdiArea* getMdiArea();
102  virtual void cancelProgress();
103  virtual void setProgress(int value);
104  virtual void setProgressEnd();
105  virtual void setProgressText(const QString& text = "");
107  virtual void setCommandPrompt(const QString& text = "");
108  virtual void setLeftMouseTip(const QString& text = "");
109  virtual void setRightMouseTip(const QString& text = "");
111  virtual void showContextMenu(RObject::Id entityId, const RVector& pos);
112  virtual void escapeEvent();
114  virtual void setGraphicsViewCursor(const QCursor& cursor);
116  virtual bool readSettings();
117  virtual void writeSettings();
119  virtual QMenu* createPopupMenu();
121  virtual QWidget* getChildWidget(const QString& name);
123  QList<QDockWidget*> getDockWidgets() {
124  return findChildren<QDockWidget*>();
125  }
126  QList<QToolBar*> getToolBars() {
127  return findChildren<QToolBar*>();
128  }
130 public slots:
131  void quit();
132  void currentTabChanged(int index);
133  void subWindowActivated(QMdiSubWindow* sw);
134  //void objectDestroyed(QObject *obj);
136 signals:
140  void commandPrompt(const QString& text);
145  void leftMouseTip(const QString& message);
150  void rightMouseTip(const QString& message);
152  void progress(int value);
153  void progressEnd();
154  void progressText(const QString& label);
155  void progressCanceled();
157  void userMessage(const QString& message);
158  void userInfo(const QString& message);
159  void userWarning(const QString& message, bool messageBox);
160  void userCommand(const QString& message);
165  void contextMenu(int entityId, const RVector& pos);
166  void escape();
167  void drop(QDropEvent* event);
168  void dragEnter(QDragEnterEvent* event);
170  void resumedTab(RMdiChildQt* mdiChild);
172  void closeRequested();
173  void enterPressed();
175  void toolBarContextMenu(QMenu* menu);
177 protected:
178  virtual void closeEvent(QCloseEvent* e);
179  virtual void dropEvent(QDropEvent* event);
180  virtual void dragEnterEvent(QDragEnterEvent* event);
182  virtual bool event(QEvent* e);
184 protected slots:
185  void updateGuiActions(QMdiSubWindow* mdiChild = NULL);
186  void initGuiActions();
187  void updateScenes(QMdiSubWindow* mdiChild);
188  void notifyListenersSlot(QMdiSubWindow* mdiChild);
189  void suspendAndResume(QMdiSubWindow* mdiChild);
191 protected:
194 //private:
195 // bool objectWasDestroyed;
196 };
200 #endif
Abstract base class for classes that are interested in being notified whenever a view has been added ...
Definition: RViewListener.h:37
MDI area with tabbar that features add tab button.
Definition: RMdiArea.h:38
Abstract base class for classes that are interested in the current snap mode.
Definition: RSnapListener.h:39
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
Abstract base class for classes that are interested in being notified when a new document is created...
Definition: RNewDocumentListener.h:37
virtual void handleUserWarning(const QString &message, bool messageBox=false)
Definition: RMainWindow.h:249
Entity types used for property handling / filtering.
Definition: RS.h:76
Definition: gui_global.h:10
virtual void postCloseEvent()=0
Base class for an MDI main application window.
Definition: RMainWindow.h:67
virtual int getPositionX()=0
int Id
Definition: RObject.h:53
Transaction implementation.
Definition: RTransaction.h:74
virtual void setRightMouseTip(const QString &text="")=0
Abstract base class for classes that are interested in being notified whenever a layer has been added...
Definition: RLayerListener.h:37
virtual void postSelectionChangedEvent()=0
Abstract base class for classes that are interested in changes in drawing or application preferences...
Definition: RPreferencesListener.h:36
Abstract base class for classes that are interested in being notified whenever a UCS has been added o...
Definition: RUcsListener.h:36
virtual QWidget * getChildWidget(const QString &name)=0
Abstract base class for classes that are interested in being notified whenever a block has been added...
Definition: RBlockListener.h:37
virtual void quit()=0
Closes the application window.
Abstract base class for classes that are interested in being notified whenever the current pen change...
Definition: RPenListener.h:37
static RMainWindow * getMainWindow()
Definition: RMainWindow.cpp:61
Abstract base class for classes that are interested in the current selection and want to be notified ...
Definition: RSelectionListener.h:36
QList< QToolBar * > getToolBars()
Definition: RMainWindowQt.h:126
Abstract base class for classes that are interested in properties of the current selection or the cur...
Definition: RPropertyListener.h:43
virtual void setProgress(int value)=0
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
virtual int getWidth()=0
QList< QDockWidget * > getDockWidgets()
Definition: RMainWindowQt.h:123
Abstract base class for classes that are interested in the current view focus.
Definition: RViewFocusListener.h:36
virtual void enable()
Definition: RMainWindowQt.h:79
virtual void setGraphicsViewCursor(const QCursor &cursor)=0
Sets the cursor of all graphics views in all MDI children.
MDI child window.
Definition: RMdiChildQt.h:41
virtual void setProgressEnd()=0
Base class for a Qt based MDI main application window.
Definition: RMainWindowQt.h:63
virtual bool readSettings()
Restores the application window settings (size, position, ...).
Definition: RMainWindow.cpp:708
virtual void handleUserMessage(const QString &message)
Definition: RMainWindow.h:241
virtual RDocumentInterface * getDocumentInterface()=0
Abstract base class for classes that are interested in the current focus.
Definition: RFocusListener.h:36
All entities (for filters)
Definition: RS.h:86
Abstract base class for classes that are interested in the current coordinate of the mouse cursor...
Definition: RCoordinateListener.h:38
virtual void handleUserCommand(const QString &message)
Definition: RMainWindow.h:254
virtual void escapeEvent()=0
virtual void writeSettings()
Stores the application window settings (size, position, ...).
Definition: RMainWindow.cpp:738
virtual int getHeight()=0
Interface for interaction between a graphics document and a user.
Definition: RDocumentInterface.h:82
virtual RDocument * getDocument()=0
virtual void move(int x, int y)=0
Moves the application window to the given x / y position.
virtual void postTransactionEvent(RTransaction &t, bool onlyChanges=false, RS::EntityType entityTypeFilter=RS::EntityAll)=0
virtual void disable()
Definition: RMainWindowQt.h:76
virtual void setCommandPrompt(const QString &text="")=0
virtual void resize(int width, int height)=0
Resizes the application window to the given width and height.
virtual int getPositionY()=0
virtual void setLeftMouseTip(const QString &text="")=0
virtual void handleUserInfo(const QString &message)
Definition: RMainWindow.h:245
Graphics view.
Definition: RGraphicsView.h:58
RMdiArea * mdiArea
Definition: RMainWindowQt.h:192
virtual void setProgressText(const QString &text="")=0