PDA

View Full Version : QT4 console apps



ucntcme
18th January 2006, 14:54
Anyone here done this yet? GIven all the hoopla about TT making this "easy" I'd expect some tutorials and/or an example of a console only app.

Anyone have links/pointers? (preferably involving QObjects, Timers, and signal/slot ;) )

Cheers,
Bill

AlexKiriukha
18th January 2006, 15:06
Just use QCoreApplication instead QApplication. All works fine.

fullmetalcoder
19th January 2006, 08:54
you have to change the CONFIG var in your .pro file
CONFIG += console
CONFIG -= gui

Look at the doc, I'm unsure about the vars that has to hold "console" property.

AlexKiriukha
19th January 2006, 09:00
I have used:

QT = core sql
in my .pro file. This gets core features (QtCore) and SQL features (QtSql).

ucntcme
24th January 2006, 09:46
Thanks everyone. I was trying to use QCoreApplication but had the order of exec compared to other code in the wrong place. ;) "Minor" refactoring and voila! I get to move on to other issues. ;)

Side note:
By including QApplication you get qApp(), but there is no comparable (that I have found) ability in QCoreApplication. Sure, I can include QApplication to get it but that seems a bit extreme and naturally requires the gui libraries. Or am I missing something?

wysota
24th January 2006, 10:18
QCoreApplication::instance()