How can I get the value of the clicked cell in a QListView
How can I get the value of the clicked cell in a QListView ??
Hello its very urgent and I am not able to find any way ahead.
How can we get the value or the text of the clicked cell in a QListView
listView1->text(0)
gives the text of the first column. But I need for any cell.
Thanks for the help.
you can also mail me at murari@tataelxsi.co.in
Please do help as soon as possible.
Regards
Murari Singh
Re: How can I get the value of the clicked cell in a QListView
Murari,
I think you try this:
connect(listView1,SIGNAL(clicked ( const QModelIndex & index )),this,SLOT(showData(
QModelIndex index )));
void myClass::showData(QModelIndex index)
{
QString str = listView1.data(index).toString();
}
or
can you give your code, how you adding data to QListView?
Re: How can I get the value of the clicked cell in a QListView
Quote:
Originally Posted by
murari2002
Hello its very urgent
http://catb.org/~esr/faqs/smart-questions.html#urgent
Quote:
How can we get the value or the text of the clicked cell in a QListView
listView1->text(0)
gives the text of the first column. But I need for any cell.
So connect to a signal which passes the column as parameter: QListView::clicked ( QListViewItem * item, const QPoint & pnt, int c ). The last parameter is the one you're interested in.
Quote:
If item is not 0, c is the list view column into which the user pressed; if item is 0 c's value is undefined.