508,10 → 508,6 |
pointersList = getPointersList(class_id); // ïîëó÷àåì ñïèñîê ïîëåé-óêàçàòåëåé |
dateFieldList = getDataFieldList(class_id); // ïîëó÷àåì ñïèñîê ïîëåé c òèïîì "DATE" |
boolFieldList = getBoolFieldList(class_id); // ïîëó÷àåì ñïèñîê ïîëåé c òèïîì "BOOL" |
icon_index = getIconFieldIndex(inctance); // |
if (icon_index != -1) ui->tableView->setItemDelegateForColumn(icon_index, iconDelegate); |
sql_mogel->setIconIndex(icon_index); |
|
QMap <int, QString> pointersToModel; |
|
|
607,14 → 603,11 |
connect(sql_mogel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(on_sql_mogel_dataChanged(QModelIndex,QModelIndex))); |
|
ui->tableView->setModel(sql_mogel); |
|
ui->tableView->resizeColumnsToContents(); |
ui->tableView->hideColumn(0); |
ui->tableView->resizeColumnsToContents(); |
ui->tableView->resizeRowsToContents(); |
|
|
|
|
|
} |
|
} |
740,12 → 733,6 |
void MainWindow::on_sql_mogel_dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ){ // èçìåíèëè ñâîéñòâà îáúåêòà èëè äîáàâèëè íîâûé îáúåêò |
int i; |
i++; |
|
if (sql_mogel->iconIndex() !=-1) { |
ui->tableView->resizeColumnsToContents(); |
ui->tableView->resizeRowsToContents(); |
} |
|
if ((topLeft == bottomRight) && (boolFieldsIndexes_global.indexOf(topLeft.column()) != -1)) |
{ |
ui->pushButton_3->setEnabled(false); |
884,14 → 871,13 |
this, // Ðîäèòåëüñêèé âèäæåò. |
QObject::tr("Database Error"), // Çàãîëîâîê. |
q.lastError().text()); // Òåêñò ñîîáùåíèÿ. |
|
return -1; |
// return result_str; |
} |
|
icon_field = q.record().indexOf(tr("Icon")); |
return icon_field; |
|
|
|
} |
|
|