13 #include <QMessageBox>
15 #include <QFileDialog>
16 #include <QStringList>
17 #include <QHeaderView>
26 : QWidget(parent), model(tablemodel), proxy_model(
this)
30 proxy_model.setSourceModel(&model);
31 ui.tableView->setModel(&proxy_model);
34 ui.tableView->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
35 ui.tableView->horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
36 ui.tableView->horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
37 ui.tableView->horizontalHeader()->setSectionResizeMode(3, QHeaderView::Interactive);
38 ui.tableView->horizontalHeader()->setSectionResizeMode(4, QHeaderView::Stretch);
41 ui.tableView->verticalHeader()->setVisible(
false);
45 proxy_model.setSeverityDebugEnabled(ui.buttonEnableDebug->isChecked());
46 proxy_model.setSeverityWarningsEnabled(ui.buttonEnableWarnings->isChecked());
47 proxy_model.setSeverityErrorEnabled(ui.buttonEnableError->isChecked());
48 proxy_model.setSeverityInfoEnabled(ui.buttonEnableInfo->isChecked());
50 proxy_model.setMessageFilterEnabled(ui.checkBoxMessageFilter->isChecked());
51 proxy_model.setNodeFilterEnabled(ui.checkBoxLoggerFilter->isChecked());
52 proxy_model.setTimeFilterEnabled(
true);
63 ui.tableView->resizeColumnToContents(3);
69 ui.tableView->resizeColumnToContents(4);
74 ui.labelMessageFilter->setEnabled(checked);
75 ui.comboBoxMessageFilter->setEnabled(checked);
76 ui.lineEditMessageFilter->setEnabled(checked);
78 proxy_model.setMessageFilterEnabled(checked);
79 ui.tableView->resizeColumnToContents(4);
85 ui.tableView->resizeColumnToContents(3);
91 ui.tableView->resizeColumnToContents(3);
96 ui.labelLoggerFilter->setEnabled(checked);
97 ui.comboBoxLoggerFilter->setEnabled(checked);
98 ui.lineEditLoggerFilter->setEnabled(checked);
100 proxy_model.setNodeFilterEnabled(checked);
101 ui.tableView->resizeColumnToContents(3);
106 ui.tableView->scrollToBottom();
111 proxy_model.setSeverityDebugEnabled(checked);
112 ui.tableView->resizeColumnToContents(2);
117 proxy_model.setSeverityInfoEnabled(checked);
118 ui.tableView->resizeColumnToContents(2);
123 proxy_model.setSeverityWarningsEnabled(checked);
124 ui.tableView->resizeColumnToContents(2);
129 proxy_model.setSeverityErrorEnabled(checked);
130 ui.tableView->resizeColumnToContents(2);
135 using namespace std::chrono;
137 auto msec_since_epoch_A = duration_cast<milliseconds>(time_min.time_since_epoch());
138 auto datetimeA = QDateTime::fromMSecsSinceEpoch(msec_since_epoch_A.count());
139 ui.timeRangeMin->setDateTime(datetimeA);
143 auto msec_since_epoch_B = duration_cast<milliseconds>(time_max.time_since_epoch());
144 auto datetimeB = QDateTime::fromMSecsSinceEpoch(msec_since_epoch_B.count());
145 ui.timeRangeMax->setDateTime(datetimeB);
151 proxy_model.timeMinMaxUpdated(time_min, time_max);
152 ui.tableView->scrollToBottom();
153 ui.tableView->resizeColumnToContents(0);
154 ui.tableView->resizeColumnToContents(1);