summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-09-21 08:06:18 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-09-21 08:06:18 (GMT)
commita4d1be727573a7a87c523a2ef28074c77d16f165 (patch)
treed4f8f218c41771ca17c7ab324390485af868fa8e /src/gui/kernel/qapplication.cpp
parentcd2fd21578a80bc5ac121c0419ee00b1799d0a60 (diff)
parent660ec910ef60513b511e2292255e53701dbb239b (diff)
downloadQt-a4d1be727573a7a87c523a2ef28074c77d16f165.zip
Qt-a4d1be727573a7a87c523a2ef28074c77d16f165.tar.gz
Qt-a4d1be727573a7a87c523a2ef28074c77d16f165.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: src/corelib/kernel/qobject.h src/declarative/graphicsitems/qdeclarativeflickable.cpp src/declarative/graphicsitems/qdeclarativeflickable_p_p.h src/declarative/util/qdeclarativelistmodel.cpp
Diffstat (limited to 'src/gui/kernel/qapplication.cpp')
-rw-r--r--src/gui/kernel/qapplication.cpp39
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);