[PyQt] TableView - activated signal

David Cortesi davecortesi at gmail.com
Tue Feb 21 22:48:33 GMT 2012


>
>  * But if you navigate around in the cell using arrow keys and then press
> space, the cell is opened, but no signal is triggered.
>    * If you then write something in the cell and press TAB to leave the
> cell - no signal is triggered.


These actions relate to editing the cell contents. Suggest you read the
Assistant page on QAbstractItemDelegate, with its examples. The Item
Delegate is what gets invoked when Qt thinks the user wants to modify the
contents of a cell.

Here are the notes I wrote to myself after figuring out how to create an
Abstract Item Delegate:

# a custom delegate is: an object that represents a
# type of data when an instance of that type needs to be displayed or
edited.
# The delegate must implement 3 methods:
# createEditor() returns a widget that the table view will position over the
#    table cell to act as an editor, e.g. a combo-box or line-edit;
# setEditorData() initializes the editor widget with data to display;
# setModelData() is called when editing is complete, to store possibly
#    changed data back to the model.

This is how you get control whenever the user indicates BY ANY MEANS that
she is ready to input or modify data, or has finished modifying the data.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20120221/1f5d2fef/attachment.html>


More information about the PyQt mailing list