Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 189 → Rev 188

/trunk/DBViewer/database.cpp
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;
 
 
 
}
 
 
/trunk/DBViewer/dbviewer.qrc
1,7 → 1,5
<RCC>
<qresource prefix="/">
<file>model.txt</file>
<file>Open.png</file>
<file>Delete.png</file>
</qresource>
</RCC>
/trunk/DBViewer/mymodel.h
19,7 → 19,7
QMap <int, QString> pointers(){return pointers_map;}
void setBooleansList(QList <int> newBoolList){bolleans_list = newBoolList;}
void setIconIndex(int new_index){icon_index = new_index;}
int iconIndex(){return icon_index;}
int IconIndex(){return icon_index;}
 
private:
QMap <int, QString> pointers_map; // â ýòîì ñâÿçàííîì ñïèñêå áóäåõ õðàíèòü â êà÷åñòâå êëþ÷à íîìåðÿ ñòîëáöîâ ñ óêàçàòåëÿìè
/trunk/DBViewer/mainwindow.cpp
90,7 → 90,6
// connect(ui->tableView_2,SIGNAL(activated(QModelIndex)),ui->tableView_2,SLOT(edit(QModelIndex)));
 
picture_delegate = new CPictureDelegate(this);
iconDelegate = new IconDelegate(this);
 
}
 
/trunk/DBViewer/mainwindow.h
144,7 → 144,6
SpinBoxDelegate spinDelegate;
QItemDelegate standart_delegate;
CPictureDelegate * picture_delegate;
IconDelegate * iconDelegate;
bool comboBox_slot_enable; // äëÿ áëîêèðîâêè ñëîòà, êîãäà ìåíÿåì item_index èç ïðîãðàììû, à íå âðó÷íóþ
QList <int> boolFieldsIndexes_global; // ñïèñîê íîìåðîâ ñòîëáöîâ ñ òèïîì "BOOL"