FancyTabWidget: Remove an old, unnecessary hack

When clicking on a mode button, the emission of `currentChanged` was
delayed by an event. That was supposedly to "improve the responsiveness"
of the mode bar, but I don't see any difference, and _if_ changing the
mode widget was a performance issue, this wouldn't be the right place to
fix or work around it.

The hack creates issues, because it separates the `currentAboutToChange`
and `currentChanged` signals by an event processing.

Amends bd2ba2307b

Change-Id: I53a7aa74fdcfb733a28574837ca9e95fc2e97f0b
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2024-04-25 14:35:00 +02:00
parent 925b224c6d
commit ee1db27251

View File

@@ -196,10 +196,7 @@ void FancyTabBar::mousePressEvent(QMouseEvent *event)
emit currentAboutToChange(index);
m_currentIndex = index;
update();
// update tab bar before showing widget
QMetaObject::invokeMethod(this, [this] {
emit currentChanged(m_currentIndex);
}, Qt::QueuedConnection);
emit currentChanged(m_currentIndex);
}
}
}