[solved]tableview set/get and other questions.
Because I’m a newbee i have some difficulties with many things.
Here is a list about Qtableview.
1)
I select and click on a singel row.
Could I get all of the values from the diffrent columns and put in a array or something.
2)
How could i do so if i uses the arrows to run thru the table the selection changes to the new row.
in other words currnt row change.
3) i want to highlight or “Blink “ som of the rows in the table.
Is it possible.
I’d like exampels
Foregive my bad English but i*m trying
5 replies
1)
I select and click on a singel row.
Could I get all of the values from the diffrent columns and put in a array or something.
Yes, you could , you can catch the suitable signal and get the index of the row then get all the desired results
- connect(_myTableView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(doubleClicked(const QModelIndex &)));
2)
How could i do so if i uses the arrows to run thru the table the selection changes to the new row.
in other words currnt row change.
I don’t understand this
3) i want to highlight or “Blink “ som of the rows in the table.
Is it possible.
- setAlternatingRowColors(true);
Yes by calling one method
I’d like exampels
Foregive my bad English but i*m trying
1)
Yes i do so but in a clickevent on a button and i do like this
- for( int i=0; i<selectedList.count(); i++)
- {
- ui->label1->setText(selectedList.at(i).data().toString());
- }
I can only get the columnvalue from ->selectedRows(1);
is there an easier way to do this
_____________________
2)
it was ment to catch the currentrow when i change row with my arrow buttons or swipe.
Is it possible.
I want to put the values from the current row in labels.
- QAbstractItemModel dataModel;
- QTableView myTableView;
reimplement the QAbstractItemModel make the list as data container
You must log in to post a reply. Not a member yet? Register here!
