CGuiComponentDialog.h
Go to the documentation of this file.
1 #ifndef iqtgui_CGuiComponentDialog_included
2 #define iqtgui_CGuiComponentDialog_included
3 
4 
5 // Qt includes
6 #include <QtCore/QtGlobal>
7 #if QT_VERSION >= 0x050000
8 #include <QtWidgets/QDialog>
9 #include <QtWidgets/QDialogButtonBox>
10 #else
11 #include <QtGui/QDialog>
12 #include <QtGui/QDialogButtonBox>
13 #endif
14 
15 // ACF includes
16 #include <icomp/CComponentBase.h>
17 
18 #include <iqtgui/IGuiObject.h>
19 
20 
21 namespace iqtgui
22 {
23 
24 
28 class CGuiComponentDialog: public QDialog
29 {
30 public:
31  typedef QDialog BaseClass;
32 
43  iqtgui::IGuiObject* guiObjectPtr,
44  int buttons = 0,
45  bool isModal = true,
46  QWidget* parentWidgetPtr = NULL);
47 
48  virtual ~CGuiComponentDialog();
49 
55  void SetDialogGeometry(double screenFactor = 0.0, const QPoint* positionPtr = NULL);
56 
61  const QDialogButtonBox* GetButtonBoxPtr() const;
62 
66  const iqtgui::IGuiObject* GetGuiPtr() const;
67 
68 protected:
69  // reimplemented (QWidget)
70  virtual void closeEvent(QCloseEvent* eventPtr);
71  virtual void keyPressEvent(QKeyEvent* eventPtr);
72  virtual void showEvent(QShowEvent* eventPtr);
73 
74 private:
75  QDialogButtonBox* m_buttonsBox;
76  iqtgui::IGuiObject* m_guiObjectPtr;
77 
78  double m_screenFactor;
79  const QPoint* m_screenPositionPtr;
80 };
81 
82 
83 // public inline methods
84 
85 inline const QDialogButtonBox* CGuiComponentDialog::GetButtonBoxPtr() const
86 {
87  return m_buttonsBox;
88 }
89 
90 
92 {
93  return m_guiObjectPtr;
94 }
95 
96 
97 } // namespace iqtgui
98 
99 
100 #endif // !iqtgui_CGuiComponentDialog_included
101 
102 
virtual void closeEvent(QCloseEvent *eventPtr)
virtual void showEvent(QShowEvent *eventPtr)
const QDialogButtonBox * GetButtonBoxPtr() const
Returns the internal button box.
Common interface for GUI objects using in component context.
Definition: IGuiObject.h:25
const iqtgui::IGuiObject * GetGuiPtr() const
Returns pointer to the connected GUI object.
#define NULL
Definition: istd.h:64
Class to display an ACF GUI component in a dialog.
void SetDialogGeometry(double screenFactor=0.0, const QPoint *positionPtr=NULL)
Set initial size and position of the dialog.
virtual void keyPressEvent(QKeyEvent *eventPtr)
CGuiComponentDialog(iqtgui::IGuiObject *guiObjectPtr, int buttons=0, bool isModal=true, QWidget *parentWidgetPtr=NULL)
Construct the component dialog.

© 2007-2017 Witold Gantzke and Kirill Lepskiy