You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
42 lines
1.3 KiB
#include "MainWindow.h"
|
|
#include "ui_MainWindow.h"
|
|
|
|
#include "viewmodel/table/ELogColumn.h"
|
|
#include "viewmodel/tree/LogTreeModel.h"
|
|
|
|
/*************************************************************************************************/
|
|
MainWindow::MainWindow(QWidget* parent)
|
|
: QMainWindow(parent)
|
|
, ui(new Ui::MainWindow)
|
|
{
|
|
ui->setupUi(this);
|
|
prepareTableView();
|
|
auto tm = new TreeModel();
|
|
tm->showSelectedLog(nullptr);
|
|
ui->treeView->setModel(tm);
|
|
}
|
|
|
|
/*************************************************************************************************/
|
|
MainWindow::~MainWindow()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
/*************************************************************************************************/
|
|
void MainWindow::setTable(QAbstractTableModel* model)
|
|
{
|
|
ui->tableView->setModel(model);
|
|
|
|
//ui->tableView->setColumnHidden(ELogColumn::id, true);
|
|
//ui->tableView->setColumnHidden(ELogColumn::scope, true);
|
|
//ui->tableView->setColumnHidden(ELogColumn::lineno, true);
|
|
}
|
|
|
|
/*************************************************************************************************/
|
|
void MainWindow::prepareTableView()
|
|
{
|
|
ui->tableView->verticalHeader()->setVisible(false);
|
|
ui->tableView->horizontalHeader()->setSectionResizeMode(
|
|
QHeaderView::ResizeMode::ResizeToContents);
|
|
ui->tableView->horizontalHeader()->setSectionsMovable(true);
|
|
}
|
|
|