ICF 3.1.1.10
Technical documentation of ICF Libraries
CButtonBasedSelectionParamGuiComp.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 iqtprm_CButtonBasedSelectionParamGuiComp_included
7#define iqtprm_CButtonBasedSelectionParamGuiComp_included
8
9
10// Qt includes
11#include <QtCore/QtGlobal>
12#include <QtWidgets/QCommandLinkButton>
13#include <QtWidgets/QToolButton>
14#include <QtWidgets/QRadioButton>
15#include <QtWidgets/QButtonGroup>
16
17// ICF includes
21
22#include <GeneratedFiles/iprmgui/ui_CButtonBasedSelectionParamGuiComp.h>
23
24
25namespace iprmgui
26{
27
33 Ui::CButtonBasedSelectionParamGuiComp, iprm::ISelectionParam>
34{
35 Q_OBJECT
36
37public:
39 Ui::CButtonBasedSelectionParamGuiComp, iprm::ISelectionParam> BaseClass;
40
41 I_BEGIN_COMPONENT(CButtonBasedSelectionParamGuiComp);
42 I_ASSIGN(m_iconProviderCompPtr, "IconProvider", "Provider of the button icons", false, "IconProvider");
43 I_ASSIGN(m_fontSizeAttrPtr, "FontSize", "Font Size", true, 8);
44 I_ASSIGN(m_iconSizeAttrPtr, "IconSize", "Icon Size", true, 16);
45 I_ASSIGN(m_minWidthAttrPtr, "MinimumWidth", "Minimum width of the buttons (0 - default)", true, 0);
46 I_ASSIGN(m_layoutTypeAttrPtr, "LayoutType", "0 - horizontal\n1 - vertical\n2 and more - number of columns", true, 1);
47 I_ASSIGN(m_descriptionTypeAttrPtr, "DescriptionType", "0 - No description visible\n1 - Default (description is alvays visible)\n2 - Compact (description is visible for checked button only)", true, 1);
48 I_ASSIGN(m_showTooltipAttrPtr, "DescriptionAsTooltip", "Show description as tooltip", true, false);
49 I_END_COMPONENT;
50
51protected:
52 // reimplemented (istdgui::TGuiObserverWrap)
53 void OnGuiModelAttached() override;
54 void OnGuiModelDetached() override;
55 void UpdateGui(const istd::IChangeable::ChangeSet& changeSet) override;
56
57protected Q_SLOTS:
58 void OnButtonClicked(int index);
59
60private:
61 struct SelectionInfo{
62 SelectionInfo* parentInfoPtr;
63 iprm::ISelectionParam* paramPtr;
64 int index;
65 };
66
67 QList<SelectionInfo*> m_selectionInfos;
68 QList<SelectionInfo*> m_allSelectionInfos;
69
70 void CreateButtons(const iprm::ISelectionParam* paramPtr, SelectionInfo* parentSelectionInfoPtr, int& totalButtons);
71 QAbstractButton* CreateButton(QWidget* parentPtr, const QString& description);
72 void DestroyButtons();
73
74private:
75 I_REF(istdgui::IIconProvider, m_iconProviderCompPtr);
76 I_ATTR(int, m_fontSizeAttrPtr);
77 I_ATTR(int, m_iconSizeAttrPtr);
78 I_ATTR(int, m_minWidthAttrPtr);
79 I_ATTR(bool, m_showTooltipAttrPtr);
80 I_ATTR(int, m_layoutTypeAttrPtr);
81 I_ATTR(int, m_descriptionTypeAttrPtr);
82
83 QButtonGroup m_buttonsGroup;
84};
85
86
87} // namespace iprmgui
88
89
90#endif // !iqtprm_CButtonBasedSelectionParamGuiComp_included
91
92
Interface allowing to select single option from list of options.
QCommandButton-based editor for an exclusive option selection.
void UpdateGui(const istd::IChangeable::ChangeSet &changeSet) override
istdgui::TDesignerGuiObserverCompBase< Ui::CButtonBasedSelectionParamGuiComp, iprm::ISelectionParam > BaseClass
Set of change flags (its IDs).
Definition IChangeable.h:38
This interface provides acces to an icon.
Base class for all Qt GUI components.
This package contains Qt based implementations of standard parameter components.

© Witold Gantzke and Kirill Lepskiy