]> cloud.milkyroute.net Git - dolphin.git/commitdiff
* Prevent that the QTreeView::scrollTo() method adjusts the position of the horizonta...
authorPeter Penz <peter.penz19@gmail.com>
Thu, 8 May 2008 21:16:57 +0000 (21:16 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Thu, 8 May 2008 21:16:57 +0000 (21:16 +0000)
* 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

src/ktreeview.cpp
src/ktreeview.h

index 687bfe1e385e5a089489d2cafb19bb489476fda0..cb7560b20a9a4dd255f8b957d9f405ea2ba84163 100644 (file)
@@ -36,7 +36,7 @@ KTreeView::KTreeViewPrivate::KTreeViewPrivate(KTreeView *parent) :
 {
     startScrollTimer = new QTimer(this);
     startScrollTimer->setSingleShot(true);
-    startScrollTimer->setInterval(50);
+    startScrollTimer->setInterval(300);
     connect(startScrollTimer, SIGNAL(timeout()),
             this, SLOT(startScrolling()));
 
@@ -156,5 +156,18 @@ void KTreeView::setSelectionModel(QItemSelectionModel *selectionModel)
             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"
index 4a6262621f396e7bb33d7b98a77be453db534032..0e9841fb394b09d0922a410b0eb642deb9c58360 100644 (file)
@@ -35,6 +35,7 @@ public:
     bool autoHorizontalScroll() const;
 
     virtual void setSelectionModel(QItemSelectionModel *selectionModel);
+    virtual void scrollTo(const QModelIndex& index, ScrollHint hint = EnsureVisible);
 
 private:
     class KTreeViewPrivate;