src/addObjectDialog.cpp

changeset 295
a91fa09d686c
parent 293
a0ed563e14b2
child 306
fef00a6cbff0
equal deleted inserted replaced
294:2892deee4c1b 295:a91fa09d686c
105 105
106 for (Primitive& prim : cat.prims) { 106 for (Primitive& prim : cat.prims) {
107 SubfileListItem* item = new SubfileListItem (parentItem, &prim); 107 SubfileListItem* item = new SubfileListItem (parentItem, &prim);
108 item->setText (0, fmt ("%1 - %2", prim.name, prim.title)); 108 item->setText (0, fmt ("%1 - %2", prim.name, prim.title));
109 subfileItems << item; 109 subfileItems << item;
110
111 // If this primitive is the one the current object points to,
112 // select it by default
113 if (obj && static_cast<LDSubfile*> (obj)->fileInfo ()->name () == prim.name)
114 tw_subfileList->setCurrentItem (item);
110 } 115 }
111 116
112 tw_subfileList->addTopLevelItem (parentItem); 117 tw_subfileList->addTopLevelItem (parentItem);
113 } 118 }
114 119

mercurial