ACF $AcfVersion:0$
CDockWidgetGuiComp.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/QDockWidget>
9#else
10#include <QtGui/QDockWidget>
11#endif
12
13// ACF includes
16
17
18namespace iqtgui
19{
20
21
26 public TGuiComponentBase<QDockWidget>,
27 virtual public IMainWindowComponent
28{
29 Q_OBJECT
30public:
32
33 I_BEGIN_COMPONENT(CDockWidgetGuiComp);
34 I_REGISTER_INTERFACE(IMainWindowComponent);
35 I_ASSIGN(m_slaveGuiCompPtr, "SlaveGui", "Slave GUI for this dock widget", true, "SlaveGui");
36 I_ASSIGN(m_dockAreaAttrPtr, "DockArea", "Specify the dock area for this widget\n 0 - left\n 1 - right\n 2 - top\n 3 - bottom", false, 0);
37 I_ASSIGN(m_dockFeaturesAttrPtr, "DockFeatures", "Specify the dock features for this widget\nIt is combination of options:\n0 - permanent\n1 - closable\n 2 - moveable\n 4 - floatable\n 8 - vertical title", true, WCF_CLOSABLE | WCF_MOVEABLE | WCF_FLOATABLE);
38 I_ASSIGN(m_allowedDockAreasAttrPtr, "AllowedDockAreas", "Specify the allowed dock areas\nIt is combination of options:\n 1 - left\n 2 - right\n 4 - top\n 8 - bottom", false, 0);
39 I_ASSIGN(m_dockTitleAttrPtr, "DockTitle", "Specify the dock title ", false, "DockTitle");
40 I_END_COMPONENT;
41
42 // reimplemented (iqtgui::IMainWindowComponent)
43 virtual bool AddToMainWindow(QMainWindow& mainWindow) override;
44 virtual bool RemoveFromMainWindow(QMainWindow& mainWindow) override;
45 virtual QString GetTitle() const override;
46 virtual int GetFlags() const override;
47
48protected:
49 // reimplemented (CGuiComponentBase)
50 virtual void OnGuiCreated() override;
51 virtual void OnGuiDestroyed() override;
52 virtual void OnGuiRetranslate() override;
53
54private:
55 I_REF(iqtgui::IGuiObject, m_slaveGuiCompPtr);
56 I_ATTR(int, m_dockAreaAttrPtr);
57 I_ATTR(int, m_dockFeaturesAttrPtr);
58 I_ATTR(int, m_allowedDockAreasAttrPtr);
59 I_TEXTATTR(m_dockTitleAttrPtr);
60};
61
62
63} // namespace iqtgui
64
65
66
67
Wrapper for docking windows for main window.
virtual void OnGuiRetranslate() override
Called from widget event filter when GUI should be retranslated.
virtual int GetFlags() const override
Get properties of of the window component.
virtual void OnGuiCreated() override
Called just after GUI is initialized.
virtual QString GetTitle() const override
Get the title of the main window component.
TGuiComponentBase< QDockWidget > BaseClass
virtual bool RemoveFromMainWindow(QMainWindow &mainWindow) override
Remove this component from main window.
virtual void OnGuiDestroyed() override
Called just before GUI is released.
virtual bool AddToMainWindow(QMainWindow &mainWindow) override
Add this component to main window.
Common interface for GUI objects used in ACF component context.
Definition IGuiObject.h:133
A common interface for main window component such as dock widget, tool bar and so on.
@ WCF_FLOATABLE
Element can be float from the main window to be standalone window.
@ WCF_CLOSABLE
Element can be closed.
@ WCF_MOVEABLE
Element can be moved.
Base class for all Qt GUI componentes.
#define I_TEXTATTR(member)
Declare translatable text attribute member.
Standard GUI specific interfaces and components based on Qt.