myShapeCol = GroupPoints->ListView1->addColumn(tr("GEOM_MATERIAL_SHAPE"));
myMaterCol = GroupPoints->ListView1->addColumn(tr("GEOM_MATERIAL_MATERIAL"));
GroupPoints->ListView1->setSelectionMode(QListView::Extended);
+ GroupPoints->ListView1->setSorting(-1);
GroupPoints->TextLabel1->setText(tr("GEOM_MATERIAL_ID"));
GroupPoints->PushButton1->setText(tr("GEOM_MATERIAL_SET"));
dynamic_cast<OperationGUI_PartitionDlg*>(myParentDlg);
if (aParentDlg)
myListMaterials = aParentDlg->GetListMaterials();
-
+
/* list filling */
MESSAGE("Filling list with " << myListShapes.length() << " objects");
QString aMaterialId;
+ QListViewItem *anItem = NULL;
for (int ind = 0; ind < myListShapes.length(); ind++) {
GEOM::GEOM_Object_var anObject = myListShapes[ind];
if (!anObject->_is_nil()) {
aMaterialId = QString::number(myListMaterials[ind]);
else
aMaterialId = "0";
- QListViewItem* aItem =
- new QListViewItem(GroupPoints->ListView1, GEOMBase::GetName( anObject ), aMaterialId);
+ if (anItem)
+ // insert after aPrevItem
+ anItem = new QListViewItem(GroupPoints->ListView1, anItem,
+ GEOMBase::GetName( anObject ), aMaterialId);
+ else
+ // the first item creation
+ anItem = new QListViewItem(GroupPoints->ListView1,
+ GEOMBase::GetName( anObject ), aMaterialId);
}
}
MESSAGE("Filled");