Qt-interest Archive, February 2007
Given a QTableView, how to get the reference to one of its cells by index?
Message 1 in thread
Say, given a QTableView, to get its cell at row 0 column 1. How to do that?
--
[ signature omitted ]
Message 2 in thread
mytableview->model()->index(0, 1);
see
http://doc.trolltech.com/4.2/qtableview.html
http://doc.trolltech.com/4.2/qabstractitemmodel.html
;-)
Kingsun Soong wrote:
> Say, given a QTableView, to get its cell at row 0 column 1. How to do that?
--
[ signature omitted ]
Message 3 in thread
Manuela Hutter wrote:
> mytableview->model()->index(0, 1);
>
> see
> http://doc.trolltech.com/4.2/qtableview.html
> http://doc.trolltech.com/4.2/qabstractitemmodel.html
>
> ;-)
>
>
> Kingsun Soong wrote:
>> Say, given a QTableView, to get its cell at row 0 column 1. How to do
>> that?
Sorry about not asking this question clearly, but what I want to retrieve is
the QWidget of the cell, not the data or model or index of the cell. How to
do it?
--
[ signature omitted ]
Message 4 in thread
On 24.02.07 15:51:16, Kingsun Soong wrote:
> Manuela Hutter wrote:
>
> > mytableview->model()->index(0, 1);
> >
> > see
> > http://doc.trolltech.com/4.2/qtableview.html
> > http://doc.trolltech.com/4.2/qabstractitemmodel.html
> >
> > ;-)
> >
> >
> > Kingsun Soong wrote:
> >> Say, given a QTableView, to get its cell at row 0 column 1. How to do
> >> that?
>
> Sorry about not asking this question clearly, but what I want to retrieve is
> the QWidget of the cell, not the data or model or index of the cell. How to
> do it?
There is no QWidget on that cell, unless you set one with
setIndexWidget(). In that case you can retrieve it by using
indexWidget().
Andreas
--
[ signature omitted ]