move loading of testability driver from QApplication to QGuiApplication
This is useful without QWidget too. Change-Id: Ic7857e52e4a8f57c1205615a1f30323b486814af Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
parent
47a66d5eac
commit
35f6b00334
@ -96,6 +96,10 @@
|
|||||||
#include <QtGui/QClipboard>
|
#include <QtGui/QClipboard>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef QT_NO_LIBRARY
|
||||||
|
#include <QtCore/QLibrary>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
# include "private/qcore_mac_p.h"
|
# include "private/qcore_mac_p.h"
|
||||||
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||||
@ -1180,6 +1184,7 @@ void QGuiApplicationPrivate::init()
|
|||||||
QCoreApplicationPrivate::is_app_running = false; // Starting up.
|
QCoreApplicationPrivate::is_app_running = false; // Starting up.
|
||||||
|
|
||||||
bool doGrabUnderDebugger = false;
|
bool doGrabUnderDebugger = false;
|
||||||
|
bool loadTestability = false;
|
||||||
QList<QByteArray> pluginList;
|
QList<QByteArray> pluginList;
|
||||||
// Get command line params
|
// Get command line params
|
||||||
#ifndef QT_NO_SESSIONMANAGER
|
#ifndef QT_NO_SESSIONMANAGER
|
||||||
@ -1230,6 +1235,8 @@ void QGuiApplicationPrivate::init()
|
|||||||
is_session_restored = true;
|
is_session_restored = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
} else if (arg == "-testability") {
|
||||||
|
loadTestability = true;
|
||||||
} else {
|
} else {
|
||||||
argv[j++] = argv[i];
|
argv[j++] = argv[i];
|
||||||
}
|
}
|
||||||
@ -1287,6 +1294,22 @@ void QGuiApplicationPrivate::init()
|
|||||||
session_manager = new QSessionManager(q, session_id, session_key);
|
session_manager = new QSessionManager(q, session_id, session_key);
|
||||||
#endif
|
#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();
|
extern void qt_cleanupFontDatabase();
|
||||||
|
@ -92,9 +92,6 @@
|
|||||||
#include "qgesture.h"
|
#include "qgesture.h"
|
||||||
#include "private/qgesturemanager_p.h"
|
#include "private/qgesturemanager_p.h"
|
||||||
#include <qpa/qplatformfontdatabase.h>
|
#include <qpa/qplatformfontdatabase.h>
|
||||||
#ifndef QT_NO_LIBRARY
|
|
||||||
#include "qlibrary.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "qdatetime.h"
|
#include "qdatetime.h"
|
||||||
|
|
||||||
@ -415,7 +412,6 @@ int qt_antialiasing_threshold = -1;
|
|||||||
QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut
|
QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut
|
||||||
int QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect;
|
int QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect;
|
||||||
bool QApplicationPrivate::widgetCount = false;
|
bool QApplicationPrivate::widgetCount = false;
|
||||||
bool QApplicationPrivate::load_testability = false;
|
|
||||||
#ifdef QT_KEYPAD_NAVIGATION
|
#ifdef QT_KEYPAD_NAVIGATION
|
||||||
Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadTabOrder;
|
Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadTabOrder;
|
||||||
QWidget *QApplicationPrivate::oldEditFocus = 0;
|
QWidget *QApplicationPrivate::oldEditFocus = 0;
|
||||||
@ -490,8 +486,6 @@ void QApplicationPrivate::process_cmdline()
|
|||||||
#endif
|
#endif
|
||||||
} else if (qstrcmp(arg, "-widgetcount") == 0) {
|
} else if (qstrcmp(arg, "-widgetcount") == 0) {
|
||||||
widgetCount = true;
|
widgetCount = true;
|
||||||
} else if (qstrcmp(arg, "-testability") == 0) {
|
|
||||||
load_testability = true;
|
|
||||||
} else {
|
} else {
|
||||||
argv[j++] = argv[i];
|
argv[j++] = argv[i];
|
||||||
}
|
}
|
||||||
@ -582,23 +576,6 @@ void QApplicationPrivate::construct()
|
|||||||
extern void qt_gui_eval_init(QCoreApplicationPrivate::Type);
|
extern void qt_gui_eval_init(QCoreApplicationPrivate::Type);
|
||||||
qt_gui_eval_init(application_type);
|
qt_gui_eval_init(application_type);
|
||||||
#endif
|
#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
|
#ifndef QT_NO_STATEMACHINE
|
||||||
|
@ -214,7 +214,6 @@ public:
|
|||||||
|
|
||||||
static int enabledAnimations; // Combination of QPlatformTheme::UiEffect
|
static int enabledAnimations; // Combination of QPlatformTheme::UiEffect
|
||||||
static bool widgetCount; // Coupled with -widgetcount switch
|
static bool widgetCount; // Coupled with -widgetcount switch
|
||||||
static bool load_testability; // Coupled with -testability switch
|
|
||||||
|
|
||||||
static void setSystemPalette(const QPalette &pal);
|
static void setSystemPalette(const QPalette &pal);
|
||||||
static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash);
|
static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash);
|
||||||
|
Loading…
Reference in New Issue
Block a user