ACF $AcfVersion:0$
CExtParamsManagerGuiComp.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
8#if QT_VERSION >= 0x050000
9#include <QtWidgets/QMenu>
10#include <QtWidgets/QStyledItemDelegate>
11#include <QtWidgets/QDialog>
12#else
13#include <QtGui/QMenu>
14#include <QtGui/QStyledItemDelegate>
15#include <QtGui/QPainter>
16#include <QtGui/QDialog>
17#endif
18
19// ACF includes
21#include <iprm/IParamsManager.h>
23#include <GeneratedFiles/iqtprm/ui_CExtParamsManagerGuiComp.h>
24#include <GeneratedFiles/iqtprm/ui_CElementEditorGui.h>
25
26
27namespace iqtprm
28{
29
30
38 Ui::CExtParamsManagerGuiComp, iprm::IParamsManager>
39{
40 Q_OBJECT
41public:
43 Ui::CExtParamsManagerGuiComp, iprm::IParamsManager> BaseClass;
44
45 I_BEGIN_COMPONENT(CExtParamsManagerGuiComp);
46 I_ASSIGN_MULTI_0(m_parameterEditorIdsAttrPtr, "ParameterEditorIds", "List of parameter editors type IDs used for showing the job's parameter for the corresponding worker types", false);
47 I_ASSIGN_MULTI_0(m_parameterGuisCompPtr, "ParameterEditors", "List of parameter editors used for showing the job's parameter for the corresponding worker types", false);
48 I_ASSIGN_TO(m_parameterObserversCompPtr, m_parameterGuisCompPtr, true);
49 I_ASSIGN_TO(m_parameterEditorsCompPtr, m_parameterGuisCompPtr, true);
50 I_END_COMPONENT;
51
52protected:
53 int GetParameterTypeIndexById(const QByteArray& parameterTypeId) const;
55
56 // reimplemented (iqtgui::TGuiObserverWrap)
57 virtual void UpdateGui(const istd::IChangeable::ChangeSet& changeSet) override;
58
59 // reimplemented (iqtgui::CGuiComponentBase)
60 virtual void OnGuiCreated() override;
61
62protected Q_SLOTS:
68 void on_ElementList_doubleClicked(const QModelIndex &index);
70
71protected:
72
77 {
81 DR_DESCRIPTION = Qt::UserRole + 1,
82
87
92
97 };
98
102 class CElementItemDelegate: public QStyledItemDelegate
103 {
104 public:
105 // reimplemented (QItemDelegate)
106 virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
107 virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
108 };
109
114 class CElementEditorDialog: public QDialog
115 {
116 public:
119
123 int Execute(QString &name, QString &description, iqtgui::IGuiObject* paramsGuiPtr);
124
125 private:
126 Ui::CElementEditorGui m_ui;
127
128 iqtgui::IGuiObject* m_guiObjectPtr;
129 };
130
146
150 typedef QMap<QByteArray, ParameterEditor> ParameterEditorMap;
152
156 I_MULTIATTR(QByteArray, m_parameterEditorIdsAttrPtr);
157
161 I_MULTIREF(iqtgui::IGuiObject, m_parameterGuisCompPtr);
162 I_MULTIREF(imod::IObserver, m_parameterObserversCompPtr);
163 I_MULTIREF(imod::IModelEditor, m_parameterEditorsCompPtr);
164
166};
167
168
169} // namespace iqtprm
170
171
172
173
Common interface for an model editor.
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition IObserver.h:156
Manager of parameter sets.
Common interface for GUI objects used in ACF component context.
Definition IGuiObject.h:133
Base class for all Qt GUI components.
Edit dialog for the parameter set name and description.
int Execute(QString &name, QString &description, iqtgui::IGuiObject *paramsGuiPtr)
Start the dialog with the predefined name and description parameters.
Delegate implementation for customization of the parameter set item view in the parameter set list.
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
UI manager of the parameter sets.
virtual void UpdateGui(const istd::IChangeable::ChangeSet &changeSet) override
QMap< QByteArray, ParameterEditor > ParameterEditorMap
Mapping between the parameter type ID and corresponding editor.
int GetParameterTypeIndexById(const QByteArray &parameterTypeId) const
DataRoles
Data roles used in the list view items.
@ DR_DESCRIPTION
Parameter set description.
@ DR_INDEX
Index of the parameter set in the list.
iqtgui::TDesignerGuiObserverCompBase< Ui::CExtParamsManagerGuiComp, iprm::IParamsManager > BaseClass
virtual void OnGuiCreated() override
void on_ElementList_doubleClicked(const QModelIndex &index)
Set of change flags (its IDs).
Definition IChangeable.h:36
#define NULL
Definition istd.h:74
This package contains Qt based implementations of standard parameter components.
Internal structure used for binding of model editor, observer and gui editor for the parameter set in...