ICF 3.0.5.47
Technical documentation of ICF Libraries
TGuiComponentBase.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef iqtgui_TGuiComponentBase_included
7#define iqtgui_TGuiComponentBase_included
8
9
10// Qt includes
11#include <QtCore/QtGlobal>
12#include <QtWidgets/QWidget>
13
14
15// ICF includes
17
18
19namespace istdgui
20{
21
22
25template <class WidgetType>
27{
28public:
30
32
33 virtual WidgetType* GetQtWidget() const;
34
35protected:
36 // reimplemented (istdgui::CGuiComponentBase)
37 virtual QWidget* CreateQtWidget(QWidget* parentPtr);
38};
39
40
41// public methods
42
43template <class WidgetType>
47
48
49template <class WidgetType>
51{
52 return dynamic_cast<WidgetType*>(GetWidget());
53}
54
55
56// protected methods
57
58// reimplemented (istdgui::CGuiComponentBase)
59
60template <class WidgetType>
62{
63 Q_ASSERT(!IsGuiCreated());
64
65 WidgetType* widgetPtr = new WidgetType(parentPtr);
66
67 return widgetPtr;
68}
69
70
71} // namespace istdgui
72
73
74#endif // !iqtgui_TGuiComponentBase_included
75
76
Base class for classes implementing interface istdgui::IGuiObject.
Base class for all Qt GUI componentes.
virtual QWidget * CreateQtWidget(QWidget *parentPtr)
Create slave widget object.
virtual WidgetType * GetQtWidget() const
Standard GUI specific interfaces and components based on Qt.

© Witold Gantzke and Kirill Lepskiy