Hi spirit,
WOW it worked. thanks a lot.
That was fast.

I have changed the code to this.
Qt Code:
  1. query.next();
  2. numberOfPages = query.value(0).toInt();
To copy to clipboard, switch view to plain text mode 
I think that will not effect the speed..

But i normally get the query and it work without .next().
but the problem happened when i have COUNT(*) in the query.

I did not look at the next function before in the QT Assistant.
they say :

The following rules apply:

If the result is currently located before the first record, e.g. immediately after a query is executed, an attempt is made to retrieve the first record.
If the result is currently located after the last record, there is no change and false is returned.
If the result is located somewhere in the middle, an attempt is made to retrieve the next record.
If the record could not be retrieved, the result is positioned after the last record and false is returned. If the record is successfully retrieved, true is returned.
Thank you again.


Best Regards