ComboTabBar: Event handling cleanup

remotes/origin/falkon
David Rosca 11 years ago
parent 83b7f8f441
commit fb4782dab2
  1. 36
      src/lib/tabwidget/combotabbar.cpp
  2. 3
      src/lib/tabwidget/combotabbar.h

@ -588,6 +588,17 @@ bool ComboTabBar::event(QEvent *event)
ensureVisible();
break;
case QEvent::Show:
if (!event->spontaneous())
QTimer::singleShot(0, this, &ComboTabBar::setUpLayout);
break;
case QEvent::Enter:
case QEvent::Leave:
// Make sure tabs are painted with correct mouseover state
QTimer::singleShot(100, this, &ComboTabBar::updateTabBars);
break;
default:
break;
}
@ -906,31 +917,6 @@ void ComboTabBar::setMinimumWidths()
}
}
void ComboTabBar::showEvent(QShowEvent* event)
{
if (!event->spontaneous()) {
QTimer::singleShot(0, this, SLOT(setUpLayout()));
}
QWidget::showEvent(event);
}
void ComboTabBar::enterEvent(QEvent* event)
{
QWidget::enterEvent(event);
// Make sure tabs are painted with correct mouseover state
QTimer::singleShot(100, this, SLOT(updateTabBars()));
}
void ComboTabBar::leaveEvent(QEvent* event)
{
QWidget::leaveEvent(event);
// Make sure tabs are painted with correct mouseover state
QTimer::singleShot(100, this, SLOT(updateTabBars()));
}
TabBarHelper::TabBarHelper(bool isPinnedTabBar, ComboTabBar* comboTabBar)
: QTabBar(comboTabBar)

@ -167,9 +167,6 @@ protected:
bool event(QEvent *event);
void wheelEvent(QWheelEvent* event);
void showEvent(QShowEvent* event);
void enterEvent(QEvent* event);
void leaveEvent(QEvent* event);
bool eventFilter(QObject* obj, QEvent* ev);
void paintEvent(QPaintEvent* ev);

Loading…
Cancel
Save