* increased the delay until the auto scrolling starts from 50 to 300
CCMAIL: haraldhv@stud.ntnu.no
svn path=/trunk/KDE/kdebase/apps/; revision=805605
{
startScrollTimer = new QTimer(this);
startScrollTimer->setSingleShot(true);
{
startScrollTimer = new QTimer(this);
startScrollTimer->setSingleShot(true);
- startScrollTimer->setInterval(50);
+ startScrollTimer->setInterval(300);
connect(startScrollTimer, SIGNAL(timeout()),
this, SLOT(startScrolling()));
connect(startScrollTimer, SIGNAL(timeout()),
this, SLOT(startScrolling()));
d->startScrollTimer, SLOT(start()));
}
d->startScrollTimer, SLOT(start()));
}
+void KTreeView::scrollTo(const QModelIndex& index, ScrollHint hint)
+{
+ if (d->autoHorizontalScroll) {
+ // assure that the value of the horizontal scrollbar stays on its current value,
+ // KTreeView will adjust the value manually
+ const int value = horizontalScrollBar()->value();
+ QTreeView::scrollTo(index, hint);
+ horizontalScrollBar()->setValue(value);
+ } else {
+ QTreeView::scrollTo(index, hint);
+ }
+}
+
#include "ktreeview.moc"
#include "ktreeview_p.moc"
#include "ktreeview.moc"
#include "ktreeview_p.moc"
bool autoHorizontalScroll() const;
virtual void setSelectionModel(QItemSelectionModel *selectionModel);
bool autoHorizontalScroll() const;
virtual void setSelectionModel(QItemSelectionModel *selectionModel);
+ virtual void scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible);
private:
class KTreeViewPrivate;
private:
class KTreeViewPrivate;