Subversion Repositories OpenInventory

Compare Revisions

Ignore whitespace Rev 105 → Rev 106

/trunk/DBViewer/mainwindow.ui
78,6 → 78,19
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>420</x>
<y>480</y>
<width>78</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>ID</string>
</property>
</widget>
</widget>
</widget>
</widget>
/trunk/DBViewer/mainwindow.cpp
6,7 → 6,7
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect( ui->comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_currentIndexChanged(int)));
// connect( ui->comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_currentIndexChanged(int)));
 
MainWindow::readModel();
 
295,6 → 295,7
root_class_name = MainWindow::ClassName(rootClassID); // îïðåäåëÿåì èìÿ êëàññà
 
rootItem1 = new QTreeWidgetItem(ui->treeWidget);
root_items_list << rootItem1;
rootItem1->setText(0, modelName);
 
rootItem1->setCheckState(0,Qt::Checked);
486,7 → 487,7
 
void MainWindow::initComboBox(){
 
QMap <QString, QString> class_list_map;
 
QStringList classesNameList;
QStringList classesID_list;
QStringList tmp_stringList;
516,9 → 517,28
}
 
 
void MainWindow::on_currentIndexChanged( int index ){
int i;
i = index;
i++;
void MainWindow::on_comboBox_currentIndexChanged( int index ){
QStringList classesNameList;
QStringList classesID_list;
QString ID_str;
classesID_list = class_list_map.keys();
classesNameList = class_list_map.values();
ID_str = classesID_list[index];
ui->label->setText(ID_str);
}
 
void MainWindow::on_treeWidget_itemChanged ( QTreeWidgetItem * item, int column ){
int i;
i++;
 
}
 
 
void MainWindow::on_treeWidget_itemClicked ( QTreeWidgetItem * item, int column ){
int i;
i++;
if (root_items_list.indexOf(item) != -1) ui->comboBox->setEnabled(true);
 
// if ((rootItem1) == (item) ) ui->comboBox->setEnabled(true);
else ( ui->comboBox->setEnabled(false));
}
/trunk/DBViewer/mainwindow.h
53,6 → 53,7
private:
Ui::MainWindow *ui;
 
QList<QTreeWidgetItem *> root_items_list;
QStandardItemModel *model;
QStandardItem *item;
QTreeWidgetItem *rootItem1, *rootItem2;
73,10 → 74,13
QMap <QString, QString> getClassList(); // ïîëó÷àåì ñïèñîê êëàññîâ
void initComboBox();
QList<QTreeWidgetItem *> rootItems; // ñïèñîê óêàçàòåëåé êîðíåâûõ óçëîâ (ìîäåëåé)
private slots:
void on_currentIndexChanged( int index );
QMap <QString, QString> class_list_map;
 
 
private slots:
void on_comboBox_currentIndexChanged( int index );
void on_treeWidget_itemChanged ( QTreeWidgetItem * item, int column );
void on_treeWidget_itemClicked ( QTreeWidgetItem * item, int column );
};