Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 128 → Rev 129

/trunk/DBViewer/database.cpp
465,11 → 465,11
 
sql_mogel->select();
 
QMap <QString, QString> pointersList = getPointersList(class_id);
QMap <QString, QString> pointersList = getPointersList(class_id); // ïîëó÷àåì ñïèñîê ïîëåé-óêàçàòåëåé
QMap <int, QString> pointersToModel;
 
QStringList pointersNames = pointersList.keys(); //
QStringList parentInctancesList = pointersList.values();
QStringList pointersNames = pointersList.keys(); //çäåñü ñïèñîê èìåí ïîëåé-óêàçàòåëåé íà ðîäèòåëüñêèå êëàññû
QStringList parentInctancesList = pointersList.values(); // çäåñü ñïèñîê ñîîòâåòñòâóþùèõ õðàíèëèù
 
for (i=0; i < pointersNames.size(); i++){
QString pointerName;
477,6 → 477,12
int pointerIndex;
pointerName = pointersNames.at(i);
pointerIndex = sql_mogel->record().indexOf(pointerName);
 
spinDelegate.setInctance(parentInctancesList.at(i));
spinDelegate.getItems();
ui->tableView->setItemDelegateForColumn(pointerIndex, &spinDelegate);
 
 
pointersToModel.insert(pointerIndex, parentInctancesList.at(i));
}
 
/trunk/DBViewer/mymodel.cpp
98,10 → 98,30
 
if (index_of_list == -1) return value;
else {
QString psrentInctance;
psrentInctance = values.at(index_of_list);
QString parentInctance;
QSqlQuery q;
QString sql_str;
bool ok;
parentInctance = values.at(index_of_list);
sql_str = tr("select * from `");
sql_str.append(parentInctance);
sql_str.append(tr("` "));
sql_str.append(tr("where `ID` = "));
sql_str.append(value.toString());
q.prepare(sql_str);
ok = q.exec();
 
if (ok) {
while(q.next()){
QString object_name = q.value(1).toString();
if (!object_name.isEmpty()) return object_name;
 
}
}
int ii;
ii++;
 
 
}
return value;
 
/trunk/DBViewer/delegate.cpp
106,6 → 106,7
 
 
// field_inctance = q.record().indexOf(tr("TableWhithInstance"));
items.clear();
while(q.next()){
 
QString ID;
/trunk/DBViewer/mymodel.h
4,6 → 4,7
#include <QObject>
#include <QtGui>
#include <QSqlQueryModel>
#include <QSqlQuery>
#include <QSqlTableModel>
#include <QMap>