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

List:       kmail-devel
Subject:    QListView selects wrong item between press and release
From:       David Faure <david () mandrakesoft ! com>
Date:       2002-11-01 22:24:18
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Qt 3.1 20021024 and rc1 have this bug; it seems an attempt to fix it
was made between those two dates already, but was then reverted !?

The sequence of things is as follows:
QListView::contentsMousePressEvent
   -> changes current item, which is connected to a rather long operation (e.g. half a second)
QListView::contentsMouseMoveEvent
   -> gets delivered a bit later than it actually happened.
Even if the mouse _was_ above the same item when the mousemove event
was emitted, doAutoScroll() (_unconditionnally_ called by contentsMouseMoveEvent)
uses QCursor::pos(), so it will use the _current_ mouse position, and
select the item under the mouse as the new current item.

I see a temporary commit that introduced d->lastMousePos, to pass it to
doAutoScroll(). Why not. This would solve the above problem, why was
it reverted?

But in fact I don't understand why doAutoScroll() is called at all,
in the needAutoScroll==false case. The comment says "to select an item".
But contentsMousePressEvent already selected an item - and the right one.

Therefore, why not simply this?

- --- qlistview.cpp       2002/10/30 10:59:36     1.48
+++ qlistview.cpp       2002/11/01 22:21:45
@@ -4454,8 +4454,6 @@ void QListView::contentsMouseMoveEvent(
            delete d->scrollTimer;
            d->scrollTimer = 0;
        }
- -       // call this to select an item
- -       doAutoScroll();
     }
 }

- -- 
David FAURE, david@mandrakesoft.com
http://people.mandrakesoft.com/~david/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9wv8b72KcVAmwbhARAs+HAJ0QDl0iPbAfhl/fqbzJbK1Q95gUEACeLB8U
wmoxFjwzIkGawJNSKHD461E=
=HUov
-----END PGP SIGNATURE-----

_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail
[prev in list] [next in list] [prev in thread] [next in thread] 

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