Quote Originally Posted by UltramaticOrange View Post

Qt Code:
  1. C:/Documents and Settings/ald/My Documents/SQLStub/SQLStub-build-desktop/../SQLStub/main.cpp:36: error: invalid use of incomplete type 'struct QVariant'
  2.  
  3. c:\Qt\2010.04\qt\include/QtCore/../../src/corelib/kernel/qobject.h:66: error: forward declaration of 'struct QVariant'
To copy to clipboard, switch view to plain text mode 
You need to add
Qt Code:
  1. #include <QVariant>
To copy to clipboard, switch view to plain text mode 

I think, it is better to create QSqlQuery object after opening database connection.