GUI: fix performance bottleneck with Qt signals
This commit is contained in:
parent
8af904fad6
commit
34279ebf08
|
@ -76,3 +76,4 @@ src/build-*/
|
||||||
.scannerwork/
|
.scannerwork/
|
||||||
bw-output/
|
bw-output/
|
||||||
build-wrapper*
|
build-wrapper*
|
||||||
|
My Amplifier Results - */
|
||||||
|
|
|
@ -611,6 +611,7 @@ void AbstractTableView::resizeEvent(QResizeEvent* event)
|
||||||
if(event->size().height() != event->oldSize().height())
|
if(event->size().height() != event->oldSize().height())
|
||||||
{
|
{
|
||||||
updateScrollBarRange(getRowCount());
|
updateScrollBarRange(getRowCount());
|
||||||
|
emit viewableRowsChanged(getViewableRowsCount());
|
||||||
mShouldReload = true;
|
mShouldReload = true;
|
||||||
}
|
}
|
||||||
QWidget::resizeEvent(event);
|
QWidget::resizeEvent(event);
|
||||||
|
@ -852,8 +853,6 @@ void AbstractTableView::updateScrollBarRange(dsint range)
|
||||||
verticalScrollBar()->setRange(0, 0);
|
verticalScrollBar()->setRange(0, 0);
|
||||||
verticalScrollBar()->setSingleStep(getRowHeight());
|
verticalScrollBar()->setSingleStep(getRowHeight());
|
||||||
verticalScrollBar()->setPageStep(viewableRowsCount * getRowHeight());
|
verticalScrollBar()->setPageStep(viewableRowsCount * getRowHeight());
|
||||||
|
|
||||||
emit viewableRowsChanged(viewableRowsCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
|
|
|
@ -48,19 +48,20 @@ public:
|
||||||
void filter(const QString & filter, FilterType type, int startColumn) override
|
void filter(const QString & filter, FilterType type, int startColumn) override
|
||||||
{
|
{
|
||||||
mSearchList->setRowCount(0);
|
mSearchList->setRowCount(0);
|
||||||
|
int newRowCount = 0;
|
||||||
mSearchList->mData.clear();
|
mSearchList->mData.clear();
|
||||||
mSearchList->mData.reserve(mList->mData.size());
|
mSearchList->mData.reserve(mList->mData.size());
|
||||||
mSearchList->mModules = mList->mModules;
|
mSearchList->mModules = mList->mModules;
|
||||||
int rows = mList->getRowCount();
|
int rows = mList->getRowCount();
|
||||||
for(int i = 0, j = 0; i < rows; i++)
|
for(int i = 0; i < rows; i++)
|
||||||
{
|
{
|
||||||
if(rowMatchesFilter(filter, type, i, startColumn))
|
if(rowMatchesFilter(filter, type, i, startColumn))
|
||||||
{
|
{
|
||||||
mSearchList->setRowCount(j + 1);
|
newRowCount++;
|
||||||
mSearchList->mData.push_back(mList->mData.at(i));
|
mSearchList->mData.push_back(mList->mData.at(i));
|
||||||
j++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mSearchList->setRowCount(newRowCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addAction(QAction* action)
|
void addAction(QAction* action)
|
||||||
|
|
|
@ -37,6 +37,10 @@ ZehSymbolTable::ZehSymbolTable(QWidget* parent)
|
||||||
addColumnAt(2000, tr("Symbol (undecorated)"), true);
|
addColumnAt(2000, tr("Symbol (undecorated)"), true);
|
||||||
loadColumnFromConfig("Symbol");
|
loadColumnFromConfig("Symbol");
|
||||||
updateColors();
|
updateColors();
|
||||||
|
|
||||||
|
trImport = tr("Import");
|
||||||
|
trExport = tr("Export");
|
||||||
|
trSymbol = tr("Symbol");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ZehSymbolTable::getCellContent(int r, int c)
|
QString ZehSymbolTable::getCellContent(int r, int c)
|
||||||
|
@ -54,11 +58,11 @@ QString ZehSymbolTable::getCellContent(int r, int c)
|
||||||
switch(info->type)
|
switch(info->type)
|
||||||
{
|
{
|
||||||
case sym_import:
|
case sym_import:
|
||||||
return tr("Import");
|
return trImport;
|
||||||
case sym_export:
|
case sym_export:
|
||||||
return tr("Export");
|
return trExport;
|
||||||
case sym_symbol:
|
case sym_symbol:
|
||||||
return tr("Symbol");
|
return trSymbol;
|
||||||
default:
|
default:
|
||||||
__debugbreak();
|
__debugbreak();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,11 @@ private:
|
||||||
std::vector<SYMBOLPTR> mData;
|
std::vector<SYMBOLPTR> mData;
|
||||||
QMutex mMutex;
|
QMutex mMutex;
|
||||||
|
|
||||||
|
//Caching of translations to fix a bottleneck
|
||||||
|
QString trImport;
|
||||||
|
QString trExport;
|
||||||
|
QString trSymbol;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ColAddr,
|
ColAddr,
|
||||||
|
|
Loading…
Reference in New Issue