ModuleNameFiltering

From BibleTime

Jump to: navigation, search

I think there is a way to do module name finding/filtering in mainindex quite easily.

If user selects the Find feature above the tree view with a check box the view will be changed to a flat list:

***********************************
[X] Find: |_____________|
___________________________________
AravSV
Abbot
FinPR
ISV
(etc.)

If Find is not selected the tree will be whatever the user wants:

***********************************
[ ] Find: |______________|
__________________________________
Bibles
+-English
   +-KJV
(etc.)

Techically this could be done with initalizing two QTreeWidget trees with the new moduletreeitem class. One is with the user-chosen grouping, the other is always flat list of modules. QTreeWidget has "invisible root item" which is the parent of the top level items. We can first initialize the QTreeWidget tree with the flat tree, then take off the children list of the root item, then initialize the widget again with the other tree.

When the user selects/deselects the Find feature the top level children will be taken off from the root item and the other child list will be put there.

When the user writes some letters the module list is looped through and nonmatching items will be hidden with QTreeWidgetItem::setHidden().

I would use another tree/list because if the ordinary tree is used it's much more difficult to show the results user friendly. Or maybe it's not so difficult after all - I have not tested. All parent groups of all matching modules should of course be expanded automatically and all the others which don't have any matching items should be hidden. That means some logic and calculation which may make this a bit slow.

Comments, please... Eelik 18:39, 7 November 2007 (CET)

Personal tools