[Qt-interest] QTableModel
J-P Nurmi
jpnurmi at gmail.com
Wed Nov 3 14:01:34 CET 2010
On Wed, Nov 3, 2010 at 2:44 PM, Joshua Wambua
<gmail at blueprint-group.co.ke>wrote:
> Hi all,
>
> I have a widget that has a QTableView which gets its data from a
> QTableModel
>
> I would like to display an empty row at the bottom for the user to insert
> new records.
>
> Any ideas?
>
>
>
>
Hi,
A quote from QAbstractTableModel docs:
Models that provide interfaces to resizable data structures can provide
implementations of insertRows(), removeRows(), insertColumns(), and
removeColumns(). When implementing these functions, it is important to call
the appropriate functions so that all connected views are aware of any
changes:
- An insertRows() implementation must call beginInsertRows() before
inserting new rows into the data structure, and it must call endInsertRows()
immediately afterwards.
- ...
http://doc.qt.nokia.com/4.7/qabstracttablemodel.html#subclassing
http://doc.qt.nokia.com/4.7/model-view-programming.html#resizable-models
<http://doc.qt.nokia.com/4.7/model-view-programming.html#resizable-models>
http://doc.qt.nokia.com/4.7/qabstractitemmodel.html#insertRows
--
J-P Nurmi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101103/d271ff79/attachment.html
More information about the Qt-interest-old
mailing list