CMultiAttributeEditor.h
Go to the documentation of this file.
1 #ifndef icmpstr_CMultiAttributeEditor_included
2 #define icmpstr_CMultiAttributeEditor_included
3 
4 
5 // ACF includes
7 
8 // ACF-Solutions includes
10 #include <GeneratedFiles/icmpstr/ui_CMultiAttributeEditor.h>
11 
12 
13 namespace icmpstr
14 {
15 
16 
17 class CMultiAttributeEditor: public QDialog
18 {
19  Q_OBJECT
20 public:
22  QWidget* parentPtr,
23  const CElementSelectionInfoManagerBase& elementSelectionInfoManager,
24  const QByteArray& attributeId,
25  int attributeFlags);
26 
30  void SetEditorText(const QString& attributeValuesText);
31 
35  QStringList GetAttributeValues() const;
36 
37 protected Q_SLOTS:
38  void OnItemAdd();
39  void OnItemRemove();
40  void OnItemMoveUp();
41  void OnItemMoveDown();
42  void UpdateButtonStates();
43  void OnItemChanged(QListWidgetItem* itemPtr);
44 
45 protected:
46  void CreateValuesTree(const QStringList& values);
47  void UpdateItemState(QListWidgetItem& item);
48 
49 private:
50  class ValueItemDelegate: public iwidgets::CItemDelegate
51  {
52  public:
53  typedef iwidgets::CItemDelegate BaseClass;
54 
55  ValueItemDelegate(const CMultiAttributeEditor& parent);
56 
57  // reimplemented (QItemDelegate)
58  virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
59  virtual void setEditorData(QWidget* editor, const QModelIndex& index ) const;
60  virtual void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
61 
62  private:
63  const CMultiAttributeEditor& m_parent;
64  };
65 
66 
67  const CElementSelectionInfoManagerBase& m_elementSelectionInfoManager;
68  QByteArray m_attributeId;
69  int m_attributeFlags;
70 
71  Ui::CMultiAttributeEditor m_dialog;
72 
73  ValueItemDelegate m_valueItemDelegate;
74 };
75 
76 
77 } // namespace icmpstr
78 
79 
80 #endif // !icmpstr_CMultiAttributeEditor_included
81 
Base class for all components depending of meta information in current selected registry context...
void CreateValuesTree(const QStringList &values)
CMultiAttributeEditor(QWidget *parentPtr, const CElementSelectionInfoManagerBase &elementSelectionInfoManager, const QByteArray &attributeId, int attributeFlags)
QStringList GetAttributeValues() const
Get attribute values.
void UpdateItemState(QListWidgetItem &item)
void OnItemChanged(QListWidgetItem *itemPtr)
void SetEditorText(const QString &attributeValuesText)
Set the list of the attributes as a text object.

© 2007-2017 Witold Gantzke and Kirill Lepskiy