#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)
-{
- if (event->type() == QEvent::Polish) {
- d->connectScrollTimers();
- }
- return QTreeView::event(event);
-}
-
#include "ktreeview.moc"
#include "ktreeview_p.moc"
virtual void setSelectionModel(QItemSelectionModel *selectionModel);
virtual void scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible);
-protected:
- virtual bool event(QEvent* event);
-
private:
class KTreeViewPrivate;
KTreeViewPrivate *d;