summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qguiapplication.cpp23
-rw-r--r--src/widgets/kernel/qapplication.cpp23
-rw-r--r--src/widgets/kernel/qapplication_p.h1
3 files changed, 23 insertions, 24 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 8ccff4321d..91e4833812 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -96,6 +96,10 @@
#include <QtGui/QClipboard>
#endif
+#ifndef QT_NO_LIBRARY
+#include <QtCore/QLibrary>
+#endif
+
#if defined(Q_OS_MAC)
# include "private/qcore_mac_p.h"
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
@@ -1180,6 +1184,7 @@ void QGuiApplicationPrivate::init()
QCoreApplicationPrivate::is_app_running = false; // Starting up.
bool doGrabUnderDebugger = false;
+ bool loadTestability = false;
QList<QByteArray> pluginList;
// Get command line params
#ifndef QT_NO_SESSIONMANAGER
@@ -1230,6 +1235,8 @@ void QGuiApplicationPrivate::init()
is_session_restored = true;
}
#endif
+ } else if (arg == "-testability") {
+ loadTestability = true;
} else {
argv[j++] = argv[i];
}
@@ -1287,6 +1294,22 @@ void QGuiApplicationPrivate::init()
session_manager = new QSessionManager(q, session_id, session_key);
#endif
+#ifndef QT_NO_LIBRARY
+ if (loadTestability) {
+ QLibrary testLib(QStringLiteral("qttestability"));
+ if (testLib.load()) {
+ typedef void (*TasInitialize)(void);
+ TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
+ if (initFunction) {
+ initFunction();
+ } else {
+ qCritical() << "Library qttestability resolve failed!";
+ }
+ } else {
+ qCritical() << "Library qttestability load failed:" << testLib.errorString();
+ }
+ }
+#endif // QT_NO_LIBRARY
}
extern void qt_cleanupFontDatabase();
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 0b983e7a9d..4bd306ed32 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -92,9 +92,6 @@
#include "qgesture.h"
#include "private/qgesturemanager_p.h"
#include <qpa/qplatformfontdatabase.h>
-#ifndef QT_NO_LIBRARY
-#include "qlibrary.h"
-#endif
#include "qdatetime.h"
@@ -415,7 +412,6 @@ int qt_antialiasing_threshold = -1;
QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut
int QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect;
bool QApplicationPrivate::widgetCount = false;
-bool QApplicationPrivate::load_testability = false;
#ifdef QT_KEYPAD_NAVIGATION
Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadTabOrder;
QWidget *QApplicationPrivate::oldEditFocus = 0;
@@ -490,8 +486,6 @@ void QApplicationPrivate::process_cmdline()
#endif
} else if (qstrcmp(arg, "-widgetcount") == 0) {
widgetCount = true;
- } else if (qstrcmp(arg, "-testability") == 0) {
- load_testability = true;
} else {
argv[j++] = argv[i];
}
@@ -582,23 +576,6 @@ void QApplicationPrivate::construct()
extern void qt_gui_eval_init(QCoreApplicationPrivate::Type);
qt_gui_eval_init(application_type);
#endif
-
-#ifndef QT_NO_LIBRARY
- if(load_testability) {
- QLibrary testLib(QLatin1String("qttestability"));
- if (testLib.load()) {
- typedef void (*TasInitialize)(void);
- TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
- if (initFunction) {
- initFunction();
- } else {
- qCritical("Library qttestability resolve failed!");
- }
- } else {
- qCritical("Library qttestability load failed!");
- }
- }
-#endif
}
#ifndef QT_NO_STATEMACHINE
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index d5efb62dda..29142470a7 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -214,7 +214,6 @@ public:
static int enabledAnimations; // Combination of QPlatformTheme::UiEffect
static bool widgetCount; // Coupled with -widgetcount switch
- static bool load_testability; // Coupled with -testability switch
static void setSystemPalette(const QPalette &pal);
static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash);