ACF $AcfVersion:0$
CToolBarGuiCompBase.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/QMap>
7#if QT_VERSION >= 0x050000
8#include <QtWidgets/QToolBar>
9#else
10#include <QtGui/QToolBar>
11#endif
12
13// ACF includes
16
17
18namespace iqtgui
19{
20
21
26 public iqtgui::TGuiComponentBase<QToolBar>,
27 virtual public iqtgui::IMainWindowComponent
28{
29public:
31
32 I_BEGIN_COMPONENT(CToolBarGuiCompBase);
33 I_REGISTER_INTERFACE(iqtgui::IMainWindowComponent);
34 I_ASSIGN(m_toolBarAreaAttrPtr, "ToolBarArea", "Specify the area for this toolbar\n 0 - left\n 1 - right\n 2 - top\n 3 - bottom", false, 0);
35 I_ASSIGN(m_useVerticalOrientationAttrPtr, "UseVerticalOrientation", "Use vertical orientation of the tool bar", true, false);
36 I_ASSIGN(m_dockFeaturesAttrPtr, "DockFeatures", "Specify the dock features for this widget\nIt is combination of options:\n2 - moveable\n4 - floatable", true, WCF_MOVEABLE | WCF_FLOATABLE);
37 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);
38 I_ASSIGN(m_titleAttrPtr, "Title", "Tool bar title", false, "");
39 I_ASSIGN(m_iconSizeAttrPtr, "IconSize", "Size of the icon used in the tool bar", false, 32);
40 I_ASSIGN(m_buttonStyleAttrPtr, "ButtonStyle", "Button style used by the tool bar\n0 - Only display the icon\n1 - Only display the text\n2 - The text appears beside the icon\n3 - The text appears under the icon\n4 - Follow the system style", true, Qt::ToolButtonIconOnly);
41 I_END_COMPONENT;
42
43 // reimplemented (iqtgui::IMainWindowComponent)
44 virtual bool AddToMainWindow(QMainWindow& mainWindow) override;
45 virtual bool RemoveFromMainWindow(QMainWindow& mainWindow) override;
46 virtual QString GetTitle() const override;
47 virtual int GetFlags() const override;
48
49protected:
50 // reimplemented (CGuiComponentBase)
51 virtual void OnGuiCreated() override;
52
53private:
54 I_ATTR(int, m_toolBarAreaAttrPtr);
55 I_ATTR(bool, m_useVerticalOrientationAttrPtr);
56 I_ATTR(int, m_dockFeaturesAttrPtr);
57 I_ATTR(int, m_allowedDockAreasAttrPtr);
58 I_TEXTATTR(m_titleAttrPtr);
59 I_ATTR(int, m_iconSizeAttrPtr);
60 I_ATTR(int, m_buttonStyleAttrPtr);
61};
62
63
64} // namespace iqtgui
65
66
67
68
Basic implementation of a tool bar component.
virtual QString GetTitle() const override
Get the title of the main window component.
virtual void OnGuiCreated() override
Called just after GUI is initialized.
iqtgui::TGuiComponentBase< QToolBar > BaseClass
virtual bool RemoveFromMainWindow(QMainWindow &mainWindow) override
Remove this component from main window.
virtual int GetFlags() const override
Get properties of of the window component.
virtual bool AddToMainWindow(QMainWindow &mainWindow) override
Add this component to main window.
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_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.