11#include <QtWidgets/QWidget>
12#include <QtWidgets/QItemDelegate>
21#include <GeneratedFiles/icmpstr/ui_CAttributeEditorComp.h>
30 istdgui::TDesignerGuiCompBase<Ui::CAttributeEditorComp>,
31 CElementSelectionInfoManagerBase>
42 I_ASSIGN(m_metaInfoManagerCompPtr,
"MetaInfoManager",
"Allows access to component meta information",
true,
"MetaInfoManager");
43 I_ASSIGN(m_attributeSelectionObserverCompPtr,
"AttributeSelectionObserver",
"Attribute selection observer",
false,
"AttributeSelectionObserver");
44 I_ASSIGN(m_quickHelpViewerCompPtr,
"QuickHelpGui",
"Shows object info during selection using its type",
false,
"QuickHelpGui");
45 I_ASSIGN(m_consistInfoCompPtr,
"ConsistencyInfo",
"Allows to check consistency of registries and attributes",
false,
"ConsistencyInfo");
46 I_ASSIGN(m_registryPropGuiCompPtr,
"RegistryPropGui",
"Display and edit registry properties if no element is selected",
false,
"RegistryPropGui");
47 I_ASSIGN_TO(m_registryPropObserverCompPtr, m_registryPropGuiCompPtr,
false);
139 const QByteArray& attributeId,
141 const QFont& normalFont,
142 const QFont& importantFont,
145 bool& hasExport)
const;
147 QTreeWidgetItem& item,
149 const QByteArray& elementId,
150 const QByteArray& interfaceName,
153 bool readOnly)
const;
165 const QByteArray& elementId,
168 QTreeWidgetItem* parentItemPtr,
171 bool includeSubelement,
174 const QByteArray& elementId,
175 const QByteArray& globalElementId,
177 QTreeWidgetItem& item,
180 bool readOnly)
const;
202 template <
class AttributeImpl>
203 static QString GetMultiAttributeValueAsString(
const AttributeImpl& attribute);
206 QWidget* createEditor(QWidget* parent,
const QStyleOptionViewItem& option,
const QModelIndex& index)
const override;
207 void setEditorData(QWidget* editor,
const QModelIndex& index)
const override;
208 void setModelData(QWidget* editor, QAbstractItemModel* model,
const QModelIndex& index)
const override;
211 bool SetComponentExportEditor(
const QByteArray& attributeId,
const QString& defaultValue, QWidget& editor)
const;
212 bool SetAttributeExportEditor(
const QByteArray&
id,
const QByteArray& exportId, QWidget& editor)
const;
213 bool SetAttributeValueEditor(
const QByteArray&
id,
int propertyMining, QWidget& editor)
const;
215 bool SetComponentValue(
const QByteArray& attributeId,
int propertyMining,
const QString& value)
const;
216 bool SetComponentExportData(
const QByteArray& attributeId,
const QString& value)
const;
236 I_REF(IAttributeSelectionObserver, m_attributeSelectionObserverCompPtr);
238 I_REF(IRegistryConsistInfo, m_consistInfoCompPtr);
242 AttributeItemDelegate m_attributeItemDelegate;
243 RegistryObserver m_registryObserver;
245 typedef QPair<QString, AttributeGroupType> TypeDescr;
246 typedef QMap<QByteArray, TypeDescr> AttributeTypesMap;
247 AttributeTypesMap m_attributeTypesMap;
251 std::unique_ptr<iwidgets::CTreeWidgetFilter> m_attributesTreeFilter;
252 std::unique_ptr<iwidgets::CTreeWidgetFilter> m_interfacesTreeFilter;
253 std::unique_ptr<iwidgets::CTreeWidgetFilter> m_subcomponentsTreeFilter;
266template <
class AttributeImpl>
267QString CAttributeEditorComp::AttributeItemDelegate::GetMultiAttributeValueAsString(
const AttributeImpl& attribute)
269 QString valuesString;
270 for (
int index = 0; index < attribute.GetValuesCount(); index++) {
271 if (!valuesString.isEmpty()) {
275 valuesString += attribute.GetValueAt(index);
void on_IsDetachedCB_toggled(bool checked)
bool ResetItem(QTreeWidgetItem &item)
void AfterInterfacesChange()
void AfterAttributesChange()
void AfterSubcomponentsChange()
void on_AutoInstanceCB_toggled(bool checked)
void UpdateInterfacesView()
static QString EncodeToEdit(const QString &text)
QMap< QByteArray, AttrInfo > ElementIdToAttrInfoMap
bool SetInterfaceToItem(QTreeWidgetItem &item, icomp::IRegistry::ExportedInterfacesMap *interfacesMapPtr, const QByteArray &elementId, const QByteArray &interfaceName, bool &hasWarning, bool &hasExport, bool readOnly) const
bool DecodeAttribute(const iser::ISerializable &attribute, QString &text, int &meaning) const
static QString DecodeFromEdit(const QString &text)
void on_AttributeTree_itemChanged(QTreeWidgetItem *item, int column)
istdgui::TGuiObserverWrap< istdgui::TDesignerGuiCompBase< Ui::CAttributeEditorComp >, CElementSelectionInfoManagerBase > BaseClass
void on_AttributeTree_itemSelectionChanged()
void UpdateSubcomponentsView()
void UpdateAttributesView()
void on_InterfacesTree_itemSelectionChanged()
void CreateInterfacesTree(const QByteArray &elementId, const icomp::IElementStaticInfo *infoPtr, icomp::IRegistry::ExportedInterfacesMap ®istryInterfaces, QTreeWidgetItem *parentItemPtr, bool &hasWarning, bool &hasExport, bool includeSubelement, bool readOnly)
const icomp::IMetaInfoManager * GetMetaInfoManagerPtr() const override
QMap< QByteArray, ElementIdToAttrInfoMap > AttrInfosMap
void OnGuiDestroyed() override
Called just before GUI is released.
const icmpstr::IRegistryConsistInfo * GetConsistencyInfoPtr() const override
void on_InterfacesTree_itemChanged(QTreeWidgetItem *item, int column)
void OnGuiModelDetached() override
bool SetAttributeToItem(AttributeGroupType groupType, int &itemIndex, const icomp::IRegistry ®istry, const QByteArray &attributeId, const ElementIdToAttrInfoMap &infos, const QFont &normalFont, const QFont &importantFont, bool &hasError, bool &hasWarning, bool &hasExport) const
void UpdateGui(const istd::IChangeable::ChangeSet &changeSet) override
void CreateExportedComponentsTree(const QByteArray &elementId, const QByteArray &globalElementId, const icomp::IElementStaticInfo *elementMetaInfoPtr, QTreeWidgetItem &item, bool &hasWarning, bool &hasExport, bool readOnly) const
void OnGuiCreated() override
Called just after GUI is initialized.
bool EncodeAttribute(const QString &text, int meaning, iser::ISerializable &result) const
Base class for all components depending of meta information in current selected registry context.
Describe component attribute static information.
This interface provide static information about component meta info.
This interface provide static information about element meta info.
Represents element of registry describing component parameters.
Interface representing information stored in component registry.
std::map< QByteArray, QByteArray > ExportedInterfacesMap
Map assigning interface ID (undecorated) to component ID exporting this interface.
Allow to show help document to specified object or text.
Basic implementation for a single model observer.
Common interface for an model editor.
Common interface for model objects, that supports Model/Observer design pattern.
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Common class for all classes which objects can be archived or restored from archive.
Set of change flags (its IDs).
Common interface for GUI objects using in component context.
Base class for all Qt GUI components, which use the Qt designer's UI.
Join functionality of istdgui::IGuiObject interface and imod::IObserver.
This package contains (Qt based) implementations of compositor components.
const icomp::IAttributeStaticInfo * staticInfoPtr
icomp::IRegistryElement * elementPtr
icomp::IRegistryElement::AttributeInfo * infoPtr
const icomp::IComponentStaticInfo * componentStaticInfoPtr
Describe information stored with each attribute.