MCPcopy Create free account
hub / github.com/bupticybee/TexasSolver / MainWindow

Method MainWindow

mainwindow.cpp:10–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8QSTextEdit* MainWindow::s_textEdit = 0;
9
10MainWindow::MainWindow(QWidget *parent) :
11 QMainWindow(parent),
12 ui(new Ui::MainWindow)
13{
14 ui->setupUi(this);
15 MainWindow::s_textEdit = this->get_logwindow();
16 connect(this->ui->actionjson, SIGNAL(triggered()), this, SLOT(on_save_json()));
17 connect(this->ui->actionSettings, SIGNAL(triggered()), this, SLOT(on_settings()));
18 connect(this->ui->actionimport, SIGNAL(triggered()), this, SLOT(on_import_params()));
19 connect(this->ui->actionexport, SIGNAL(triggered()), this, SLOT(on_export_params()));
20 connect(this->ui->actionclear_all, SIGNAL(triggered()), this, SLOT(on_clear_all()));
21 qSolverJob = new QSolverJob;
22 qSolverJob->setContext(this->getLogArea());
23 qSolverJob->current_mission = QSolverJob::MissionType::LOADING;
24 qSolverJob->start();
25 this->setWindowTitle(tr("TexasSolver"));
26
27 // parameters tree view
28 QStringList filters;
29 filters << "*.txt";
30 qFileSystemModel = new QFileSystemModel(this);
31 QDir filedir = QDir::current().filePath("parameters");
32 qFileSystemModel->setRootPath(filedir.path());
33#ifdef Q_OS_MAC
34 filedir = QDir("");
35 qFileSystemModel->setRootPath(filedir.path());
36#endif
37 qFileSystemModel->setNameFilters(filters);
38 qFileSystemModel->setFilter(QDir::AllDirs | QDir::AllEntries |QDir::NoDotAndDotDot);
39 this->ui->parametersTreeView->setModel(this->qFileSystemModel);
40 this->ui->parametersTreeView->setRootIndex(this->qFileSystemModel->index(filedir.path()));
41 for (int i=1; i<=4; i++)
42 { this->ui->parametersTreeView->hideColumn(i);}
43 connect(
44 this->ui->parametersTreeView,
45 SIGNAL(clicked(const QModelIndex&)),
46 this,
47 SLOT(item_clicked(const QModelIndex&))
48 );
49 connect(ui->parametersTreeView, SIGNAL(expanded(QModelIndex)), this, SLOT(onExpanded(QModelIndex)));
50
51 // Thumbnail process
52 this->ip_model = new RangeSelectorTableModel(QString("A,K,Q,J,T,9,8,7,6,5,4,3,2").split(","),this->ui->ipRangeText->toPlainText(),this,true);
53 this->ip_delegate = new RangeSelectorTableDelegate(QString("A,K,Q,J,T,9,8,7,6,5,4,3,2").split(","),this->ip_model,this);
54 this->ui->IpRangeTableView->setModel(this->ip_model);
55 this->ui->IpRangeTableView->setItemDelegate(this->ip_delegate);
56 this->ui->IpRangeTableView->verticalHeader()->setMinimumSectionSize(1);
57 this->ui->IpRangeTableView->horizontalHeader()->setMinimumSectionSize(1);
58
59 this->oop_model = new RangeSelectorTableModel(QString("A,K,Q,J,T,9,8,7,6,5,4,3,2").split(","),this->ui->oopRangeText->toPlainText(),this,true);
60 this->oop_delegate = new RangeSelectorTableDelegate(QString("A,K,Q,J,T,9,8,7,6,5,4,3,2").split(","),this->oop_model,this);
61 this->ui->oopRangeTableView->setModel(this->oop_model);
62 this->ui->oopRangeTableView->setItemDelegate(this->oop_delegate);
63 this->ui->oopRangeTableView->verticalHeader()->setMinimumSectionSize(1);
64 this->ui->oopRangeTableView->horizontalHeader()->setMinimumSectionSize(1);
65 this->ui->tabWidget->hide();
66}
67

Callers

nothing calls this directly

Calls 3

get_logwindowMethod · 0.95
getLogAreaMethod · 0.95
indexMethod · 0.45

Tested by

no test coverage detected