From b74f6b5d5df0dc5c336be003947214683cacf264 Mon Sep 17 00:00:00 2001 From: shocoman Date: Fri, 22 Sep 2023 13:24:24 +0700 Subject: [PATCH] SymbolView: Don't update fonts on each 'repaintTableView' event --- src/gui/Src/Gui/SymbolView.cpp | 10 +++++++--- src/gui/Src/Gui/SymbolView.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/Src/Gui/SymbolView.cpp b/src/gui/Src/Gui/SymbolView.cpp index 63388ae9..798bf0e6 100644 --- a/src/gui/Src/Gui/SymbolView.cpp +++ b/src/gui/Src/Gui/SymbolView.cpp @@ -215,7 +215,7 @@ SymbolView::SymbolView(QWidget* parent) : QWidget(parent), ui(new Ui::SymbolView setupContextMenu(); //Signals and slots - connect(Bridge::getBridge(), SIGNAL(repaintTableView()), this, SLOT(updateStyle())); + connect(Bridge::getBridge(), SIGNAL(repaintTableView()), this, SLOT(reloadDataSlot())); connect(Bridge::getBridge(), SIGNAL(addMsgToSymbolLog(QString)), this, SLOT(addMsgToSymbolLogSlot(QString))); connect(Bridge::getBridge(), SIGNAL(clearLog()), this, SLOT(clearSymbolLogSlot())); connect(Bridge::getBridge(), SIGNAL(clearSymbolLog()), this, SLOT(clearSymbolLogSlot())); @@ -408,12 +408,16 @@ void SymbolView::refreshShortcutsSlot() void SymbolView::updateStyle() { - mModuleList->stdList()->reloadData(); - mModuleList->stdSearchList()->reloadData(); ui->symbolLogEdit->setFont(ConfigFont("Log")); ui->symbolLogEdit->setStyleSheet(QString("QTextEdit { color: %1; background-color: %2 }").arg(ConfigColor("AbstractTableViewTextColor").name(), ConfigColor("AbstractTableViewBackgroundColor").name())); } +void SymbolView::reloadDataSlot() +{ + mModuleList->stdList()->reloadData(); + mModuleList->stdSearchList()->reloadData(); +} + void SymbolView::addMsgToSymbolLogSlot(QString msg) { ui->symbolLogEdit->moveCursor(QTextCursor::End); diff --git a/src/gui/Src/Gui/SymbolView.h b/src/gui/Src/Gui/SymbolView.h index dd857de6..ff89f6db 100644 --- a/src/gui/Src/Gui/SymbolView.h +++ b/src/gui/Src/Gui/SymbolView.h @@ -30,6 +30,7 @@ public: private slots: void updateStyle(); + void reloadDataSlot(); void addMsgToSymbolLogSlot(QString msg); void clearSymbolLogSlot(); void moduleSelectionChanged(int index);