#include <KGlobalSettings>
-#include <QEvent>
#include <QItemSelectionModel>
#include <QScrollBar>
#include <QTimer>
startScrollTimer = new QTimer(this);
startScrollTimer->setSingleShot(true);
startScrollTimer->setInterval(300);
-
- timeLine = new QTimeLine(300, this);
-}
-
-void KTreeView::KTreeViewPrivate::connectScrollTimers()
-{
connect(startScrollTimer, SIGNAL(timeout()),
this, SLOT(startScrolling()));
+ timeLine = new QTimeLine(300, this);
connect(timeLine, SIGNAL(frameChanged(int)),
this, SLOT(updateVerticalScrollBar(int)));
}
}
-bool KTreeView::event(QEvent* event)
+void KTreeView::hideEvent(QHideEvent *event)
{
- if (event->type() == QEvent::Polish) {
- d->connectScrollTimers();
- }
- return QTreeView::event(event);
+ d->startScrollTimer->stop();
+ d->timeLine->stop();
+ QTreeView::hideEvent(event);
}
#include "ktreeview.moc"