ACF $AcfVersion:0$
CGuiComponentDialog.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
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
17
18#include <iqtgui/IGuiObject.h>
19
20
21namespace iqtgui
22{
23
24
28class CGuiComponentDialog: public QDialog
29{
30public:
31 typedef QDialog BaseClass;
32
43 iqtgui::IGuiObject* guiObjectPtr,
44 int buttons = 0,
45 bool isModal = true,
46 QWidget* parentWidgetPtr = NULL);
47
49
55 void SetDialogGeometry(double screenFactor = 0.0, const QPoint* positionPtr = NULL);
56 void SetDialogGeometry(double screenFactorX, double screenFactorY, const QPoint* positionPtr = NULL);
57
62 const QDialogButtonBox* GetButtonBoxPtr() const;
63
67 const iqtgui::IGuiObject* GetGuiPtr() const;
68
69protected:
70 // reimplemented (QWidget)
71 virtual void closeEvent(QCloseEvent* eventPtr) override;
72 virtual void keyPressEvent(QKeyEvent* eventPtr) override;
73 virtual void showEvent(QShowEvent* eventPtr) override;
74
75private:
76 QDialogButtonBox* m_buttonsBox;
77 iqtgui::IGuiObject* m_guiObjectPtr;
78
79 double m_screenFactorX;
80 double m_screenFactorY;
81 const QPoint* m_screenPositionPtr;
82};
83
84
85// public inline methods
86
87inline const QDialogButtonBox* CGuiComponentDialog::GetButtonBoxPtr() const
88{
89 return m_buttonsBox;
90}
91
92
94{
95 return m_guiObjectPtr;
96}
97
98
99} // namespace iqtgui
100
101
102
103
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.
CGuiComponentDialog(iqtgui::IGuiObject *guiObjectPtr, int buttons=0, bool isModal=true, QWidget *parentWidgetPtr=NULL)
Construct the component dialog.
virtual void closeEvent(QCloseEvent *eventPtr) override
void SetDialogGeometry(double screenFactorX, double screenFactorY, const QPoint *positionPtr=NULL)
const QDialogButtonBox * GetButtonBoxPtr() const
Returns the internal button box.
virtual void keyPressEvent(QKeyEvent *eventPtr) override
const iqtgui::IGuiObject * GetGuiPtr() const
Returns pointer to the connected GUI object.
virtual void showEvent(QShowEvent *eventPtr) override
Common interface for GUI objects used in ACF component context.
Definition IGuiObject.h:133
#define NULL
Definition istd.h:74
Standard GUI specific interfaces and components based on Qt.