Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QtSQL + Sqlite and support for .size() function?

Tags:

sqlite

qt

qt4

qtsql

I'm wondering does QtSql + Sqlite support QSqlQuery::size() function?

like image 345
Sebastian Dusza Avatar asked Dec 10 '22 10:12

Sebastian Dusza


2 Answers

No, it doesn't. However, you can use last() and at() together to get the result.

QSqlQuery q;
q.exec("select * from table");
q.last();
qDebug() << q.at() + 1;
like image 124
Pluto Avatar answered Dec 28 '22 09:12

Pluto


No, it does't. SQLite is one of the databases for which the size of the query is not directly available. BTW: A Google-query for "qt sqlite QSqlQuery size" had this StackOverflow question as first answer.

like image 28
hmuelner Avatar answered Dec 28 '22 10:12

hmuelner