Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt4-preview-feedback Archive, August 2005
why is QModelIndexList QTableView::selectedIndexes() protected?


Message 1 in thread

Why is QModelIndexList QTableView::selectedIndexes() protected?  I do not see 
any other methods to determine what has been selected within a table view.  
Does anyone know what other methods are available to obtain what have been 
selected in a Table View?

Peter



From the documentation:

    QModelIndexList QAbstractItemView::selectedIndexes () const  
    [virtual protected]

    This convenience function returns a list of all selected and non-hidden
    item indexes in the view. The list contains no duplicates, and is not
    sorted.  The default implementation does nothing.


Message 2 in thread

This is just a quick answer without checking the docs...

Get the selectionModel from the table view. You should be able to get
everything you need from that.

John

-----Original Message-----
From: ptkacz@xxxxxxxxx [mailto:ptkacz@xxxxxxxxx]
Sent: Saturday, August 20, 2005 11:08 AM
To: qt4-preview-feedback@xxxxxxxxxxxxx
Subject: why is QModelIndexList QTableView::selectedIndexes() protected?


Why is QModelIndexList QTableView::selectedIndexes() protected?  I do not
see
any other methods to determine what has been selected within a table view.
Does anyone know what other methods are available to obtain what have been
selected in a Table View?

Peter



>From the documentation:

    QModelIndexList QAbstractItemView::selectedIndexes () const
    [virtual protected]

    This convenience function returns a list of all selected and non-hidden
    item indexes in the view. The list contains no duplicates, and is not
    sorted.  The default implementation does nothing.


Message 3 in thread

On Saturday 20 August 2005 23:18, John Vilburn wrote:
> This is just a quick answer without checking the docs...
>
> Get the selectionModel from the table view. You should be able to get
> everything you need from that.

That's right, and you should even be able to reach the same conclusion
by reading the documentation:

http://doc.trolltech.com/4.0/model-view-selection.html

David ;-)