BUG? ItemViews and currentItemChanged

Michael Jansen kde at michael-jansen.biz
Tue Feb 26 13:34:44 GMT 2008


Hi

Is that a bug? Or am i supposed to do it differently. Small testcase to 
illustrate the bug/feature that is biting me.

If you move away from item 2 in the application you will be asked if you are s
ure. If not the app tries to keep you at item 2. Thats exactly the situation 
in  Systemsettings.

Move away with the keyboard. Everything works as expected.

Move away with the mouse. When you say no the currentItem is correct afterward
s, but the selected item is wrong (imho). To verify that the currentItem is co
rrect move once more with the keyboard.

I think the problem is in mouseReleaseEvent of AbstractItemView (1465+). there 
is the call to setCurrentIndex ( which in turns invokes our slot ), and then 
the update of the selection. I guess that's the wrong order. Probably  :-)

If everything is ok. How am i supposed to achieve my desired effect? That one 
bites me in kcmkeys twice.  
For kpagedialog i'm absolutly unable to fix it. But i need it to provide that 
cancel button on page switch.

The other time the workaround was such a mess so i removed my desired feature 
( using the keyboard to navigate in kcmkeys "Configuration of keybindings". It 
just wasn't worth the trouble :-(.

Mike-- 
Michael Jansen
http://www.michael-jansen.biz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.h
Type: text/x-chdr
Size: 822 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080226/49d729c4/attachment.h>
-------------- next part --------------
PROJECT(test)
FIND_PACKAGE(Qt4 REQUIRED)
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDES} )

SET(qt_test_SRCS main.cpp)
QT4_AUTOMOC( ${qt_test_SRCS} )

ADD_EXECUTABLE(qt_test ${qt_test_SRCS} )

TARGET_LINK_LIBRARIES(qt_test ${QT_QTCORE_LIBRARY_DEBUG} ${QT_QTGUI_LIBRARY_DEBUG} )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 949 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080226/49d729c4/attachment.cpp>


More information about the kde-core-devel mailing list