c++ - How to get all values in QTableView? -


i know if want take index , data of selected values in tableview like;

qmodelindexlist _indexes = ui->tvdatabaseimages->selectionmodel()->selectedrows();       foreach (qmodelindex index, _indexes)     {         qdebug() << "tableview index = " << qstring::number(index.row());          qdebug() << "tableview index value = " << index.data().toint();     } 

however want tableview indexlist without selection. possible? if yes, how can ?

using model behind qtableview:

model=myview.model() ( int col = 0; col < model.columncount(); ++col )    {   for( int row = 0; row < model.rowcount(); ++row )       {      index = model.index( row, col );      qdebug() << index.data();      }   } 

oddly, didn't find more straightforward.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -