bug #86756: klistview::selectedItems() returns hidden items

Sebastian Sauer mail at dipe.org
Tue Sep 14 12:33:33 BST 2004


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

Hi Jason,

Jason Keirstead wrote:
>> If the selectedItems()-behaviour is wannted then it's just a minor
>> report. Thanks.
> 
> Have you thought of reporting this to Trolltech before Qt4 is
> released? If they agree with you perhaps hidden items can be
> deselected in QT4.

I guess it's a good behaviour to don't deselect them if they are hidden cause 
it make sense to still have the previous selected items still selected if 
they are shown again. That way it's easy to implementate a kind of filter 
which just hids the items that doesn't match the filterrule. If the 
filterrule changes they are still selected without just one line of code. So, 
it make somewhat sense here from my point of view.
What doesn't make sense is to return such hidden and selected items to the 
developer if he asks for them - that is the KListView-extension 
selectedItems(). Why it doesn't make sense? Well...

a) ListView's are designed to present something to the user. If multiselection 
is enabled it is cause the user should selected items and only the user 
selects them (in the deafult purpose a listview matches). Now the user is 
able to selected items he isn't able to see and he even don't know that there 
are more items he selected. To perform actions on such items is just very 
dangerous cause maybe something is done on (selected but hidden) items the 
user never wanted to happen with that items. Worst case; a file got deleted 
the user still needs :-)

b) Such a behaviour as _default_ without any kind of warning at least in the 
klistview-documentation is very dangerous. Specialy if the expected result - 
return all the items the user selected - isn't true cause also items the user 
doesn't selected (at least he don't know he does so) are returned.

But as sayed, if me is the only one thinking that way I'll just try to 
remember that case if I work with listviews and that's it.

- -- 
Sebastian Sauer aka dipesh[sebsauer]
http://www.dipe.org/public_key.asc
Fingerprint: 8F1E 219B 16E6 4EC7 29CC F408 E193 65E2 9134 2221

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFBRtcR4ZNl4pE0IiERAv5GAKCKf0vWbzRE06h0kluE6qZTv77mJgCeICmw
Y5HSZf2ZVXEVHhGgs8aAiOM=
=h/Dl
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list