Re: Question about method named rowCount() of QSqlTableModel
Originally Posted by StrikeByte
The behaviour is described in http://qt-project.org/doc/qt-4.8/qsq....html#rowCount
To see if it supports returning the size you can use the hasFeature() function (there is a link to the function in the rowcount documentation)
To get all rows you can do a sql select that returns all rows (SELECT * FROM tablename) you can replace * with a column name u need
If you don't mind me asking why do you want to get a count of all rows?
Thank you firstï¼ sorry for reply late,I just see it。
To get all rows,I can handle every row though a loop(eg· for(int i=0;i<rowcount;i++))
Is there any better idea to traverse a table without rowcount of qsqltablemodel?thanksï¼
Bookmarks