forked from qt-creator/qt-creator
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:
@@ -196,10 +196,7 @@ void FancyTabBar::mousePressEvent(QMouseEvent *event)
|
|||||||
emit currentAboutToChange(index);
|
emit currentAboutToChange(index);
|
||||||
m_currentIndex = index;
|
m_currentIndex = index;
|
||||||
update();
|
update();
|
||||||
// update tab bar before showing widget
|
emit currentChanged(m_currentIndex);
|
||||||
QMetaObject::invokeMethod(this, [this] {
|
|
||||||
emit currentChanged(m_currentIndex);
|
|
||||||
}, Qt::QueuedConnection);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user