diff options
Diffstat (limited to 'src/gui/kernel/qapplication.cpp')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 5103f10..d97a57e 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -65,6 +65,7 @@ #include "qcolormap.h" #include "qdebug.h" #include "private/qgraphicssystemfactory_p.h" +#include "private/qgraphicssystem_p.h" #include "private/qstylesheetstyle_p.h" #include "private/qstyle_p.h" #include "qmessagebox.h" @@ -94,6 +95,10 @@ #include <stdlib.h> +#if defined(Q_WS_X11) && !defined(QT_NO_EGL) +#include <link.h> +#endif + #include "qapplication_p.h" #include "qevent_p.h" #include "qwidget_p.h" @@ -487,6 +492,7 @@ bool QApplicationPrivate::fade_tooltip = false; bool QApplicationPrivate::animate_toolbox = false; bool QApplicationPrivate::widgetCount = false; bool QApplicationPrivate::load_testability = false; +QString QApplicationPrivate::qmljsDebugArguments; #ifdef QT_KEYPAD_NAVIGATION # ifdef Q_OS_SYMBIAN Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadDirectional; @@ -558,6 +564,8 @@ void QApplicationPrivate::process_cmdline() QString s; if (arg == "-qdevel" || arg == "-qdebug") { // obsolete argument + } else if (arg.indexOf("-qmljsdebugger=", 0) != -1) { + qmljsDebugArguments = QString::fromLocal8Bit(arg.right(arg.length() - 15)); } else if (arg.indexOf("-style=", 0) != -1) { s = QString::fromLocal8Bit(arg.right(arg.length() - 7).toLower()); } else if (arg == "-style" && i < argc-1) { @@ -663,6 +671,9 @@ void QApplicationPrivate::process_cmdline() Qt::RightToLeft \o -graphicssystem, sets the backend to be used for on-screen widgets and QPixmaps. Available options are \c{raster} and \c{opengl}. + \o -qmljsdebugger=, activates the QML/JS debugger with a specified port. + The value must be of format port:1234[,block], where block is optional + and will make the application wait until a debugger connects to it. \endlist The X11 version of Qt supports some traditional X11 command line options: @@ -766,6 +777,13 @@ QApplication::QApplication(int &argc, char **argv, Type type , int _internal) : QCoreApplication(*new QApplicationPrivate(argc, argv, type, _internal)) { Q_D(QApplication); d->construct(); } +#if defined(Q_WS_X11) && !defined(QT_NO_EGL) +static int qt_matchLibraryName(dl_phdr_info *info, size_t, void *data) +{ + const char *name = static_cast<const char *>(data); + return strstr(info->dlpi_name, name) != 0; +} +#endif /*! \internal @@ -783,6 +801,19 @@ void QApplicationPrivate::construct( // the environment variable has the lowest precedence of runtime graphicssystem switches if (graphics_system_name.isEmpty()) graphics_system_name = QString::fromLocal8Bit(qgetenv("QT_GRAPHICSSYSTEM")); + +#if defined(Q_WS_X11) && !defined(QT_NO_EGL) + if (graphics_system_name.isEmpty()) { + bool linksWithMeeGoTouch = dl_iterate_phdr(qt_matchLibraryName, const_cast<char *>("libmeegotouchcore")); + bool linksWithMeeGoGraphicsSystemHelper = dl_iterate_phdr(qt_matchLibraryName, const_cast<char *>("libQtMeeGoGraphicsSystemHelper")); + + if (linksWithMeeGoTouch && !linksWithMeeGoGraphicsSystemHelper) { + qWarning("Running non-meego graphics system enabled MeeGo touch, forcing native graphicssystem\n"); + graphics_system_name = QLatin1String("native"); + } + } +#endif + // Must be called before initialize() qt_init(this, qt_appType #ifdef Q_WS_X11 @@ -1114,6 +1145,8 @@ QApplication::~QApplication() QApplicationPrivate::app_style = 0; delete QApplicationPrivate::app_icon; QApplicationPrivate::app_icon = 0; + delete QApplicationPrivate::graphics_system; + QApplicationPrivate::graphics_system = 0; #ifndef QT_NO_CURSOR d->cursor_list.clear(); #endif @@ -4333,11 +4366,13 @@ bool QApplication::notify(QObject *receiver, QEvent *e) eventAccepted = ge.isAccepted(); for (int i = 0; i < gestures.size(); ++i) { QGesture *g = gestures.at(i); - if ((res && eventAccepted) || (!eventAccepted && ge.isAccepted(g))) { + // Ignore res [event return value] because handling of multiple gestures + // packed into a single QEvent depends on not consuming the event + if (eventAccepted || ge.isAccepted(g)) { // if the gesture was accepted, mark the target widget for it gestureEvent->d_func()->targetWidgets[g->gestureType()] = w; gestureEvent->setAccepted(g, true); - } else if (!eventAccepted && !ge.isAccepted(g)) { + } else { // if the gesture was explicitly ignored by the application, // put it back so a parent can get it allGestures.append(g); |