0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-27 16:51:22 +08:00

(profiler_gui) Save and restore windowState of EasyMainWindow;

(profiler_gui) Block descriptors list: added search box, search matches coloring, context menu event;
This commit is contained in:
Victor Zarubkin 2016-09-17 18:43:06 +03:00
parent ef7469a880
commit 08a9cbf75d
4 changed files with 511 additions and 80 deletions

View File

@ -5,7 +5,7 @@
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains implementation of EasyDescWidget and it's auxiliary classes
* description : The file contains implementation of EasyDescTreeWidget and it's auxiliary classes
* : for displyaing EasyProfiler blocks descriptors tree.
* ----------------- :
* change log : * 2016/09/17 Victor Zarubkin: initial commit.
@ -34,9 +34,14 @@
#include <QHeaderView>
#include <QString>
#include <QContextMenuEvent>
#include <QKeyEvent>
#include <QSignalBlocker>
#include <QSettings>
#include <QDebug>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <thread>
#include "descriptors_tree_widget.h"
#include "globals.h"
@ -98,8 +103,11 @@ bool EasyDescWidgetItem::operator < (const Parent& _other) const
//////////////////////////////////////////////////////////////////////////
EasyDescWidget::EasyDescWidget(QWidget* _parent)
EasyDescTreeWidget::EasyDescTreeWidget(QWidget* _parent)
: Parent(_parent)
, m_lastFound(nullptr)
, m_searchColumn(DESC_COL_NAME)
, m_bLocked(false)
{
setAutoFillBackground(false);
setAlternatingRowColors(true);
@ -115,24 +123,85 @@ EasyDescWidget::EasyDescWidget(QWidget* _parent)
setHeaderItem(header_item);
connect(&EASY_GLOBALS.events, &::profiler_gui::EasyGlobalSignals::selectedBlockChanged, this, &This::onSelectedBlockChange);
connect(&EASY_GLOBALS.events, &::profiler_gui::EasyGlobalSignals::enableStatusChanged, this, &This::onEnableStatusChange);
connect(this, &Parent::itemExpanded, this, &This::onItemExpand);
connect(this, &Parent::itemDoubleClicked, this, &This::onDoubleClick);
connect(this, &Parent::currentItemChanged, this, &This::onCurrentItemChange);
loadSettings();
}
EasyDescWidget::~EasyDescWidget()
EasyDescTreeWidget::~EasyDescTreeWidget()
{
saveSettings();
}
//////////////////////////////////////////////////////////////////////////
void EasyDescWidget::clearSilent(bool)
void EasyDescTreeWidget::contextMenuEvent(QContextMenuEvent* _event)
{
_event->accept();
QMenu menu;
auto action = menu.addAction("Expand all");
SET_ICON(action, ":/Expand");
connect(action, &QAction::triggered, this, &This::expandAll);
action = menu.addAction("Collapse all");
SET_ICON(action, ":/Collapse");
connect(action, &QAction::triggered, this, &This::collapseAll);
menu.addSeparator();
auto submenu = menu.addMenu("Search by");
auto header_item = headerItem();
for (int i = 0; i < DESC_COL_STATUS; ++i)
{
action = new QAction(header_item->text(i), nullptr);
action->setCheckable(true);
if (i == m_searchColumn)
action->setChecked(true);
connect(action, &QAction::triggered, this, &This::onSearchColumnChange);
submenu->addAction(action);
}
menu.exec(QCursor::pos());
}
void EasyDescTreeWidget::onSearchColumnChange(bool)
{
auto action = qobject_cast<QAction*>(sender());
if (action != nullptr)
m_searchColumn = action->data().toInt();
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::keyPressEvent(QKeyEvent* _event)
{
Parent::keyPressEvent(_event);
if (_event->key() == Qt::Key_F3)
{
if (_event->modifiers() & Qt::ShiftModifier)
findPrev(m_lastSearch);
else
findNext(m_lastSearch);
}
_event->accept();
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::clearSilent(bool)
{
const QSignalBlocker b(this);
setSortingEnabled(false);
m_lastFound = nullptr;
m_lastSearch.clear();
m_items.clear();
::std::vector<QTreeWidgetItem*> topLevelItems;
topLevelItems.reserve(topLevelItemCount());
@ -157,21 +226,24 @@ void EasyDescWidget::clearSilent(bool)
struct FileItems
{
typedef ::std::unordered_map<int, QTreeWidgetItem*, ::profiler_gui::do_no_hash<int>::hasher_t> Items;
typedef ::std::unordered_map<int, EasyDescWidgetItem*, ::profiler_gui::do_no_hash<int>::hasher_t> Items;
Items children;
QTreeWidgetItem* item = nullptr;
};
void EasyDescWidget::build()
void EasyDescTreeWidget::build()
{
clearSilent(false);
auto f = header()->font();
auto f = font();
f.setBold(true);
typedef ::std::unordered_map<::std::string, FileItems> Files;
Files m_files;
m_items.resize(EASY_GLOBALS.descriptors.size());
memset(m_items.data(), 0, sizeof(void*) * m_items.size());
const QSignalBlocker b(this);
::profiler::block_id_t id = 0;
for (auto desc : EASY_GLOBALS.descriptors)
@ -191,7 +263,6 @@ void EasyDescWidget::build()
auto item = new EasyDescWidgetItem(id, p.item);
item->setText(DESC_COL_FILE_LINE, QString::number(desc->line()));
item->setData(DESC_COL_FILE_LINE, Qt::UserRole, desc->line());
if (*desc->name() != 0)
item->setText(DESC_COL_NAME, desc->name());
item->setFont(DESC_COL_STATUS, f);
@ -209,6 +280,12 @@ void EasyDescWidget::build()
}
item->setForeground(DESC_COL_STATUS, brush);
m_items[id] = item;
}
else
{
m_items[id] = it->second;
}
}
@ -227,14 +304,14 @@ void EasyDescWidget::build()
//////////////////////////////////////////////////////////////////////////
void EasyDescWidget::onItemExpand(QTreeWidgetItem*)
void EasyDescTreeWidget::onItemExpand(QTreeWidgetItem*)
{
resizeColumnsToContents();
}
//////////////////////////////////////////////////////////////////////////
void EasyDescWidget::onDoubleClick(QTreeWidgetItem* _item, int _column)
void EasyDescTreeWidget::onDoubleClick(QTreeWidgetItem* _item, int _column)
{
if (_column >= DESC_COL_NAME && _item->parent() != nullptr)
{
@ -256,54 +333,305 @@ void EasyDescWidget::onDoubleClick(QTreeWidgetItem* _item, int _column)
}
item->setForeground(DESC_COL_STATUS, brush);
m_bLocked = true;
emit EASY_GLOBALS.events.enableStatusChanged(item->desc(), desc.enabled());
m_bLocked = false;
}
}
//////////////////////////////////////////////////////////////////////////
void EasyDescWidget::resizeColumnsToContents()
void EasyDescTreeWidget::onCurrentItemChange(QTreeWidgetItem* _item, QTreeWidgetItem* _prev)
{
if (_prev != nullptr)
{
auto f = font();
for (int i = 0; i < DESC_COL_STATUS; ++i)
_prev->setFont(i, f);
}
if (_item != nullptr)
{
auto f = font();
f.setBold(true);
for (int i = 0; i < DESC_COL_STATUS; ++i)
_item->setFont(i, f);
}
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::onEnableStatusChange(::profiler::block_id_t _id, bool _enabled)
{
if (m_bLocked)
return;
auto item = m_items[_id];
if (item == nullptr)
return;
QBrush brush;
if (_enabled)
{
item->setText(DESC_COL_STATUS, "ON");
brush.setColor(QColor::fromRgba(ENABLED_COLOR));
}
else
{
item->setText(DESC_COL_STATUS, "OFF");
brush.setColor(QColor::fromRgba(DISABLED_COLOR));
}
item->setForeground(DESC_COL_STATUS, brush);
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::resizeColumnsToContents()
{
for (int i = 0; i < DESC_COL_COLUMNS_NUMBER; ++i)
{
resizeColumnToContents(i);
}
}
//////////////////////////////////////////////////////////////////////////
void EasyDescWidget::contextMenuEvent(QContextMenuEvent* _event)
void EasyDescTreeWidget::onSelectedBlockChange(uint32_t _block_index)
{
if (_block_index == ::profiler_gui::numeric_max(_block_index))
return;
auto item = m_items[blocksTree(_block_index).node->id()];
if (item == nullptr)
return;
scrollToItem(item, QAbstractItemView::PositionAtCenter);
setCurrentItem(item);
}
//////////////////////////////////////////////////////////////////////////
void EasyDescTreeWidget::loadSettings()
{
QSettings settings(::profiler_gui::ORGANAZATION_NAME, ::profiler_gui::APPLICATION_NAME);
settings.beginGroup("desc_tree_widget");
auto val = settings.value("searchColumn");
if (!val.isNull())
m_searchColumn = val.toInt();
settings.endGroup();
}
void EasyDescTreeWidget::saveSettings()
{
QSettings settings(::profiler_gui::ORGANAZATION_NAME, ::profiler_gui::APPLICATION_NAME);
settings.beginGroup("desc_tree_widget");
settings.setValue("searchColumn", m_searchColumn);
settings.endGroup();
}
//////////////////////////////////////////////////////////////////////////
int EasyDescTreeWidget::findNext(const QString& _str)
{
if (_str.isEmpty())
{
for (auto item : m_items)
{
for (int i = 0; i < DESC_COL_COLUMNS_NUMBER; ++i)
item->setBackground(i, Qt::NoBrush);
}
return 0;
}
const bool isNewSearch = (m_lastSearch != _str);
auto itemsList = findItems(_str, Qt::MatchContains | Qt::MatchRecursive, m_searchColumn);
if (!isNewSearch)
{
if (!itemsList.empty())
{
bool stop = false;
decltype(m_lastFound) next = nullptr;
for (auto item : itemsList)
{
if (item->parent() == nullptr)
continue;
if (stop)
{
next = item;
break;
}
stop = item == m_lastFound;
}
m_lastFound = next == nullptr ? itemsList.front() : next;
}
else
{
m_lastFound = nullptr;
}
}
else
{
for (auto item : m_items)
{
for (int i = 0; i < DESC_COL_COLUMNS_NUMBER; ++i)
item->setBackground(i, Qt::NoBrush);
}
m_lastSearch = _str;
m_lastFound = !itemsList.empty() ? itemsList.front() : nullptr;
for (auto item : itemsList)
{
if (item->parent() != nullptr) for (int i = 0; i < DESC_COL_COLUMNS_NUMBER; ++i)
item->setBackgroundColor(i, Qt::yellow);
}
}
if (m_lastFound != nullptr)
{
scrollToItem(m_lastFound, QAbstractItemView::PositionAtCenter);
setCurrentItem(m_lastFound);
}
return itemsList.size();
}
int EasyDescTreeWidget::findPrev(const QString& _str)
{
if (_str.isEmpty())
{
for (auto item : m_items)
{
for (int i = 0; i < DESC_COL_COLUMNS_NUMBER; ++i)
item->setBackground(i, Qt::NoBrush);
}
return 0;
}
const bool isNewSearch = (m_lastSearch != _str);
auto itemsList = findItems(_str, Qt::MatchContains | Qt::MatchRecursive, m_searchColumn);
if (!isNewSearch)
{
if (!itemsList.empty())
{
decltype(m_lastFound) prev = nullptr;
for (auto item : itemsList)
{
if (item->parent() == nullptr)
continue;
if (item == m_lastFound)
break;
prev = item;
}
m_lastFound = prev == nullptr ? itemsList.back() : prev;
}
else
{
m_lastFound = nullptr;
}
}
else
{
for (auto item : m_items)
{
for (int i = 0; i < DESC_COL_COLUMNS_NUMBER; ++i)
item->setBackground(i, Qt::NoBrush);
}
m_lastSearch = _str;
m_lastFound = !itemsList.empty() ? itemsList.front() : nullptr;
for (auto item : itemsList)
{
if (item->parent() != nullptr) for (int i = 0; i < DESC_COL_COLUMNS_NUMBER; ++i)
item->setBackgroundColor(i, Qt::yellow);
}
}
if (m_lastFound != nullptr)
{
scrollToItem(m_lastFound, QAbstractItemView::PositionAtCenter);
setCurrentItem(m_lastFound);
}
return itemsList.size();
}
//////////////////////////////////////////////////////////////////////////
EasyDescWidget::EasyDescWidget(QWidget* _parent) : Parent(_parent)
, m_tree(new EasyDescTreeWidget())
, m_searchBox(new QLineEdit())
, m_foundNumber(new QLabel("Found 0 matches"))
{
m_searchBox->setMinimumWidth(64);
auto searchbox = new QHBoxLayout();
searchbox->setContentsMargins(0, 0, 0, 0);
searchbox->addWidget(new QLabel("Search:"));
searchbox->addWidget(m_searchBox);
searchbox->addStretch(50);
searchbox->addWidget(m_foundNumber, Qt::AlignRight);
auto lay = new QVBoxLayout(this);
lay->setContentsMargins(1, 1, 1, 1);
lay->addLayout(searchbox);
lay->addWidget(m_tree);
connect(m_searchBox, &QLineEdit::returnPressed, this, &This::onSeachBoxReturnPressed);
}
EasyDescWidget::~EasyDescWidget()
{
}
void EasyDescWidget::keyPressEvent(QKeyEvent* _event)
{
if (_event->key() == Qt::Key_F3)
{
int matches = 0;
if (_event->modifiers() & Qt::ShiftModifier)
matches = m_tree->findPrev(m_searchBox->text());
else
matches = m_tree->findNext(m_searchBox->text());
if (matches == 1)
m_foundNumber->setText(QString("Found 1 match"));
else
m_foundNumber->setText(QString("Found %1 matches").arg(matches));
}
_event->accept();
}
//////////////////////////////////////////////////////////////////////////
void EasyDescWidget::onSelectedBlockChange(uint32_t _block_index)
void EasyDescWidget::build()
{
m_tree->build();
}
}
//////////////////////////////////////////////////////////////////////////
void EasyDescWidget::loadSettings()
{
QSettings settings(::profiler_gui::ORGANAZATION_NAME, ::profiler_gui::APPLICATION_NAME);
settings.beginGroup("desc_tree_widget");
// ...
settings.endGroup();
}
void EasyDescWidget::saveSettings()
{
QSettings settings(::profiler_gui::ORGANAZATION_NAME, ::profiler_gui::APPLICATION_NAME);
settings.beginGroup("desc_tree_widget");
// ...
settings.endGroup();
void EasyDescWidget::onSeachBoxReturnPressed()
{
auto matches = m_tree->findNext(m_searchBox->text());
if (matches == 1)
m_foundNumber->setText(QString("Found 1 match"));
else
m_foundNumber->setText(QString("Found %1 matches").arg(matches));
}
//////////////////////////////////////////////////////////////////////////

View File

@ -5,7 +5,7 @@
* author : Victor Zarubkin
* email : v.s.zarubkin@gmail.com
* ----------------- :
* description : The file contains declaration of EasyDescWidget and it's auxiliary classes
* description : The file contains declaration of EasyDescTreeWidget and it's auxiliary classes
* : for displyaing EasyProfiler blocks descriptors tree.
* ----------------- :
* change log : * 2016/09/17 Victor Zarubkin: initial commit.
@ -33,7 +33,9 @@
#define EASY__DESCRIPTORS__WIDGET__H_
#include <QTreeWidget>
#include "profiler/reader.h"
#include <QString>
#include <vector>
#include "profiler/profiler.h"
//////////////////////////////////////////////////////////////////////////
@ -64,43 +66,96 @@ public:
//////////////////////////////////////////////////////////////////////////
class EasyDescWidget : public QTreeWidget
class EasyDescTreeWidget : public QTreeWidget
{
Q_OBJECT
typedef QTreeWidget Parent;
typedef EasyDescWidget This;
typedef EasyDescTreeWidget This;
typedef ::std::vector<EasyDescWidgetItem*> Items;
protected:
Items m_items;
QString m_lastSearch;
QTreeWidgetItem* m_lastFound;
int m_searchColumn;
bool m_bLocked;
public:
explicit EasyDescWidget(QWidget* _parent = nullptr);
virtual ~EasyDescWidget();
// Public virtual methods
explicit EasyDescTreeWidget(QWidget* _parent = nullptr);
virtual ~EasyDescTreeWidget();
void contextMenuEvent(QContextMenuEvent* _event) override;
void keyPressEvent(QKeyEvent* _event) override;
public:
// Public non-virtual methods
int findNext(const QString& _str);
int findPrev(const QString& _str);
public slots:
void clearSilent(bool _global = false);
void build();
protected:
void contextMenuEvent(QContextMenuEvent* _event) override;
private slots:
void onSearchColumnChange(bool);
void onCurrentItemChange(QTreeWidgetItem* _item, QTreeWidgetItem* _prev);
void onItemExpand(QTreeWidgetItem* _item);
void onDoubleClick(QTreeWidgetItem* _item, int _column);
void onSelectedBlockChange(uint32_t _block_index);
void onEnableStatusChange(::profiler::block_id_t _id, bool _enabled);
void resizeColumnsToContents();
protected:
private:
// Private methods
void loadSettings();
void saveSettings();
}; // END of class EasyDescTreeWidget.
//////////////////////////////////////////////////////////////////////////
class EasyDescWidget : public QWidget
{
Q_OBJECT
typedef QWidget Parent;
typedef EasyDescWidget This;
private:
EasyDescTreeWidget* m_tree;
class QLineEdit* m_searchBox;
class QLabel* m_foundNumber;
public:
// Public virtual methods
explicit EasyDescWidget(QWidget* _parent = nullptr);
virtual ~EasyDescWidget();
void keyPressEvent(QKeyEvent* _event) override;
public:
// Public non-virtual methods
void build();
private slots:
void onSeachBoxReturnPressed();
}; // END of class EasyDescWidget.
//////////////////////////////////////////////////////////////////////////

View File

@ -63,7 +63,18 @@ const int LOADER_TIMER_INTERVAL = 40;
//////////////////////////////////////////////////////////////////////////
EasyMainWindow::EasyMainWindow() : Parent(), m_treeWidget(nullptr), m_graphicsView(nullptr), m_progress(nullptr), m_editBlocksAction(nullptr)
EasyMainWindow::EasyMainWindow() : Parent()
, m_treeWidget(nullptr)
, m_graphicsView(nullptr)
#if EASY_GUI_USE_DESCRIPTORS_DOCK_WINDOW != 0
, m_descTreeWidget(nullptr)
#endif
, m_progress(nullptr)
, m_editBlocksAction(nullptr)
, m_descTreeDialog(nullptr)
, m_dialogDescTree(nullptr)
{
{ QIcon icon(":/logo"); if (!icon.isNull()) QApplication::setWindowIcon(icon); }
@ -75,13 +86,15 @@ EasyMainWindow::EasyMainWindow() : Parent(), m_treeWidget(nullptr), m_graphicsVi
setStatusBar(new QStatusBar());
auto graphicsView = new EasyGraphicsViewWidget();
m_graphicsView = new QDockWidget("Blocks diagram");
m_graphicsView = new QDockWidget("Diagram");
m_graphicsView->setObjectName("ProfilerGUI_Diagram");
m_graphicsView->setMinimumHeight(50);
m_graphicsView->setAllowedAreas(Qt::AllDockWidgetAreas);
m_graphicsView->setWidget(graphicsView);
auto treeWidget = new EasyTreeWidget();
m_treeWidget = new QDockWidget("Blocks hierarchy");
m_treeWidget = new QDockWidget("Hierarchy");
m_treeWidget->setObjectName("ProfilerGUI_Hierarchy");
m_treeWidget->setMinimumHeight(50);
m_treeWidget->setAllowedAreas(Qt::AllDockWidgetAreas);
m_treeWidget->setWidget(treeWidget);
@ -89,6 +102,16 @@ EasyMainWindow::EasyMainWindow() : Parent(), m_treeWidget(nullptr), m_graphicsVi
addDockWidget(Qt::TopDockWidgetArea, m_graphicsView);
addDockWidget(Qt::BottomDockWidgetArea, m_treeWidget);
#if EASY_GUI_USE_DESCRIPTORS_DOCK_WINDOW != 0
auto descTree = new EasyDescWidget();
m_descTreeWidget = new QDockWidget("Blocks");
m_descTreeWidget->setObjectName("ProfilerGUI_Blocks");
m_descTreeWidget->setMinimumHeight(50);
m_descTreeWidget->setAllowedAreas(Qt::AllDockWidgetAreas);
m_descTreeWidget->setWidget(descTree);
addDockWidget(Qt::BottomDockWidgetArea, m_descTreeWidget);
#endif
loadSettings();
@ -248,6 +271,8 @@ EasyMainWindow::EasyMainWindow() : Parent(), m_treeWidget(nullptr), m_graphicsVi
EasyMainWindow::~EasyMainWindow()
{
if (m_descTreeDialog != nullptr)
delete m_descTreeDialog;
delete m_progress;
}
@ -382,18 +407,33 @@ void EasyMainWindow::onCollapseAllClicked(bool)
void EasyMainWindow::onEditBlocksClicked(bool)
{
QDialog d(this);
d.setWindowTitle("EasyProfiler");
d.resize(800, 600);
if (m_descTreeDialog != nullptr)
{
m_descTreeDialog->raise();
return;
}
auto descTree = new EasyDescWidget();
descTree->build();
m_descTreeDialog = new QDialog();
m_descTreeDialog->setWindowTitle("EasyProfiler");
m_descTreeDialog->resize(800, 600);
connect(m_descTreeDialog, &QDialog::finished, this, &This::onDescTreeDialogClose);
auto l = new QVBoxLayout(&d);
l->addWidget(descTree);
m_dialogDescTree = new EasyDescWidget();
m_dialogDescTree->build();
d.setLayout(l);
d.exec();
auto l = new QVBoxLayout(m_descTreeDialog);
l->addWidget(m_dialogDescTree);
m_descTreeDialog->setLayout(l);
m_descTreeDialog->show();
}
void EasyMainWindow::onDescTreeDialogClose(int)
{
m_dialogDescTree = nullptr;
disconnect(m_descTreeDialog, &QDialog::finished, this, &This::onDescTreeDialogClose);
delete m_descTreeDialog;
m_descTreeDialog = nullptr;
}
//////////////////////////////////////////////////////////////////////////
@ -413,47 +453,33 @@ void EasyMainWindow::loadSettings()
auto last_file = settings.value("last_file");
if (!last_file.isNull())
{
m_lastFile = last_file.toString();
}
auto val = settings.value("chrono_text_position");
if (!val.isNull())
{
EASY_GLOBALS.chrono_text_position = static_cast<::profiler_gui::ChronometerTextPosition>(val.toInt());
}
auto flag = settings.value("draw_graphics_items_borders");
if (!flag.isNull())
{
EASY_GLOBALS.draw_graphics_items_borders = flag.toBool();
}
flag = settings.value("collapse_items_on_tree_close");
if (!flag.isNull())
{
EASY_GLOBALS.collapse_items_on_tree_close = flag.toBool();
}
flag = settings.value("all_items_expanded_by_default");
if (!flag.isNull())
{
EASY_GLOBALS.all_items_expanded_by_default = flag.toBool();
}
flag = settings.value("bind_scene_and_tree_expand_status");
if (!flag.isNull())
{
EASY_GLOBALS.bind_scene_and_tree_expand_status = flag.toBool();
}
flag = settings.value("enable_statistics");
if (!flag.isNull())
{
EASY_GLOBALS.enable_statistics = flag.toBool();
}
QString encoding = settings.value("encoding", "UTF-8").toString();
auto default_codec_mib = QTextCodec::codecForName(encoding.toStdString().c_str())->mibEnum();
@ -467,9 +493,15 @@ void EasyMainWindow::loadGeometry()
{
QSettings settings(::profiler_gui::ORGANAZATION_NAME, ::profiler_gui::APPLICATION_NAME);
settings.beginGroup("main");
auto geometry = settings.value("geometry").toByteArray();
if (!geometry.isEmpty())
restoreGeometry(geometry);
auto state = settings.value("windowState").toByteArray();
if (!state.isEmpty())
restoreState(state);
settings.endGroup();
}
@ -479,6 +511,7 @@ void EasyMainWindow::saveSettingsAndGeometry()
settings.beginGroup("main");
settings.setValue("geometry", this->saveGeometry());
settings.setValue("windowState", this->saveState());
settings.setValue("last_file", m_lastFile);
settings.setValue("chrono_text_position", static_cast<int>(EASY_GLOBALS.chrono_text_position));
settings.setValue("draw_graphics_items_borders", EASY_GLOBALS.draw_graphics_items_borders);
@ -534,7 +567,12 @@ void EasyMainWindow::onFileReaderTimeout()
static_cast<EasyGraphicsViewWidget*>(m_graphicsView->widget())->view()->setTree(EASY_GLOBALS.profiler_blocks);
#if EASY_GUI_USE_DESCRIPTORS_DOCK_WINDOW != 0
static_cast<EasyDescWidget*>(m_descTreeWidget->widget())->build();
#endif
m_editBlocksAction->setEnabled(true);
if (m_dialogDescTree != nullptr)
m_dialogDescTree->build();
}
else
{

View File

@ -39,6 +39,8 @@
//////////////////////////////////////////////////////////////////////////
#define EASY_GUI_USE_DESCRIPTORS_DOCK_WINDOW 0
class QDockWidget;
//////////////////////////////////////////////////////////////////////////
@ -88,8 +90,15 @@ protected:
QString m_lastFile;
QDockWidget* m_treeWidget;
QDockWidget* m_graphicsView;
#if EASY_GUI_USE_DESCRIPTORS_DOCK_WINDOW != 0
QDockWidget* m_descTreeWidget;
#endif
class QProgressDialog* m_progress;
class QAction* m_editBlocksAction;
class QDialog* m_descTreeDialog;
class EasyDescWidget* m_dialogDescTree;
QTimer m_readerTimer;
::profiler::SerializedData m_serializedBlocks;
::profiler::SerializedData m_serializedDescriptors;
@ -121,6 +130,7 @@ protected slots:
void onFileReaderTimeout();
void onFileReaderCancel();
void onEditBlocksClicked(bool);
void onDescTreeDialogClose(int);
private: