[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] TableView - activated signal
From:       David Cortesi <davecortesi () gmail ! com>
Date:       2012-02-21 22:48:33
Message-ID: CALyzANsCCf3Ei6E0mGaXX6K554ZiDZcLaRe8Z1S-q-YZSECn2g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


>
>  * 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.

[Attachment #5 (text/html)]

<blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex" class="gmail_quote"> * But if you navigate around \
in the cell using arrow keys and then press space, the cell is opened, but no signal \
is triggered.<br>


    * If you then write something in the cell and press TAB to leave the cell - no \
signal is triggered.</blockquote><div><br>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.<br>

<br>Here are the notes I wrote to myself after figuring out how to create an Abstract \
Item Delegate:<br><br># a custom delegate is: an object that represents a<br># type \
of data when an instance of that type needs to be displayed or edited.<br>

# The delegate must implement 3 methods:<br># createEditor() returns a widget that \
the table view will position over the<br>#    table cell to act as an editor, e.g. a \
combo-box or line-edit;<br># setEditorData() initializes the editor widget with data \
to display;<br>

# setModelData() is called when editing is complete, to store possibly<br>#    \
changed data back to the model.<br><br>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.<br>

</div>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic