PDA

View Full Version : spawnlist fixed row height



epfimi
08-15-2023, 08:33 PM
I've been testing the following patch for a bit today. It will cause the lists/trees in the spawnlist windows to use a fixed height for all cells which reduces the performance hit when the distance column is displayed.



diff --git a/src/spawnlistcommon.cpp b/src/spawnlistcommon.cpp
index 0483573..31ddc9f 100644
--- a/src/spawnlistcommon.cpp
+++ b/src/spawnlistcommon.cpp
@@ -69,6 +69,7 @@ SpawnListItem::~SpawnListItem()
QVariant SpawnListItem::data(int column, int role) const
{
QFont font = treeWidget()->font();
+ QFontMetrics metrics(font);
uint32_t filterFlags = 0;
if (m_item)
filterFlags = m_item->filterFlags();
@@ -114,6 +115,8 @@ QVariant SpawnListItem::data(int column, int role) const
return QColor(Qt::gray);
else
return m_textColor;
+ case Qt::SizeHintRole:
+ return QSize(-1, metrics.lineSpacing());


default:
return SEQListViewItem::data(column, role);

Loki
08-16-2023, 05:17 PM
This patch is great. Bascially fixed my performance issues I'm having with ShowEQ6. Not quite there yet but it's so much better.

cn187
09-09-2023, 04:36 PM
Added to trunk for next release. Thanks!