You can use any classes you want as long as they are not paint devices (QPixmap, QWidget). You can use those as well before QApplication::exec() but only after creating the application object. Also the constructor of QCoreApplication is responsible for loading Qt plugins so SQL and image classes are fully available only after the application object has been created.
Bookmarks