Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 144 → Rev 145

/trunk/DBViewer/database.cpp
8,6 → 8,8
 
if (rootItems.isEmpty()) return;
 
ui->treeWidget_2->clear();
 
list_count = rootItems.count();
 
for (int i=0; i < list_count; i++){
32,7 → 34,7
model_name = model_item->text(0);
if (model_item->checkState(0) == false) return;
 
ui->treeWidget_2->clear();
//ui->treeWidget_2->clear();
//font.setWeight(20);
font.setItalic(true);
item = new QTreeWidgetItem (ui->treeWidget_2);
39,6 → 41,8
item->setFont(0, font);
item->setText(0, model_name);
item->setTextColor(0, Qt::darkGreen);
root_items_list << item; // çàíîñèì â ñïèñîê êîðíåâûõ èòåìîâ
 
if (!(model_item->childCount() > 0)) return;
 
rootClassID = model_item->child(0)->text(1);
515,6 → 519,7
colomns_indexes.append(pointerIndex); // çàïîìíèì íîìåð ñòîëáöà ñ íåñòàíäàðòíûì äåëåãàòîì
spinDelegate.setInctance(parentInctancesList.at(i)); // äåëåãàòó ïåðåäàåì èìÿ õðàíèëèùà îáúåêòîâ ðîäèòåëüñêîãî êëàññà
spinDelegate.getItems(); // ïðîñèì äåëåãàòà ñîñòàâèòü ñïèñîê îáúåêòîâ â õðàíèëèùå
 
ui->tableView->setItemDelegateForColumn(pointerIndex, &spinDelegate); // è ïðèñâàèâàåì åãî ñîîòâåòñòâóþùåìó ñòîëáöó íàøåé òàáëèöû
 
 
801,12 → 806,14
 
 
void MainWindow::readModels(){
int row = model_for_ListModelsTable->rowCount();
// rootItems.clear();
 
int row = model_for_ListModelsTable->rowCount();
rootItems.clear();
ui->treeWidget->clear();
for (int i=0; i < row; i++){
QTreeWidgetItem * item_tmp;
QString modelName;
QString modelString;
bool enabled;
modelName = model_for_ListModelsTable->data(model_for_ListModelsTable->index(i, 1)).toString();
enabled = model_for_ListModelsTable->data(model_for_ListModelsTable->index(i, 3)).toBool();
814,8 → 821,13
item_tmp->setText(0, modelName);
if (enabled) item_tmp->setCheckState(0,Qt::Checked);
else item_tmp->setCheckState(0,Qt::Unchecked);
 
root_items_list << item_tmp;
 
rootItems.append(item_tmp);
modelString = model_for_ListModelsTable->data(model_for_ListModelsTable->index(i, 2)).toString();
if (modelString.isEmpty()) continue;
else setupModelData(modelString.split(QString("\n")), item_tmp); // ñòðîèì ìîäåëü
 
 
}
}