/trunk/DBViewer/mainwindow.cpp |
---|
21,8 → 21,10 |
out << MainWindow::modelString; |
file_tmp.close(); |
ui->treeWidget->setAlternatingRowColors(true); |
ui->treeWidget_2->setAlternatingRowColors(true); |
MainWindow::openDataBase(); |
MainWindow::buildPreviewModel(tr("Ìîÿ ìîäåëü"), tr("46")); |
MainWindow::buildPreviewModel(tr("Ìîÿ ìîäåëü"), tr("7")); |
MainWindow::initComboBox(); |
getDatabaseData(); |
/trunk/DBViewer/mainwindow.h |
---|
15,6 → 15,7 |
#include <QString> |
#include <QtSql> |
#include <QFont> |
#include <QColor> |
/* |
/trunk/DBViewer/database.cpp |
---|
32,11 → 32,12 |
model_name = model_item->text(0); |
if (model_item->checkState(0) == false) return; |
font.setWeight(20); |
//font.setWeight(20); |
font.setItalic(true); |
item = new QTreeWidgetItem (ui->treeWidget_2); |
item->setFont(0, font); |
item->setText(0, model_name); |
item->setTextColor(0, Qt::darkGreen); |
rootClassID = model_item->child(0)->text(1); |
195,17 → 196,20 |
QString str_tmp; |
QTreeWidgetItem * title_item; |
QFont font; |
font.setWeight(40); |
font.setBold(true);; |
// font.setWeight(40); |
font.setBold(true); |
filtr_empty = filtr.isEmpty(); |
classID = model_item->text(1); |
className = model_item->text(0); |
inctance = getClassInctance(classID); |
/* |
title_item = new QTreeWidgetItem(parent_object_item); |
title_item->setFont(0, font); |
title_item->setText(0, className); |
*/ |
title_item->setText(1, tr("class")); |
title_item->setText(2, classID); |
title_item->setTextColor(0, Qt::darkBlue); |
sql_str = tr("select * " |
" from " //íàõîäèì âñå îáúåêòû êëàññà â òàáëèöå - õðàíèëèùå îáúåêòîâ êëàññà |
); |
227,12 → 231,14 |
} |
field_ID = q.record().indexOf(tr("ID")); |
/* |
if (q.size() <= 0) return; |
title_item = new QTreeWidgetItem(parent_object_item); |
title_item->setFont(0, font); |
title_item->setText(0, className); |
*/ |
while(q.next()){ |
if (q.record().count() > 1) |
{ |
244,7 → 250,8 |
// itm = new QTreeWidgetItem(parent_object_item); // äîáàâëÿåì â äåðåâî óçåë, ñîîòâåòñòâóþùèé îáúåêòó |
itm = new QTreeWidgetItem(title_item); // äîáàâëÿåì â äåðåâî óçåë, ñîîòâåòñòâóþùèé îáúåêòó |
itm->setText(0, value_tmp); |
itm->setText(1, tr("object")); |
itm->setText(2, ID_tmp); |
for (int i=0; i < model_item->childCount(); i++) // ïðîâåðÿåì, åñòü ëè ó êëàññà äî÷åðíèå êëàññû |
{ |
QTreeWidgetItem * model_item_tmp; // åñëè åñòü |
/trunk/DBViewer/mainwindow.ui |
---|
6,8 → 6,8 |
<rect> |
<x>0</x> |
<y>0</y> |
<width>770</width> |
<height>709</height> |
<width>1098</width> |
<height>697</height> |
</rect> |
</property> |
<property name="windowTitle"> |
19,12 → 19,12 |
<rect> |
<x>20</x> |
<y>10</y> |
<width>731</width> |
<width>521</width> |
<height>591</height> |
</rect> |
</property> |
<property name="currentIndex"> |
<number>1</number> |
<number>0</number> |
</property> |
<widget class="QWidget" name="tab"> |
<attribute name="title"> |
44,6 → 44,16 |
<string notr="true">1</string> |
</property> |
</column> |
<column> |
<property name="text"> |
<string>Тип узла</string> |
</property> |
</column> |
<column> |
<property name="text"> |
<string>ID</string> |
</property> |
</column> |
</widget> |
</widget> |
<widget class="QWidget" name="tab_2"> |
111,6 → 121,29 |
</widget> |
</widget> |
</widget> |
<widget class="QTabWidget" name="tabWidget_2"> |
<property name="geometry"> |
<rect> |
<x>580</x> |
<y>10</y> |
<width>501</width> |
<height>591</height> |
</rect> |
</property> |
<property name="currentIndex"> |
<number>0</number> |
</property> |
<widget class="QWidget" name="tab_3"> |
<attribute name="title"> |
<string>Tab 1</string> |
</attribute> |
</widget> |
<widget class="QWidget" name="tab_4"> |
<attribute name="title"> |
<string>Tab 2</string> |
</attribute> |
</widget> |
</widget> |
</widget> |
<widget class="QMenuBar" name="menuBar"> |
<property name="geometry"> |
117,7 → 150,7 |
<rect> |
<x>0</x> |
<y>0</y> |
<width>770</width> |
<width>1098</width> |
<height>27</height> |
</rect> |
</property> |