QCAD
Open Source 2D CAD
RMdiChildQt.h
Go to the documentation of this file.
1 
20 #ifndef RMDICHILDQT_H
21 #define RMDICHILDQT_H
22 
23 #include "gui_global.h"
24 
25 #include <QMdiSubWindow>
26 
27 #include "RDebug.h"
28 #include "RModifiedListener.h"
29 
30 class RDocument;
31 class RDocumentInterface;
32 class RGraphicsViewQt;
33 
41 class QCADGUI_EXPORT RMdiChildQt: public QMdiSubWindow, public RModifiedListener {
42 Q_OBJECT
43 
44 public:
45  RMdiChildQt(QWidget* parent = NULL);
46  virtual ~RMdiChildQt();
47 
48  void setDocumentInterface(RDocumentInterface* di);
49 
52  RGraphicsViewQt* getLastKnownViewWithFocus();
53 
54  virtual void updateModifiedListener(const RStorage* storage);
55 
57  closeEventAccepted = false;
58  }
59 
61  closeEventAccepted = true;
62  }
63 
65  return closeEventAccepted;
66  }
67 
68 signals:
69  void closeRequested(RMdiChildQt* mdiChild);
70  void closeAccepted(RMdiChildQt* mdiChild);
71  void modifiedStatusChanged(RMdiChildQt* mdiChild);
72 
73 protected:
74  virtual void closeEvent(QCloseEvent* closeEvent);
75  virtual QSize sizeHint() const;
76 
77 private:
81 };
82 
84 
85 #endif
bool closeEventAccepted
Definition: RMdiChildQt.h:80
virtual void updateModifiedListener(const RStorage *storage)=0
Called by the document whenever the current transaction stack changes.
#define QCADGUI_EXPORT
Definition: gui_global.h:10
Abstract base class for classes that are interested in the current state of a storage (modified or un...
Definition: RModifiedListener.h:34
void getDocument()
Definition: simple.js:19
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RStorage.h:55
static RDocumentInterface * diLast
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RMdiChildQt.h:79
bool isCloseEventAccepted()
Definition: RMdiChildQt.h:64
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:63
Q_DECLARE_METATYPE(RMath *)
void getDocumentInterface()
Definition: simple.js:21
MDI child window.
Definition: RMdiChildQt.h:41
void setCloseEventAccepted()
Definition: RMdiChildQt.h:60
QWidget based 2d graphics view.
Definition: RGraphicsViewQt.h:55
Interface for interaction between a graphics document and a user.
Definition: RDocumentInterface.h:82
void setCloseEventRejected()
Definition: RMdiChildQt.h:56
RDocumentInterface * documentInterface
Definition: RMdiChildQt.h:78