I want to replace row number in QTableView with '>' char. How can I do this?
I want to replace row number in QTableView with '>' char. How can I do this?
You need to set the values for the horizontal headers in an implementation of headerData() or setHeaderData() in your model.
See QAbstractItemModel.
Karl
setHeaderData has roles and I don't see role which will make ">" in vertical header. Can you paste a code? Maybe I'm doing something wrong.
See if this qtcentre post helps: http://www.qtcentre.org/threads/4382...-in-QTableView
Karl
It not helps. I need this:
standard-views.png
Added after 11 minutes:
Ok I have solution:
Qt Code:
// my model { if( orientation == Qt::Vertical && role == Qt::DisplayRole ) { } else { } }To copy to clipboard, switch view to plain text mode
Last edited by Hostel; 22nd May 2013 at 22:13.
After you create the model and call select(), add the vertical headers like this:
Qt Code:
for(int i=0; i<model->rowCount(); i++) { model->setHeaderData( i, Qt::Vertical,">"); }To copy to clipboard, switch view to plain text mode
Karl
You could use also QIdentityProxyModel to replace the header text.
Hostel (23rd May 2013)
Bookmarks