Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 221 → Rev 222

/trunk/DBViewer/mainwindow.h
24,8 → 24,10
#include <QColor>
#include <QItemDelegate>
#include <QList>
#include <QPalette>
 
 
 
/*
#include <QSqlField>
#include <QSqlRecord>
154,7 → 156,9
QStringList getFileFieldList(QString class_id); // ïîëó÷àåì ñïèñîê âñåõ ïîëåé, â êîòîðûõ õðàíÿòüñÿ ôàéëû"
 
 
QString getFiltrString(QString model_id, QString class_id); // ïîëó÷àåì ñòðîêó-ôèëüòð äëÿ äàííîãî êëàññà äàííîé ìîäåëè
 
 
int getIconFieldIndex(QString inctance); // ïîëó÷àåì íîìåð ñòîëáöà ñ èêîíêàìè
 
SpinBoxDelegate spinDelegate;
/trunk/DBViewer/database.cpp
848,6 → 848,10
}
filter_model->submitAll();
// getDatabaseData();
model_is_build = false;
MainWindow::readModels();
model_is_build = true;
MainWindow::getDatabaseData();
 
}
 
856,6 → 860,11
filter_model->submitAll();
ui->pushButton_11->setEnabled(false);
ui->pushButton_12->setEnabled(false);
 
model_is_build = false;
MainWindow::readModels();
model_is_build = true;
MainWindow::getDatabaseData();
}
 
void MainWindow::on_pushButton_12_clicked()// íàæàòèå êíîïêè "Ñáðîñèòü èçìåíåíèÿ" (íà âêëàäêå ôèëüòðîâ)
1229,6 → 1238,7
 
 
rootItems.clear();
root_items_list.clear();
ui->treeWidget->clear();
for (int i=0; i < row; i++){
QTreeWidgetItem * item_tmp;
1369,3 → 1379,57
}
return result_map;
}
 
 
 
 
QString MainWindow::getFiltrString(QString model_id, QString class_id){ // ïîëó÷àåì ñòðîêó-ôèëüòð äëÿ äàííîãî êëàññà äàííîé ìîäåëè
 
QSqlQuery q;
QString sql_str;
QString result_str;
sql_str = tr("select * from `Filters` where `Filters`.`Model_ID` = '");
sql_str.append(model_id);
sql_str.append(tr("' and `Filters`.`Class_ID` = '"));
sql_str.append(class_id);
sql_str.append(tr("' order by `Filters`.`ID`"));
bool ok;
ok = q.prepare(sql_str);
ok = q.exec();
 
if (!ok) {
QMessageBox::critical( // Äèàëîã ñ ñîîáùåíèåì îá îøèáêå.
this, // Ðîäèòåëüñêèé âèäæåò.
QObject::tr("Database Error"), // Çàãîëîâîê.
q.lastError().text()); // Òåêñò ñîîáùåíèÿ.
return result_str;
}
result_str.clear();
while(q.next()){
QString Condition, FieldName, ConditionalSymbol, ValueForComparison, PostCondition;
Condition = q.record().value(3).toString();
FieldName = q.record().value(4).toString();
ConditionalSymbol = q.record().value(5).toString();
ValueForComparison = q.record().value(6).toString();
PostCondition = q.record().value(7).toString();
 
 
result_str.append(Condition);
result_str.append(tr(" "));
result_str.append(FieldName);
result_str.append(tr(" "));
result_str.append(ConditionalSymbol);
result_str.append(tr(" "));
result_str.append(ValueForComparison);
result_str.append(tr(" "));
result_str.append(PostCondition);
 
 
}
 
 
return result_str;
 
}
 
 
/trunk/DBViewer/mainwindow.cpp
6,6 → 6,13
ui(new Ui::MainWindow)
{
ui->setupUi(this);
/*
QPalette p = this->palette();
p.setBrush(this->backgroundRole(), QBrush(QColor(255,255,255,128)));
this->setAutoFillBackground(true);
this->setPalette(p);
*/
 
ui->centralWidget->setLayout(ui->verticalLayout);
ui->tab->setLayout(ui->horizontalLayout);
ui->tab_2->setLayout(ui->horizontalLayout_3);
224,6 → 231,7
if (columnData.count()>2)
{
QString class_id;
QString filtr_str;
QPixmap pxmp;
QIcon icon;
class_id = QString(columnData.at(2).toString());
235,8 → 243,9
itm_tmp->setText(2, QVariant(number).toString()); // íîìåð ñòðîêè â ôàéëå-ìîäåëè îòîáðàæåíèÿ
itm_tmp->setText(3, QVariant(indentations.size()).toString()); // óðîâåíü âëîæåíèÿ
itm_tmp->setText(4, QVariant(row).toString()); // íîìåð ñòðîêè â ôàéëå
filtr_str = getFiltrString(model_id,class_id);
itm_tmp->setText(5,filtr_str);
 
 
if (!pxmp.isNull())
{
icon.addPixmap(pxmp);
949,7 → 958,7
 
model_for_ListModelsTable->select();
 
 
/*
ui->treeWidget->hideColumn(1);
ui->treeWidget->hideColumn(2);
ui->treeWidget->hideColumn(3);
956,7 → 965,7
ui->treeWidget->hideColumn(4);
// ui->treeWidget->hideColumn(5);
ui->treeWidget->hideColumn(6);
 
*/
ui->tableView_2->hideColumn(0);
ui->tableView_2->hideColumn(2);
ui->tableView_2->hideColumn(3);