Compare commits

...

2 Commits

  1. 7
      gui/view/MainWindow.cpp
  2. 2
      gui/view/MainWindow.h
  3. 4
      gui/viewmodel/tree/util/Log2TreeItemConverter.cpp

7
gui/view/MainWindow.cpp

@ -11,6 +11,7 @@ MainWindow::MainWindow(QWidget* parent)
{
ui->setupUi(this);
prepareTableView();
prepareTreeView();
auto tm = new TreeModel();
tm->showSelectedLog(nullptr);
ui->treeView->setModel(tm);
@ -40,3 +41,9 @@ void MainWindow::prepareTableView()
QHeaderView::ResizeMode::ResizeToContents);
ui->tableView->horizontalHeader()->setSectionsMovable(true);
}
/*************************************************************************************************/
void MainWindow::prepareTreeView()
{
ui->treeView->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
}

2
gui/view/MainWindow.h

@ -20,6 +20,8 @@ public:
private:
void prepareTableView();
void prepareTreeView();
Ui::MainWindow* ui;
};

4
gui/viewmodel/tree/util/Log2TreeItemConverter.cpp

@ -121,13 +121,13 @@ void SimpleLog2TreeItemConverter::addJsonObject(const QJsonObject& obj, TreeItem
auto val = obj[key];
if(val.isObject())
{
auto objRoot = std::make_unique<TreeItem>(QVariantList{"[OBJ]", key});
auto objRoot = std::make_unique<TreeItem>(QVariantList{key, "[OBJ]"});
addJsonObject(val.toObject(), objRoot.get());
parent->appendChild(std::move(objRoot));
}
else if(val.isArray())
{
auto objRoot = std::make_unique<TreeItem>(QVariantList{"[ARRAY]", key});
auto objRoot = std::make_unique<TreeItem>(QVariantList{key, "[ARRAY]"});
addJsonArray(val.toArray(), objRoot.get());
parent->appendChild(std::move(objRoot));
}

Loading…
Cancel
Save