API addition to KTreeWidgetSearchLine to fix the shortcuts dialog

Andreas Hartmetz ahartmetz at gmail.com
Sun Oct 21 15:19:30 BST 2007


Hi all,

The new key shortcuts dialog has the problem that it doesn't hide the fold-out 
widget when its item is being hidden by the search line. This can be fixed by 
adding a hiddenChanged() signal to KTreeWidgetSearchLine and using it in the 
shortcuts dialog.

The attached patch does the following things:
[searchline]
-Implement the KTreeWidgetSearchLine::hiddenChanged() signal
-Add documentation about a known problem of KTreeWidgetSearchLine
[shortcuts dialog]
-Close the foldout when its item is hidden
-Deselect an item when its foldout closes
 (has no effect except looking better)
-Use a different way to obtain an item pointer from a model index.
 The new way involves a couple more lines of code but doesn't ignore
 the model-view-delegate model as much. It's just as bad a hack as the old
 way apart from that.
 Details: The old way has every item's data() return its this pointer, the new
 way involves un-protecting QTreeWidget::itemFromIndex() by implementing a
 tiny subclass that un-protects itemFromIndex(). The subclass doesn't
 reimplement any virtuals, which brings up a question to the experts: Does the
 compiler generate a vtable for this subclass?

The shortcuts dialog still has an issue: see what happens when you unset the 
first shortcut of an action with multiple shortcuts. I'll get to that later.

Cheers,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdeui.diff
Type: text/x-diff
Size: 12216 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071021/3bfac1c2/attachment.diff>


More information about the kde-core-devel mailing list