aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2010-03-08 15:05:55 +0100
committercon <qtc-committer@nokia.com>2010-03-08 17:47:19 +0100
commit874efd70f9553dee5e248a0e1f53f3d68dd2ca7c (patch)
tree16ef0de71a8319888666eb2baefcf939a95a70e1
parent118f32198a064cc186ba197832657f405c06b497 (diff)
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 (cherry picked from commit e9f33fb8d3cfc0a27434412fdbb1d3fac5ea2db9)
-rw-r--r--src/plugins/coreplugin/fancytabwidget.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/coreplugin/fancytabwidget.cpp b/src/plugins/coreplugin/fancytabwidget.cpp
index 47357152c8..8261226036 100644
--- a/src/plugins/coreplugin/fancytabwidget.cpp
+++ b/src/plugins/coreplugin/fancytabwidget.cpp
@@ -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);
}
}