cctw  0.2.1
cctwqtsetupcomparedialog.cpp
Go to the documentation of this file.
2 #include "ui_cctwqtsetupcomparedialog.h"
3 #include "cctwqtmainwindow.h"
4 #include <QFileDialog>
5 #include <QtConcurrentRun>
6 
8  QDialog(parent),
10  m_Window(parent),
11  m_Data(data)
12 {
13  ui->setupUi(this);
14 
15  setAttribute(Qt::WA_DeleteOnClose);
16 
17  if (m_Data) {
18  ui->m_FileName1->setText(m_Data->get_FilePath1());
19  ui->m_DatasetName1->setText(m_Data->get_Dataset1());
20 
21  ui->m_FileName2->setText(m_Data->get_FilePath2());
22  ui->m_DatasetName2->setText(m_Data->get_Dataset2());
23 
24  ui->m_CompareRigorously->setChecked(m_Data->get_CompareRigorously());
25  ui->m_CompareApproximately->setChecked(m_Data->get_CompareApproximately());
26  }
27 
28  connect(ui->m_BrowseFile1, SIGNAL(clicked()), this, SLOT(browse1()));
29  connect(ui->m_BrowseFile2, SIGNAL(clicked()), this, SLOT(browse2()));
30 }
31 
33 {
34  delete ui;
35 }
36 
38 {
39  if (m_Data) {
40  m_Data->set_FilePath1(ui->m_FileName1->text());
41  m_Data->set_Dataset1(ui->m_DatasetName1->text());
42 
43  m_Data->set_FilePath2(ui->m_FileName2->text());
44  m_Data->set_Dataset2(ui->m_DatasetName2->text());
45 
46  m_Data->set_CompareRigorously(ui->m_CompareRigorously->isChecked());
47  m_Data->set_CompareApproximately(ui->m_CompareApproximately->isChecked());
48  }
49 
50  QtConcurrent::run(m_Data, &CctwComparer::compareDatasets);
51 // QMetaObject::invokeMethod(m_Data, "compareDatasets");
52 
53  QDialog::accept();
54 }
55 
57 {
58  QString path = QFileDialog::getOpenFileName(this, "File 1", ui->m_FileName1->text());
59 
60  if (path.length() > 0) {
61  ui->m_FileName1->setText(path);
62  }
63 }
64 
66 {
67  QString path = QFileDialog::getOpenFileName(this, "File 2", ui->m_FileName2->text());
68 
69  if (path.length() > 0) {
70  ui->m_FileName2->setText(path);
71  }
72 }
CctwqtSetupCompareDialog(CctwqtMainWindow *parent, CctwComparer *data)
Ui::CctwqtSetupCompareDialog * ui
void compareDatasets()