93 case OBJ_Subfile: |
93 case OBJ_Subfile: |
94 { |
94 { |
95 coordCount = 3; |
95 coordCount = 3; |
96 tw_subfileList = new QTreeWidget(); |
96 tw_subfileList = new QTreeWidget(); |
97 tw_subfileList->setHeaderLabel (tr ("Primitives")); |
97 tw_subfileList->setHeaderLabel (tr ("Primitives")); |
98 PopulatePrimitives (tw_subfileList, (obj ? static_cast<LDSubfile*> (obj)->fileInfo()->name() : "")); |
98 populatePrimitivesTree (tw_subfileList, (obj ? static_cast<LDSubfile*> (obj)->fileInfo()->name() : "")); |
99 |
99 |
100 connect (tw_subfileList, SIGNAL (itemSelectionChanged()), this, SLOT (slot_subfileTypeChanged())); |
100 connect (tw_subfileList, SIGNAL (itemSelectionChanged()), this, SLOT (slot_subfileTypeChanged())); |
101 lb_subfileName = new QLabel ("File:"); |
101 lb_subfileName = new QLabel ("File:"); |
102 le_subfileName = new QLineEdit; |
102 le_subfileName = new QLineEdit; |
103 le_subfileName->setFocus(); |
103 le_subfileName->setFocus(); |
240 |
240 |
241 // ============================================================================= |
241 // ============================================================================= |
242 // ============================================================================= |
242 // ============================================================================= |
243 QString AddObjectDialog::currentSubfileName() |
243 QString AddObjectDialog::currentSubfileName() |
244 { |
244 { |
245 SubfileListItem* item = static_cast<SubfileListItem*> (tw_subfileList->currentItem()); |
245 PrimitiveTreeItem* item = static_cast<PrimitiveTreeItem*> (tw_subfileList->currentItem()); |
246 |
246 |
247 if (item->primitive() == nullptr) |
247 if (item->primitive() == nullptr) |
248 return ""; // selected a heading |
248 return ""; // selected a heading |
249 |
249 |
250 return item->primitive()->name; |
250 return item->primitive()->name; |