KListBox::executed() issue.

Michael Pyne pynm0001 at comcast.net
Fri Apr 29 00:42:42 BST 2005


Hi all,

KListBox::executed() doesn't seem to work too well, due to a bug in Qt that I 
just got done reporting.  This bug affects at least qt-copy and 3.3.4 (I have 
no other versions I can test).

There is a rather easy workaround for the bug that I can apply to 
klistbox.cpp, but I don't know whether I should since I'm not certain when 
the bug was introduced into Qt, and I don't want to break KListBox for people 
that have it working.

Basically, I want advice as to whether it would break anything to apply the 
following patch to workaround the Qt bug.

Here's the patch in case you were wondering.  I've also attached a short 
testcase you can use to see if you also have the problem.

Index: klistbox.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/klistbox.cpp,v
retrieving revision 1.24
diff -u -3 -p -r1.24 klistbox.cpp
--- klistbox.cpp        24 Nov 2004 08:50:46 -0000      1.24
+++ klistbox.cpp        28 Apr 2005 23:40:33 -0000
@@ -244,7 +244,7 @@ void KListBox::contentsMouseDoubleClickE
 {
   QListBox::contentsMouseDoubleClickEvent( e );

-  QListBoxItem* item = itemAt( e->pos() );
+  QListBoxItem* item = itemAt( contentsToViewport( e->globalPos() ) );

   if( item ) {
     emit doubleClicked( item, e->globalPos() );

Regards,
 - Michael Pyne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qlistbox-bug-testcase.tar.gz
Type: application/x-gzip
Size: 2625 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050428/71519389/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050428/71519389/attachment.sig>


More information about the kde-core-devel mailing list