[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    qt-copy
From:       Ingo Klöcker <ingo.kloecker () epost ! de>
Date:       2003-02-02 16:16:04
[Download RAW message or body]

CVS commit by kloecker: 

Apply patch from TT which fixes the annoying bug #48888 in KMail.


  M +2 -0      README.qt-copy   1.196
  M +15 -5     src/widgets/qlistview.cpp   1.54
  M +1 -0      src/widgets/qlistview.h   1.47


--- qt-copy/README.qt-copy  #1.195:1.196
@@ -89,2 +89,4 @@
 - qdnd_x11.cpp: Use a background pixmap instead of bitblitting the pixmap for 
   QShapedPixmapWidget. Reduces flicker when starting a drag.
+- QListView: selection when moving now selects correct items (sometimes with slow \
slots, doAutoScroll was +  called late and the QCursor:pos was different from the \
move-event pos) (patch from TT)

--- qt-copy/src/widgets/qlistview.h  #1.46:1.47
@@ -444,4 +444,5 @@ private:
     void selectRange( QListViewItem *from, QListViewItem *to, bool invert, bool \
                includeFirst, bool clearSel = FALSE );
     bool clearRange( QListViewItem *from, QListViewItem *to, bool includeFirst = \
TRUE ); +    void doAutoScroll( const QPoint &cursorPos );
 
     QListViewPrivate * d;

--- qt-copy/src/widgets/qlistview.cpp  #1.53:1.54
@@ -4459,5 +4459,5 @@ void QListView::contentsMouseMoveEvent( 
         d->scrollTimer->start( 100, FALSE );
         // call it once manually
-        doAutoScroll();
+        doAutoScroll( vp );
     }
 
@@ -4472,6 +4472,6 @@ void QListView::contentsMouseMoveEvent( 
             d->scrollTimer = 0;
         }
-        // call this to select an item
-        doAutoScroll();
+        // call this to select an item ( using the pos from the event )
+        doAutoScroll( vp );
     }
 }
@@ -4485,5 +4484,16 @@ void QListView::contentsMouseMoveEvent( 
 void QListView::doAutoScroll()
 {
-    QPoint pos = viewport()->mapFromGlobal( QCursor::pos() );
+    doAutoScroll( QPoint() );
+}
+
+/*
+  Handles auto-scrolling when the mouse button is pressed
+  and the mouse is outside the widget.
+
+  If cursorPos is (0,0) (isNull == TRUE) it uses the current QCursor::pos, otherwise \
it uses cursorPos +*/
+void QListView::doAutoScroll( const QPoint &cursorPos )
+{
+    QPoint pos = cursorPos.isNull() ? viewport()->mapFromGlobal( QCursor::pos() ) :  \
                cursorPos;
     if ( !d->focusItem || ( d->pressedEmptyArea && pos.y() > contentsHeight() ) )
         return;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic