31 #include "colors.h" |
31 #include "colors.h" |
32 #include "colorSelectDialog.h" |
32 #include "colorSelectDialog.h" |
33 #include "history.h" |
33 #include "history.h" |
34 #include "widgets.h" |
34 #include "widgets.h" |
35 #include "misc.h" |
35 #include "misc.h" |
|
36 #include "primitives.h" |
36 |
37 |
37 class SubfileListItem : public QTreeWidgetItem { |
38 class SubfileListItem : public QTreeWidgetItem { |
38 PROPERTY (PrimitiveInfo*, primInfo, setPrimInfo) |
39 PROPERTY (Primitive*, primInfo, setPrimInfo) |
39 |
40 |
40 public: |
41 public: |
41 SubfileListItem (QTreeWidgetItem* parent, PrimitiveInfo* info) : |
42 SubfileListItem (QTreeWidgetItem* parent, Primitive* info) : |
42 QTreeWidgetItem (parent), m_primInfo (info) {} |
43 QTreeWidgetItem (parent), m_primInfo (info) {} |
43 SubfileListItem (QTreeWidget* parent, PrimitiveInfo* info) : |
44 SubfileListItem (QTreeWidget* parent, Primitive* info) : |
44 QTreeWidgetItem (parent), m_primInfo (info) {} |
45 QTreeWidgetItem (parent), m_primInfo (info) {} |
45 }; |
46 }; |
46 |
47 |
47 // ============================================================================= |
48 // ============================================================================= |
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
97 tw_subfileList = new QTreeWidget (); |
98 tw_subfileList = new QTreeWidget (); |
98 SubfileListItem* parentItem = new SubfileListItem (tw_subfileList, null); |
99 SubfileListItem* parentItem = new SubfileListItem (tw_subfileList, null); |
99 parentItem->setText (0, "Primitives"); |
100 parentItem->setText (0, "Primitives"); |
100 QList<QTreeWidgetItem*> subfileItems; |
101 QList<QTreeWidgetItem*> subfileItems; |
101 |
102 |
102 for (PrimitiveInfo& info : g_Primitives) { |
103 for (Primitive& info : g_Primitives) { |
103 SubfileListItem* item = new SubfileListItem (parentItem, &info); |
104 SubfileListItem* item = new SubfileListItem (parentItem, &info); |
104 item->setText (0, fmt ("%1 - %2", info.name, info.title)); |
105 item->setText (0, fmt ("%1 - %2", info.name, info.title)); |
105 subfileItems << item; |
106 subfileItems << item; |
106 } |
107 } |
107 |
108 |