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 #include "iqtgui/CItemDelegate.h"
8 
9 // ACF-Solutions includes
11 #include "GeneratedFiles/icmpstr/ui_CMultiAttributeEditor.h"
12 
13 
14 namespace icmpstr
15 {
16 
17 
18 class CMultiAttributeEditor: public QDialog
19 {
20  Q_OBJECT
21 public:
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 
44 protected:
45  void CreateValuesTree(const QStringList& values);
46 
47 private:
48  class ValueItemDelegate: public iqtgui::CItemDelegate
49  {
50  public:
51  typedef iqtgui::CItemDelegate BaseClass;
52 
53  ValueItemDelegate(const CMultiAttributeEditor& parent);
54 
55  // reimplemented (QItemDelegate)
56  virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const;
57  virtual void setEditorData(QWidget* editor, const QModelIndex& index ) const;
58  virtual void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const;
59 
60  private:
61  const CMultiAttributeEditor& m_parent;
62  };
63 
64 
65  const CElementSelectionInfoManagerBase& m_elementSelectionInfoManager;
66  QByteArray m_attributeId;
67  int m_attributeFlags;
68 
69  Ui::CMultiAttributeEditor m_dialog;
70 
71  ValueItemDelegate m_valueItemDelegate;
72 };
73 
74 
75 } // namespace icmpstr
76 
77 
78 #endif // !icmpstr_CMultiAttributeEditor_included
79 
void CreateValuesTree(const QStringList &values)
CMultiAttributeEditor(const CElementSelectionInfoManagerBase &elementSelectionInfoManager, const QByteArray &attributeId, int attributeFlags)
QStringList GetAttributeValues() const
Get attribute values.
void SetEditorText(const QString &attributeValuesText)
Set the list of the attributes as a text object.

© 2007-2011 Witold Gantzke and Kirill Lepskiy