Commit e9f33fb8 authored by Jens Bache-Wiig's avatar Jens Bache-Wiig
Browse files

Fix examples failing to open

After fixing the sidebar to use delayed update,
code that relied on setCurrentItem could break
since the state was not set asyncronously.
This fixes it by only making mouseClick delayed,
while setCurrentIndex works as before when set
programatically.

Reviewed-by: Lasse Holmstedt
parent 8a73827c
......@@ -216,9 +216,14 @@ void FancyTabBar::emitCurrentIndex()
void FancyTabBar::mousePressEvent(QMouseEvent *e)
{
e->accept();
for (int i = 0; i < m_tabs.count(); ++i) {
if (tabRect(i).contains(e->pos())) {
setCurrentIndex(i);
for (int index = 0; index < m_tabs.count(); ++index) {
if (tabRect(index).contains(e->pos())) {
if (isTabEnabled(index)) {
m_currentIndex = index;
update();
m_triggerTimer.start(0);
}
break;
}
}
......@@ -313,7 +318,7 @@ void FancyTabBar::setCurrentIndex(int index) {
if (isTabEnabled(index)) {
m_currentIndex = index;
update();
m_triggerTimer.start(0);
emit currentChanged(m_currentIndex);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment