Q_CORE_EXPORT void qt_call_post_routines();
-QApplication::Type qt_appType=QApplication::Tty;
QApplicationPrivate *QApplicationPrivate::self = 0;
QInputContext *QApplicationPrivate::inputContext = 0;
: QApplicationPrivateBase(argc, argv, flags)
{
application_type = type;
- qt_appType = type;
#ifndef QT_NO_SESSIONMANAGER
is_session_restored = false;
*/
/*!
- \enum QApplication::Type
-
- \value Tty a console application
- \value GuiClient a GUI client application
- \value GuiServer a GUI server application (for Qt for Embedded Linux)
-*/
-
-/*!
\enum QApplication::ColorSpec
\value NormalColor the default color allocation policy
{
initResources();
- qt_is_gui_used = (qt_appType != QApplication::Tty);
+ qt_is_gui_used = (application_type != QApplication::Tty);
process_cmdline();
// Must be called before initialize()
- qt_init(this, qt_appType
+ qt_init(this, application_type
#ifdef Q_WS_X11
, dpy, visual, cmap
#endif
QWidgetPrivate::mapper = new QWidgetMapper;
QWidgetPrivate::allWidgets = new QWidgetSet;
- if (qt_appType != QApplication::Tty)
+ if (application_type != QApplication::Tty)
(void) QApplication::style(); // trigger creation of application style
#ifndef QT_NO_STATEMACHINE
// trigger registering of QStateMachine's GUI types
*/
QApplication::Type QApplication::type()
{
- return qt_appType;
+ if (QApplicationPrivate::instance())
+ return (QCoreApplication::Type)QApplicationPrivate::instance()->application_type;
+ return Tty;
}
/*****************************************************************************
{
if (QApplicationPrivate::app_style)
return QApplicationPrivate::app_style;
- if (!qt_is_gui_used) {
+ if (qApp->type() == QApplication::Tty) {
Q_ASSERT(!"No style available in non-gui applications!");
return 0;
}