diff --git a/profiler_gui/blocks_tree_widget.cpp b/profiler_gui/blocks_tree_widget.cpp index f9b4755..f3ab80b 100644 --- a/profiler_gui/blocks_tree_widget.cpp +++ b/profiler_gui/blocks_tree_widget.cpp @@ -590,11 +590,11 @@ void EasyTreeWidget::contextMenuEvent(QContextMenuEvent* _event) { action = menu.addAction("Expand all"); connect(action, &QAction::triggered, this, &This::onExpandAllClicked); - SET_ICON(action, ":/Expand"); + action->setIcon(QIcon(":/Expand")); action = menu.addAction("Collapse all"); connect(action, &QAction::triggered, this, &This::onCollapseAllClicked); - SET_ICON(action, ":/Collapse"); + action->setIcon(QIcon(":/Collapse")); if (item != nullptr && col >= 0) { @@ -602,11 +602,11 @@ void EasyTreeWidget::contextMenuEvent(QContextMenuEvent* _event) action = menu.addAction("Expand all children"); connect(action, &QAction::triggered, this, &This::onExpandAllChildrenClicked); - SET_ICON(action, ":/Expand"); + action->setIcon(QIcon(":/Expand")); action = menu.addAction("Collapse all children"); connect(action, &QAction::triggered, this, &This::onCollapseAllChildrenClicked); - SET_ICON(action, ":/Collapse"); + action->setIcon(QIcon(":/Collapse")); } menu.addSeparator(); @@ -633,13 +633,17 @@ void EasyTreeWidget::contextMenuEvent(QContextMenuEvent* _event) action->setCheckable(true); action->setChecked(m_bColorRows); connect(action, &QAction::triggered, this, &This::onColorizeRowsTriggered); - if (m_bColorRows) { + if (m_bColorRows) + { auto f = action->font(); f.setBold(true); action->setFont(f); - SET_ICON(action, ":/Color"); + action->setIcon(QIcon(":/Color")); + } + else + { + action->setIcon(QIcon(":/NoColor")); } - else SET_ICON(action, ":/NoColor"); if (item != nullptr && item->parent() != nullptr) { diff --git a/profiler_gui/descriptors_tree_widget.cpp b/profiler_gui/descriptors_tree_widget.cpp index a152924..0bfa09f 100644 --- a/profiler_gui/descriptors_tree_widget.cpp +++ b/profiler_gui/descriptors_tree_widget.cpp @@ -261,11 +261,11 @@ void EasyDescTreeWidget::contextMenuEvent(QContextMenuEvent* _event) QMenu menu; menu.setToolTipsVisible(true); auto action = menu.addAction("Expand all"); - SET_ICON(action, ":/Expand"); + action->setIcon(QIcon(":/Expand")); connect(action, &QAction::triggered, this, &This::expandAll); action = menu.addAction("Collapse all"); - SET_ICON(action, ":/Collapse"); + action->setIcon(QIcon(":/Collapse")); connect(action, &QAction::triggered, this, &This::collapseAll); menu.addSeparator(); diff --git a/profiler_gui/globals.h b/profiler_gui/globals.h index 524e380..17c0aa3 100644 --- a/profiler_gui/globals.h +++ b/profiler_gui/globals.h @@ -233,8 +233,6 @@ inline ::profiler::BlocksTree& blocksTree(::profiler::block_index_t i) { } #endif -#define SET_ICON(objectName, iconName) { QIcon icon(iconName); if (!icon.isNull()) objectName->setIcon(icon); } - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/profiler_gui/main_window.cpp b/profiler_gui/main_window.cpp index db12b2b..916e50b 100644 --- a/profiler_gui/main_window.cpp +++ b/profiler_gui/main_window.cpp @@ -275,12 +275,12 @@ EasyMainWindow::EasyMainWindow() : Parent(), m_lastAddress("localhost"), m_lastP auto f = action->font(); f.setBold(true); action->setFont(f); - SET_ICON(action, ":/Stats"); + action->setIcon(QIcon(":/Stats")); } else { action->setText("Statistics disabled"); - SET_ICON(action, ":/Stats-off"); + action->setIcon(QIcon(":/Stats-off")); } @@ -1027,12 +1027,12 @@ void EasyMainWindow::onEnableDisableStatistics(bool _checked) if (_checked) { action->setText("Statistics enabled"); - SET_ICON(action, ":/Stats"); + action->setIcon(QIcon(":/Stats")); } else { action->setText("Statistics disabled"); - SET_ICON(action, ":/Stats-off"); + action->setIcon(QIcon(":/Stats-off")); } } } @@ -1386,7 +1386,7 @@ void EasyMainWindow::setDisconnected(bool _showMessage) EASY_GLOBALS.connected = false; m_captureAction->setEnabled(false); - SET_ICON(m_connectAction, ":/Connection"); + m_connectAction->setIcon(QIcon(":/Connection")); m_connectAction->setText(tr("Connect")); m_eventTracingEnableAction->setEnabled(false); @@ -1943,7 +1943,7 @@ void EasyMainWindow::onConnectClicked(bool) qInfo() << "Connected successfully"; EASY_GLOBALS.connected = true; m_captureAction->setEnabled(true); - SET_ICON(m_connectAction, ":/Connection-on"); + m_connectAction->setIcon(QIcon(":/Connection-on")); m_connectAction->setText(tr("Disconnect")); if (m_fpsViewer->isVisible())