QCAD
Open Source 2D CAD
RMainWindowQt.h
Go to the documentation of this file.
1 
20 #ifndef RMAINWINDOWQT_H
21 #define RMAINWINDOWQT_H
22 
23 #include "gui_global.h"
24 
25 #include <QMainWindow>
26 #include <QKeyEvent>
27 
28 #include "RCloseCurrentEvent.h"
29 #include "RMainWindow.h"
30 
31 class QMdiArea;
32 class QMdiSubWindow;
33 
34 class RBlockListener;
36 class RDocument;
37 class RDocumentInterface;
38 class RFocusListener;
39 class RGraphicsView;
40 class RLayerListener;
41 class RMdiArea;
42 class RMdiChildQt;
44 class RPenListener;
45 class RPropertyListener;
46 class RSelectionListener;
47 class RSnapListener;
48 class RUcsListener;
49 class RViewFocusListener;
50 class RViewListener;
51 
59 class QCADGUI_EXPORT RMainWindowQt: public QMainWindow, public RMainWindow {
60 Q_OBJECT
61 
62 public:
63  RMainWindowQt(QWidget* parent = 0, bool hasMdiArea = true);
64  virtual ~RMainWindowQt();
65  static RMainWindowQt* getMainWindow();
66  virtual int getWidth();
67  virtual int getHeight();
68  virtual int getPositionX();
69  virtual int getPositionY();
70  virtual void resize(int width, int height);
71  virtual void move(int x, int y);
72  virtual RDocument* getDocument();
74 
75  virtual void handleUserMessage(const QString& message);
76  virtual void handleUserInfo(const QString& message);
77  virtual void handleUserWarning(const QString& message, bool messageBox = false);
78  virtual void handleUserCommand(const QString& message);
79 
80  virtual void postSelectionChangedEvent();
81  virtual void postTransactionEvent(
82  RTransaction& t,
83  bool onlyChanges=false,
84  RS::EntityType entityTypeFilter = RS::EntityAll
85  );
86  virtual void postCloseEvent();
87 
88  RMdiChildQt* getMdiChild();
89  QTabBar* getTabBar();
90  RMdiArea* getMdiArea();
91 
92  virtual void cancelProgress();
93  virtual void setProgress(int value);
94  virtual void setProgressEnd();
95  virtual void setProgressText(const QString& text = "");
96 
97  virtual void setCommandPrompt(const QString& text = "");
98  virtual void setLeftMouseTip(const QString& text = "");
99  virtual void setRightMouseTip(const QString& text = "");
100 
101  virtual void escapeEvent();
102 
103  virtual void setGraphicsViewCursor(const QCursor& cursor);
104 
105  virtual bool readSettings();
106  virtual void writeSettings();
107 
108  virtual QWidget* getChildWidget(const QString& name);
109 
110 public slots:
111  void quit();
112  void currentTabChanged(int index);
113  void subWindowActivated(QMdiSubWindow* sw);
114  //void objectDestroyed(QObject *obj);
115 
116 signals:
120  void commandPrompt(const QString& text);
121 
125  void leftMouseTip(const QString& message);
126 
130  void rightMouseTip(const QString& message);
131 
132  void progress(int value);
133  void progressEnd();
134  void progressText(const QString& label);
135  void progressCanceled();
136  void userMessage(const QString& message);
137  void userInfo(const QString& message);
138  void userWarning(const QString& message, bool messageBox);
139  void userCommand(const QString& message);
140  void escape();
141  void drop(QDropEvent* event);
142  void dragEnter(QDragEnterEvent* event);
143 
144  void resumedTab(RMdiChildQt* mdiChild);
145 
146  void closeRequested();
147 
148 protected:
149  virtual void closeEvent(QCloseEvent* e);
150  virtual void dropEvent(QDropEvent* event);
151  virtual void dragEnterEvent(QDragEnterEvent* event);
152 
153  virtual bool event(QEvent* e);
154 
155 protected slots:
156  void updateGuiActions(QMdiSubWindow* mdiChild = NULL);
157  void initGuiActions();
158  void updateScenes(QMdiSubWindow* mdiChild);
159  void notifyListenersSlot(QMdiSubWindow* mdiChild);
160  void suspendAndResume(QMdiSubWindow* mdiChild);
161 
162 protected:
164 
165 //private:
166 // bool objectWasDestroyed;
167 };
168 
170 
171 #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
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:234
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:75
#define QCADGUI_EXPORT
Definition: gui_global.h:10
virtual void postCloseEvent()=0
Base class for an MDI main application window.
Definition: RMainWindow.h:65
virtual int getPositionX()=0
Transaction implementation.
Definition: RTransaction.h:70
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 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:62
Abstract base class for classes that are interested in the current clipboard contents and want to be ...
Definition: RSelectionListener.h:36
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:63
virtual int getWidth()=0
Q_DECLARE_METATYPE(RMath *)
Abstract base class for classes that are interested in the current view focus.
Definition: RViewFocusListener.h:36
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:59
virtual bool readSettings()
Restores the application window settings (size, position, ...).
Definition: RMainWindow.cpp:617
virtual void handleUserMessage(const QString &message)
Definition: RMainWindow.h:226
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:76
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:239
virtual void escapeEvent()=0
virtual void writeSettings()
Stores the application window settings (size, position, ...).
Definition: RMainWindow.cpp:636
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 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:230
Graphics view.
Definition: RGraphicsView.h:58
RMdiArea * mdiArea
Definition: RMainWindowQt.h:163
virtual void setProgressText(const QString &text="")=0