Редакция 105 | Редакция 107 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 105 | Редакция 106 | ||
---|---|---|---|
Строка 4... | Строка 4... | ||
4 | MainWindow::MainWindow(QWidget *parent) : |
4 | MainWindow::MainWindow(QWidget *parent) : |
5 | QMainWindow(parent), |
5 | QMainWindow(parent), |
6 | ui(new Ui::MainWindow) |
6 | ui(new Ui::MainWindow) |
7 | {
|
7 | {
|
8 | ui->setupUi(this); |
8 | ui->setupUi(this); |
9 | connect( ui->comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_currentIndexChanged(int))); |
9 | // connect( ui->comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_currentIndexChanged(int)));
|
10 | 10 | ||
11 | MainWindow::readModel(); |
11 | MainWindow::readModel(); |
12 | 12 | ||
13 | //QString model_str;
|
13 | //QString model_str;
|
14 | MainWindow::creatModelString(); |
14 | MainWindow::creatModelString(); |
Строка 293... | Строка 293... | ||
293 | //ui->treeWidget->clear();
|
293 | //ui->treeWidget->clear();
|
294 | 294 | ||
295 | root_class_name = MainWindow::ClassName(rootClassID); // îïðåäåëÿåì èìÿ êëàññà |
295 | root_class_name = MainWindow::ClassName(rootClassID); // îïðåäåëÿåì èìÿ êëàññà |
296 | 296 | ||
297 | rootItem1 = new QTreeWidgetItem(ui->treeWidget); |
297 | rootItem1 = new QTreeWidgetItem(ui->treeWidget); |
- | 298 | root_items_list << rootItem1; |
|
298 | rootItem1->setText(0, modelName); |
299 | rootItem1->setText(0, modelName); |
299 | 300 | ||
300 | rootItem1->setCheckState(0,Qt::Checked); |
301 | rootItem1->setCheckState(0,Qt::Checked); |
301 | rootItems.append(rootItem1); |
302 | rootItems.append(rootItem1); |
302 | 303 | ||
Строка 484... | Строка 485... | ||
484 | 485 | ||
485 | 486 | ||
486 | 487 | ||
487 | void MainWindow::initComboBox(){ |
488 | void MainWindow::initComboBox(){ |
488 | 489 | ||
489 | QMap <QString, QString> class_list_map; |
- | |
- | 490 | ||
490 | QStringList classesNameList;
|
491 | QStringList classesNameList;
|
491 | QStringList classesID_list;
|
492 | QStringList classesID_list;
|
492 | QStringList tmp_stringList;
|
493 | QStringList tmp_stringList;
|
493 | 494 | ||
494 | 495 | ||
Строка 514... | Строка 515... | ||
514 | 515 | ||
515 | 516 | ||
516 | }
|
517 | }
|
517 | 518 | ||
518 | 519 | ||
519 | void MainWindow::on_currentIndexChanged( int index ){ |
520 | void MainWindow::on_comboBox_currentIndexChanged( int index ){ |
- | 521 | QStringList classesNameList;
|
|
- | 522 | QStringList classesID_list;
|
|
520 | int i; |
523 | QString ID_str;
|
- | 524 | classesID_list = class_list_map.keys(); |
|
- | 525 | classesNameList = class_list_map.values(); |
|
521 | i = index; |
526 | ID_str = classesID_list[index]; |
522 | i++; |
527 | ui->label->setText(ID_str); |
523 | }
|
528 | }
|
524 | 529 | ||
- | 530 | void MainWindow::on_treeWidget_itemChanged ( QTreeWidgetItem * item, int column ){ |
|
- | 531 | int i; |
|
- | 532 | i++; |
|
- | 533 | ||
- | 534 | }
|
|
- | 535 | ||
- | 536 | ||
- | 537 | void MainWindow::on_treeWidget_itemClicked ( QTreeWidgetItem * item, int column ){ |
|
- | 538 | int i; |
|
- | 539 | i++; |
|
- | 540 | if (root_items_list.indexOf(item) != -1) ui->comboBox->setEnabled(true); |
|
- | 541 | ||
- | 542 | // if ((rootItem1) == (item) ) ui->comboBox->setEnabled(true);
|
|
- | 543 | else ( ui->comboBox->setEnabled(false)); |
|
- | 544 | }
|