int QSqlQuery::size () const
Returns the size of the result (number of rows returned), or -1 if the size cannot be determined or if the database does not support reporting information about query sizes. Note that for non-SELECT statements (isSelect() returns false), size() will return -1. If the query is not active (isActive() returns false), -1 is returned. --from Qt Assistant 4.3.0 Open Source Edition

According to the assistant, QSqlQuery::size() returns -1 when isSelect() or isActive() returns false.

I made a program which uses sqlite, but it doesn't work.

I did debugging and found that when I call size(), it returns -1.

So, I checked what is returned by isSelect() and isActive() like next code, and I have very weired result.

code : qDebug() << q.size() << q.isActive() << q.isSelect();
result : warning: -1 true true

Though isActive() and isSelect() return true, size() returns -1.

Are there other reasons size() returns -1? or Is this just Qt's bug?