Re: QSqlTableModel::select()
Hi, see QSqlQueryModel::fetchMore(). Qt is only loading a piece of data and will reload if necessary.
Re: QSqlTableModel::select()
After a select the model doesn't load all rows from Database.
With SQLITE the QuerySize isn't available then you can use the code
Code:
while (model.canFetchMore())
{
model.fetchMore();
}
Re: QSqlTableModel::select()
Thank you Lykurg and mcosta for your advice. your help really works.
Here is my updated code and it works, Thanks A lot:)
Code:
model.setTable("vlad");
model.select();
while (model.canFetchMore())
{
model.fetchMore();
}
int rows = model.rowCount();
qDebug() << outext;
:) :) :)
Re: QSqlTableModel::select()
An advice: don't use fetchmore if not really necessary. If you want the rowcount use a simple QSqlQuery. Don't know your concept or what you want to achieve but fetchmore is needed in only a few cases.