diff options
author | Water-Team <water@pad.test.qt.nokia.com> | 2011-06-29 21:42:03 (GMT) |
---|---|---|
committer | Water-Team <water@pad.test.qt.nokia.com> | 2011-06-29 21:42:03 (GMT) |
commit | 0a8daa8845325fba9cf2ec973eb6bab8a2853dd5 (patch) | |
tree | 504c698037ee6283f1b5dbc6fa658bb2bfffb99a /src/plugins | |
parent | 680023c4921019614948c277cde5498645836cb9 (diff) | |
parent | 6b3f2a3b96d01dc339d07a076300d29616603b28 (diff) | |
download | Qt-0a8daa8845325fba9cf2ec973eb6bab8a2853dd5.zip Qt-0a8daa8845325fba9cf2ec973eb6bab8a2853dd5.tar.gz Qt-0a8daa8845325fba9cf2ec973eb6bab8a2853dd5.tar.bz2 |
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'src/plugins')
29 files changed, 367 insertions, 154 deletions
diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp index 7e97ffe..13f2b4c 100644 --- a/src/plugins/bearer/generic/qgenericengine.cpp +++ b/src/plugins/bearer/generic/qgenericengine.cpp @@ -147,6 +147,9 @@ static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interf QGenericEngine::QGenericEngine(QObject *parent) : QBearerEngineImpl(parent) { + //workaround for deadlock in __cxa_guard_acquire with webkit on macos x + //initialise the Q_GLOBAL_STATIC in same thread as the AtomicallyInitializedStatic + (void)QNetworkInterface::interfaceFromIndex(0); } QGenericEngine::~QGenericEngine() diff --git a/src/plugins/platforms/uikit/README b/src/plugins/platforms/uikit/README index a101a3a..ffd31df 100644 --- a/src/plugins/platforms/uikit/README +++ b/src/plugins/platforms/uikit/README @@ -18,11 +18,11 @@ After configuring and building Qt you need to also build src/plugins/platforms/u Simulator: ---------- -configure -qpa -xplatform qws/macx-iphonesimulator-g++ -arch i386 -developer-build -opengl es1 -no-accessibility -no-qt3support -no-multimedia -no-phonon -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations +configure -qpa -xplatform qpa/macx-iphonesimulator-g++ -arch i386 -developer-build -opengl es2 -no-accessibility -no-qt3support -no-multimedia -no-phonon -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations Device: ------- -configure -qpa -xplatform qws/macx-iphonedevice-g++ -arch armv7 -developer-build -release -opengl es1 -no-accessibility -no-qt3support -no-multimedia -no-phonon -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations +configure -qpa -xplatform qpa/macx-iphonedevice-g++ -arch armv7 -developer-build -release -opengl es2 -no-accessibility -no-qt3support -no-multimedia -no-phonon -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations 2) XCode setup: - there are examples in the examples subdirectory of the platform plugin diff --git a/src/plugins/platforms/uikit/examples/qmltest/main.mm b/src/plugins/platforms/uikit/examples/qmltest/main.mm index 662354e..d55de48 100644 --- a/src/plugins/platforms/uikit/examples/qmltest/main.mm +++ b/src/plugins/platforms/uikit/examples/qmltest/main.mm @@ -41,7 +41,7 @@ #import <UIKit/UIKit.h> -#include "qmlapplicationviewer/qmlapplicationviewer.h" +#include "../share/qmlapplicationviewer/qmlapplicationviewer.h" #include <QtGui/QApplication> #include <QtCore/QtPlugin> diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmltest.xcodeproj/project.pbxproj b/src/plugins/platforms/uikit/examples/qmltest/qmltest.xcodeproj/project.pbxproj index 10bb20f..02a028d 100755 --- a/src/plugins/platforms/uikit/examples/qmltest/qmltest.xcodeproj/project.pbxproj +++ b/src/plugins/platforms/uikit/examples/qmltest/qmltest.xcodeproj/project.pbxproj @@ -12,6 +12,10 @@ 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; D316594E1338B29E00760B02 /* libQtXml_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D31659431338B21000760B02 /* libQtXml_debug.a */; }; D316594F1338B29E00760B02 /* libQtXmlPatterns_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D31659441338B21000760B02 /* libQtXmlPatterns_debug.a */; }; + D333CCF913B88A690070E08E /* moc_qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D333CCF613B88A690070E08E /* moc_qmlapplicationviewer.cpp */; }; + D333CCFA13B88A690070E08E /* moc_qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D333CCF613B88A690070E08E /* moc_qmlapplicationviewer.cpp */; }; + D333CCFB13B88A690070E08E /* qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D333CCF713B88A690070E08E /* qmlapplicationviewer.cpp */; }; + D333CCFC13B88A690070E08E /* qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D333CCF713B88A690070E08E /* qmlapplicationviewer.cpp */; }; D35784241345D8C90046D202 /* libQtOpenGL_debug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D35784231345D8C90046D202 /* libQtOpenGL_debug.a */; }; D35784261345D9940046D202 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D35784251345D9940046D202 /* OpenGLES.framework */; }; D35784281345D9E00046D202 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D35784271345D9E00046D202 /* QuartzCore.framework */; }; @@ -19,11 +23,7 @@ D3578439134A0AAE0046D202 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D35784251345D9940046D202 /* OpenGLES.framework */; }; D357843A134A0AB10046D202 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D35784271345D9E00046D202 /* QuartzCore.framework */; }; D3CAA7C813264AAD008BB877 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7C713264AAD008BB877 /* main.mm */; }; - D3CAA7E613264EA6008BB877 /* moc_qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7E313264EA6008BB877 /* moc_qmlapplicationviewer.cpp */; }; - D3CAA7E713264EA6008BB877 /* qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7E413264EA6008BB877 /* qmlapplicationviewer.cpp */; }; D3CAA7EC13264F52008BB877 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7C713264AAD008BB877 /* main.mm */; }; - D3CAA7ED13264F52008BB877 /* moc_qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7E313264EA6008BB877 /* moc_qmlapplicationviewer.cpp */; }; - D3CAA7EE13264F52008BB877 /* qmlapplicationviewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3CAA7E413264EA6008BB877 /* qmlapplicationviewer.cpp */; }; D3CAA7F013264F52008BB877 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; D3CAA7F113264F52008BB877 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; D3CAA7F213264F52008BB877 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; @@ -60,14 +60,14 @@ 8D1107310486CEB800E47090 /* qmltest-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "qmltest-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; }; D31659431338B21000760B02 /* libQtXml_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtXml_debug.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtXml_debug.a"; sourceTree = SOURCE_ROOT; }; D31659441338B21000760B02 /* libQtXmlPatterns_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtXmlPatterns_debug.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtXmlPatterns_debug.a"; sourceTree = SOURCE_ROOT; }; + D333CCF613B88A690070E08E /* moc_qmlapplicationviewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_qmlapplicationviewer.cpp; path = ../share/qmlapplicationviewer/moc_qmlapplicationviewer.cpp; sourceTree = "<group>"; }; + D333CCF713B88A690070E08E /* qmlapplicationviewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = qmlapplicationviewer.cpp; path = ../share/qmlapplicationviewer/qmlapplicationviewer.cpp; sourceTree = "<group>"; }; + D333CCF813B88A690070E08E /* qmlapplicationviewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qmlapplicationviewer.h; path = ../share/qmlapplicationviewer/qmlapplicationviewer.h; sourceTree = "<group>"; }; D35784231345D8C90046D202 /* libQtOpenGL_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtOpenGL_debug.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtOpenGL_debug.a"; sourceTree = "<group>"; }; D35784251345D9940046D202 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; D35784271345D9E00046D202 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; D3578435134A09990046D202 /* libQtOpenGL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtOpenGL.a; path = "../../../../../../../qt-lighthouse-ios-device/lib/libQtOpenGL.a"; sourceTree = "<group>"; }; D3CAA7C713264AAD008BB877 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; }; - D3CAA7E313264EA6008BB877 /* moc_qmlapplicationviewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_qmlapplicationviewer.cpp; path = qmlapplicationviewer/moc_qmlapplicationviewer.cpp; sourceTree = "<group>"; }; - D3CAA7E413264EA6008BB877 /* qmlapplicationviewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = qmlapplicationviewer.cpp; path = qmlapplicationviewer/qmlapplicationviewer.cpp; sourceTree = "<group>"; }; - D3CAA7E513264EA6008BB877 /* qmlapplicationviewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qmlapplicationviewer.h; path = qmlapplicationviewer/qmlapplicationviewer.h; sourceTree = "<group>"; }; D3CAA7F613264F52008BB877 /* qmltest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = qmltest.app; sourceTree = BUILT_PRODUCTS_DIR; }; D3CAA7F913264F8A008BB877 /* libz.1.2.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.2.3.dylib; path = usr/lib/libz.1.2.3.dylib; sourceTree = SDKROOT; }; D3CAA81613265056008BB877 /* libQtCore_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtCore_debug.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtCore_debug.a"; sourceTree = SOURCE_ROOT; }; @@ -198,9 +198,9 @@ D3CAA7E213264E8C008BB877 /* QMLApplicationViewer */ = { isa = PBXGroup; children = ( - D3CAA7E313264EA6008BB877 /* moc_qmlapplicationviewer.cpp */, - D3CAA7E413264EA6008BB877 /* qmlapplicationviewer.cpp */, - D3CAA7E513264EA6008BB877 /* qmlapplicationviewer.h */, + D333CCF613B88A690070E08E /* moc_qmlapplicationviewer.cpp */, + D333CCF713B88A690070E08E /* qmlapplicationviewer.cpp */, + D333CCF813B88A690070E08E /* qmlapplicationviewer.h */, ); name = QMLApplicationViewer; sourceTree = "<group>"; @@ -328,8 +328,8 @@ buildActionMask = 2147483647; files = ( D3CAA7C813264AAD008BB877 /* main.mm in Sources */, - D3CAA7E613264EA6008BB877 /* moc_qmlapplicationviewer.cpp in Sources */, - D3CAA7E713264EA6008BB877 /* qmlapplicationviewer.cpp in Sources */, + D333CCF913B88A690070E08E /* moc_qmlapplicationviewer.cpp in Sources */, + D333CCFB13B88A690070E08E /* qmlapplicationviewer.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -338,8 +338,8 @@ buildActionMask = 2147483647; files = ( D3CAA7EC13264F52008BB877 /* main.mm in Sources */, - D3CAA7ED13264F52008BB877 /* moc_qmlapplicationviewer.cpp in Sources */, - D3CAA7EE13264F52008BB877 /* qmlapplicationviewer.cpp in Sources */, + D333CCFA13B88A690070E08E /* moc_qmlapplicationviewer.cpp in Sources */, + D333CCFC13B88A690070E08E /* qmlapplicationviewer.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/moc_qmlapplicationviewer.cpp b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/moc_qmlapplicationviewer.cpp index a5c02be..75114f9 100644 --- a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/moc_qmlapplicationviewer.cpp +++ b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/moc_qmlapplicationviewer.cpp @@ -42,8 +42,8 @@ /**************************************************************************** ** Meta object code from reading C++ file 'qmlapplicationviewer.h' ** -** Created: Fri Feb 18 17:53:42 2011 -** by: The Qt Meta Object Compiler version 62 (Qt 4.7.2) +** Created: Mon Jun 27 10:56:34 2011 +** by: The Qt Meta Object Compiler version 63 (Qt 4.8.0) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ @@ -51,8 +51,8 @@ #include "qmlapplicationviewer.h" #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'qmlapplicationviewer.h' doesn't include <QObject>." -#elif Q_MOC_OUTPUT_REVISION != 62 -#error "This file was generated using the moc from 4.7.2. It" +#elif Q_MOC_OUTPUT_REVISION != 63 +#error "This file was generated using the moc from 4.8.0. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif @@ -61,7 +61,7 @@ QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_QmlApplicationViewer[] = { // content: - 5, // revision + 6, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods @@ -78,9 +78,21 @@ static const char qt_meta_stringdata_QmlApplicationViewer[] = { "QmlApplicationViewer\0" }; +void QmlApplicationViewer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +const QMetaObjectExtraData QmlApplicationViewer::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + const QMetaObject QmlApplicationViewer::staticMetaObject = { { &QDeclarativeView::staticMetaObject, qt_meta_stringdata_QmlApplicationViewer, - qt_meta_data_QmlApplicationViewer, 0 } + qt_meta_data_QmlApplicationViewer, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.cpp b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.cpp index 47d0870..02f0471 100644 --- a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -// checksum 0x17fa version 0x3000a +// checksum 0x5e4a version 0x5000d /* This file was generated by the Qt Quick Application wizard of Qt Creator. QmlApplicationViewer is a convenience class containing mobile device specific @@ -58,19 +58,17 @@ #include <QtDeclarative/QDeclarativeEngine> #include <QtDeclarative/QDeclarativeContext> -#if defined(QMLJSDEBUGGER) +#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800 + #include <qt_private/qdeclarativedebughelper_p.h> -#endif -#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) +#if !defined(NO_JSDEBUGGER) #include <jsdebuggeragent.h> #endif -#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) +#if !defined(NO_QMLOBSERVER) #include <qdeclarativeviewobserver.h> #endif -#if defined(QMLJSDEBUGGER) - // Enable debugging before any QDeclarativeEngine is created struct QmlJsDebuggingEnabler { @@ -100,12 +98,13 @@ QString QmlApplicationViewerPrivate::adjustPath(const QString &path) return QCoreApplication::applicationDirPath() + QLatin1String("/../Resources/") + path; #else - const QString pathInShareDir = QCoreApplication::applicationDirPath() - + QLatin1String("/../share/") - + QFileInfo(QCoreApplication::applicationFilePath()).fileName() - + QLatin1Char('/') + path; - if (QFileInfo(pathInShareDir).exists()) - return pathInShareDir; + const QString pathInInstallDir = QCoreApplication::applicationDirPath() + + QLatin1String("/../") + path; + if (pathInInstallDir.contains(QLatin1String("opt")) + && pathInInstallDir.contains(QLatin1String("bin")) + && QFileInfo(pathInInstallDir).exists()) { + return pathInInstallDir; + } #endif #endif return path; @@ -117,11 +116,14 @@ QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : { connect(engine(), SIGNAL(quit()), SLOT(close())); setResizeMode(QDeclarativeView::SizeRootObjectToView); -#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) + // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in +#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800 +#if !defined(NO_JSDEBUGGER) new QmlJSDebugger::JSDebuggerAgent(engine()); #endif -#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) - new QmlJSDebugger::QDeclarativeViewObserver(this, parent); +#if !defined(NO_QMLOBSERVER) + new QmlJSDebugger::QDeclarativeViewObserver(this, this); +#endif #endif } @@ -153,7 +155,7 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) // } // } //#endif // Q_OS_SYMBIAN -// + // Qt::WidgetAttribute attribute; // switch (orientation) { //#if QT_VERSION < 0x040702 @@ -186,9 +188,9 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) void QmlApplicationViewer::showExpanded() { -#ifdef Q_OS_SYMBIAN +#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) showFullScreen(); -#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) +#elif defined(Q_WS_MAEMO_5) showMaximized(); #else show(); diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.h b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.h index d7d9fe2..9b125e0 100644 --- a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.h +++ b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.h @@ -39,7 +39,7 @@ ** ****************************************************************************/ -// checksum 0x5a59 version 0x3000a +// checksum 0x382f version 0x5000d /* This file was generated by the Qt Quick Application wizard of Qt Creator. QmlApplicationViewer is a convenience class containing mobile device specific @@ -70,7 +70,10 @@ public: void setMainQmlFile(const QString &file); void addImportPath(const QString &path); + + // Note that this will only have an effect on Symbian and Fremantle. void setOrientation(ScreenOrientation orientation); + void showExpanded(); private: diff --git a/src/plugins/platforms/uikit/quikiteventloop.mm b/src/plugins/platforms/uikit/quikiteventloop.mm index 8884f63..7c3e929 100644 --- a/src/plugins/platforms/uikit/quikiteventloop.mm +++ b/src/plugins/platforms/uikit/quikiteventloop.mm @@ -72,7 +72,7 @@ Q_UNUSED(application) foreach (QWidget *widget, qApp->topLevelWidgets()) { QUIKitWindow *platformWindow = static_cast<QUIKitWindow *>(widget->platformWindow()); - platformWindow->ensureNativeWindow(); + if (platformWindow) platformWindow->ensureNativeWindow(); } return YES; } @@ -80,8 +80,6 @@ - (void)applicationWillTerminate:(UIApplication *)application { Q_UNUSED(application) - // TODO this isn't called for some reason - qDebug() << "quit"; qApp->quit(); } @@ -105,7 +103,7 @@ - (void)processEventsAndSchedule { QPlatformEventLoopIntegration::processEvents(); - qint64 nextTime = mIntegration->nextTimerEvent(); + qint64 nextTime = qMin((qint64)33, mIntegration->nextTimerEvent()); // at least 30fps NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSDate *nextDate = [[NSDate date] dateByAddingTimeInterval:((double)nextTime/1000)]; [mIntegration->mTimer setFireDate:nextDate]; @@ -156,15 +154,15 @@ bool QUIKitSoftwareInputHandler::eventFilter(QObject *obj, QEvent *event) if (event->type() == QEvent::RequestSoftwareInputPanel) { QWidget *widget = qobject_cast<QWidget *>(obj); if (widget) { - QUIKitWindow *platformWindow = static_cast<QUIKitWindow *>(widget->platformWindow()); - [platformWindow->nativeView() becomeFirstResponder]; + QUIKitWindow *platformWindow = static_cast<QUIKitWindow *>(widget->window()->platformWindow()); + if (platformWindow) [platformWindow->nativeView() becomeFirstResponder]; return true; } } else if (event->type() == QEvent::CloseSoftwareInputPanel) { QWidget *widget = qobject_cast<QWidget *>(obj); if (widget) { - QUIKitWindow *platformWindow = static_cast<QUIKitWindow *>(widget->platformWindow()); - [platformWindow->nativeView() resignFirstResponder]; + QUIKitWindow *platformWindow = static_cast<QUIKitWindow *>(widget->window()->platformWindow()); + if (platformWindow) [platformWindow->nativeView() resignFirstResponder]; return true; } } diff --git a/src/plugins/platforms/uikit/quikitintegration.h b/src/plugins/platforms/uikit/quikitintegration.h index 92247fd..d9844b2 100644 --- a/src/plugins/platforms/uikit/quikitintegration.h +++ b/src/plugins/platforms/uikit/quikitintegration.h @@ -64,6 +64,7 @@ public: private: QList<QPlatformScreen *> mScreens; + QPlatformFontDatabase *mFontDb; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/uikit/quikitintegration.mm b/src/plugins/platforms/uikit/quikitintegration.mm index 737fa40..21ab38f 100644 --- a/src/plugins/platforms/uikit/quikitintegration.mm +++ b/src/plugins/platforms/uikit/quikitintegration.mm @@ -44,6 +44,7 @@ #include "quikitwindowsurface.h" #include "quikitscreen.h" #include "quikiteventloop.h" +#include "qgenericunixfontdatabase.h" #include <QtGui/QApplication> @@ -55,7 +56,18 @@ QT_BEGIN_NAMESPACE +class QUIKitFontDatabase : public QGenericUnixFontDatabase +{ +public: + virtual QString fontDir() const + { + return QString( [[[[NSBundle mainBundle] bundlePath] + stringByAppendingPathComponent:@"fonts"] UTF8String] ); + } +}; + QUIKitIntegration::QUIKitIntegration() + :mFontDb(new QUIKitFontDatabase() ) { mScreens << new QUIKitScreen(0); } @@ -93,12 +105,7 @@ QPlatformEventLoopIntegration *QUIKitIntegration::createEventLoopIntegration() c QPlatformFontDatabase * QUIKitIntegration::fontDatabase() const { - static bool initialized = false; - if (!initialized) { - initialized = true; - setenv("QT_QPA_FONTDIR",[[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"fonts"] UTF8String],1); - } - return QPlatformIntegration::fontDatabase(); + return mFontDb; } QT_END_NAMESPACE diff --git a/src/plugins/platforms/uikit/quikitscreen.mm b/src/plugins/platforms/uikit/quikitscreen.mm index 0a5b027..ae1c7cf 100644 --- a/src/plugins/platforms/uikit/quikitscreen.mm +++ b/src/plugins/platforms/uikit/quikitscreen.mm @@ -63,12 +63,18 @@ QUIKitScreen::QUIKitScreen(int screenIndex) const qreal inch = 25.4; qreal dpi = 160.; int dragDistance = 12; + int defaultFontPixelSize = 14; if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { dpi = 132.; dragDistance = 10; } m_physicalSize = QSize(qRound(bounds.size.width * inch / dpi), qRound(bounds.size.height * inch / dpi)); qApp->setStartDragDistance(dragDistance); + + QFont font(QLatin1String("Bitstream Vera Sans")); + font.setPixelSize(defaultFontPixelSize); + qApp->setFont(font); + [pool release]; } diff --git a/src/plugins/platforms/uikit/quikitwindow.mm b/src/plugins/platforms/uikit/quikitwindow.mm index 29ca88b..ec33cd0 100644 --- a/src/plugins/platforms/uikit/quikitwindow.mm +++ b/src/plugins/platforms/uikit/quikitwindow.mm @@ -67,9 +67,8 @@ public: mFormat.setBlueBufferSize(8); mFormat.setAlphaBufferSize(8); mFormat.setStencilBufferSize(8); + mFormat.setSamples(0); mFormat.setSampleBuffers(false); - mFormat.setSamples(1); -// mFormat.setSwapInterval(?) mFormat.setDoubleBuffer(true); mFormat.setDepth(true); mFormat.setRgba(true); @@ -290,37 +289,25 @@ private: - (void)insertText:(NSString *)text { - QKeyEvent *ev; + QString string = QString::fromUtf8([text UTF8String]); int key = 0; if ([text isEqualToString:@"\n"]) key = (int)Qt::Key_Return; - ev = new QKeyEvent(QEvent::KeyPress, - key, - Qt::NoModifier, - QString::fromUtf8([text UTF8String]) - ); - qApp->postEvent(qApp->focusWidget(), ev); - ev = new QKeyEvent(QEvent::KeyRelease, - key, - Qt::NoModifier, - QString::fromUtf8([text UTF8String]) - ); - qApp->postEvent(qApp->focusWidget(), ev); + + // Send key event to window system interface + QWindowSystemInterface::handleKeyEvent( + 0, QEvent::KeyPress, key, Qt::NoModifier, string, false, int(string.length())); + QWindowSystemInterface::handleKeyEvent( + 0, QEvent::KeyRelease, key, Qt::NoModifier, string, false, int(string.length())); } - (void)deleteBackward { - QKeyEvent *ev; - ev = new QKeyEvent(QEvent::KeyPress, - (int)Qt::Key_Backspace, - Qt::NoModifier - ); - qApp->postEvent(qApp->focusWidget(), ev); - ev = new QKeyEvent(QEvent::KeyRelease, - (int)Qt::Key_Backspace, - Qt::NoModifier - ); - qApp->postEvent(qApp->focusWidget(), ev); + // Send key event to window system interface + QWindowSystemInterface::handleKeyEvent( + 0, QEvent::KeyPress, (int)Qt::Key_Backspace, Qt::NoModifier); + QWindowSystemInterface::handleKeyEvent( + 0, QEvent::KeyRelease, (int)Qt::Key_Backspace, Qt::NoModifier); } @end @@ -335,9 +322,8 @@ QUIKitWindow::QUIKitWindow(QWidget *tlw) : mScreen = static_cast<QUIKitScreen *>(QPlatformScreen::platformScreenForWidget(tlw)); CGRect screenBounds = [mScreen->uiScreen() bounds]; QRect geom(screenBounds.origin.x, screenBounds.origin.y, screenBounds.size.width, screenBounds.size.height); - setGeometry(geom); - mView = [[EAGLView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)]; - // TODO ensure the native window if the application is already running + QPlatformWindow::setGeometry(geom); + mView = [[EAGLView alloc] initWithFrame:CGRectMake(geom.x(), geom.y(), geom.width(), geom.height())]; } QUIKitWindow::~QUIKitWindow() diff --git a/src/plugins/platforms/uikit/quikitwindowsurface.mm b/src/plugins/platforms/uikit/quikitwindowsurface.mm index 54723f8..809f098 100644 --- a/src/plugins/platforms/uikit/quikitwindowsurface.mm +++ b/src/plugins/platforms/uikit/quikitwindowsurface.mm @@ -127,7 +127,7 @@ void QUIKitWindowSurface::flush(QWidget *widget, const QRegion ®ion, const QP QWindowSurface::WindowSurfaceFeatures QUIKitWindowSurface::features() const { - return PartialUpdates; + return 0; } QT_END_NAMESPACE diff --git a/src/plugins/platforms/uikit/uikit.pro b/src/plugins/platforms/uikit/uikit.pro index 6f5947f..273c00d 100644 --- a/src/plugins/platforms/uikit/uikit.pro +++ b/src/plugins/platforms/uikit/uikit.pro @@ -22,6 +22,6 @@ HEADERS = quikitsoftwareinputhandler.h #add libz for freetype. LIBS += -lz -#include(../fontdatabases/basicunix/basicunix.pri) +include(../fontdatabases/genericunix/genericunix.pri) target.path += $$[QT_INSTALL_PLUGINS]/platforms INSTALLS += target diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp index 72de02a..999a411 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp @@ -91,7 +91,7 @@ void QWaylandXCompositeEGLContext::swapBuffers() QSize size = mWindow->geometry().size(); eglSwapBuffers(mEglIntegration->eglDisplay(),mEglWindowSurface); - mWindow->damage(QRegion(QRect(QPoint(0,0),size))); + mWindow->damage(QRect(QPoint(0,0),size)); mWindow->waitForFrameSync(); } diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp index dff6ffa..3d49790 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp @@ -81,7 +81,7 @@ void QWaylandXCompositeGLXContext::swapBuffers() QSize size = mWindow->geometry().size(); glXSwapBuffers(mGlxIntegration->xDisplay(),mXWindow); - mWindow->damage(QRegion(QRect(QPoint(0,0),size))); + mWindow->damage(QRect(QPoint(0,0),size)); mWindow->waitForFrameSync(); } diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index 83516e9..c8dc2f9 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -232,17 +232,36 @@ int QWaylandDisplay::sourceUpdate(uint32_t mask, void *data) } void QWaylandDisplay::outputHandleGeometry(void *data, - struct wl_output *output, + wl_output *output, int32_t x, int32_t y, - int32_t width, int32_t height) + int32_t physicalWidth, + int32_t physicalHeight, + int subpixel, + const char *make, const char *model) { QWaylandDisplay *waylandDisplay = static_cast<QWaylandDisplay *>(data); - QRect outputRect = QRect(x, y, width, height); + QRect outputRect = QRect(x, y, physicalWidth, physicalHeight); waylandDisplay->createNewScreen(output,outputRect); } +void QWaylandDisplay::mode(void *data, + struct wl_output *wl_output, + uint32_t flags, + int width, + int height, + int refresh) +{ + Q_UNUSED(data); + Q_UNUSED(wl_output); + Q_UNUSED(flags); + Q_UNUSED(width); + Q_UNUSED(height); + Q_UNUSED(refresh); +} + const struct wl_output_listener QWaylandDisplay::outputListener = { - QWaylandDisplay::outputHandleGeometry + QWaylandDisplay::outputHandleGeometry, + QWaylandDisplay::mode }; const struct wl_compositor_listener QWaylandDisplay::compositorListener = { diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.h b/src/plugins/platforms/wayland/qwaylanddisplay.h index 765be62..4dff24d 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.h +++ b/src/plugins/platforms/wayland/qwaylanddisplay.h @@ -128,7 +128,16 @@ private: static void outputHandleGeometry(void *data, struct wl_output *output, int32_t x, int32_t y, - int32_t width, int32_t height); + int32_t width, int32_t height, + int subpixel, + const char *make, + const char *model); + static void mode(void *data, + struct wl_output *wl_output, + uint32_t flags, + int width, + int height, + int refresh); static void handleVisual(void *data, struct wl_compositor *compositor, diff --git a/src/plugins/platforms/wayland/qwaylandshmsurface.cpp b/src/plugins/platforms/wayland/qwaylandshmsurface.cpp index efc56bb..b24c419 100644 --- a/src/plugins/platforms/wayland/qwaylandshmsurface.cpp +++ b/src/plugins/platforms/wayland/qwaylandshmsurface.cpp @@ -120,7 +120,12 @@ void QWaylandShmWindowSurface::flush(QWidget *widget, const QRegion ®ion, con Q_UNUSED(offset); QWaylandShmWindow *waylandWindow = static_cast<QWaylandShmWindow *>(window()->platformWindow()); Q_ASSERT(waylandWindow->windowType() == QWaylandWindow::Shm); - waylandWindow->damage(region); + QVector<QRect> rects = region.rects(); + for (int i = 0; i < rects.size(); i++) { + const QRect rect = rects.at(i); + wl_buffer_damage(mBuffer->buffer(),rect.x(),rect.y(),rect.width(),rect.height()); + waylandWindow->damage(rect); + } } void QWaylandShmWindowSurface::resize(const QSize &size) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 333a953..e79a712 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -58,6 +58,7 @@ QWaylandWindow::QWaylandWindow(QWidget *window) : QPlatformWindow(window) + , mSurface(0) , mDisplay(QWaylandScreen::waylandScreenFromWidget(window)->display()) , mBuffer(0) , mWaitingForFrameSync(false) @@ -69,8 +70,6 @@ QWaylandWindow::QWaylandWindow(QWidget *window) mDisplay->windowManagerIntegration()->mapClientToProcess(qApp->applicationPid()); mDisplay->windowManagerIntegration()->authenticateWithToken(); #endif - - mSurface = mDisplay->createSurface(this); } QWaylandWindow::~QWaylandWindow() @@ -101,9 +100,7 @@ void QWaylandWindow::setVisible(bool visible) newSurfaceCreated(); } - if (visible) { - wl_surface_map_toplevel(mSurface); - } else { + if (!visible) { wl_surface_destroy(mSurface); mSurface = NULL; } @@ -130,25 +127,25 @@ void QWaylandWindow::attach(QWaylandBuffer *buffer) } } -void QWaylandWindow::damage(const QRegion ®ion) +void QWaylandWindow::damage(const QRect &rect) { //We have to do sync stuff before calling damage, or we might //get a frame callback before we get the timestamp - mDisplay->frameCallback(QWaylandWindow::frameCallback, mSurface, this); - mWaitingForFrameSync = true; - - QVector<QRect> rects = region.rects(); - for (int i = 0; i < rects.size(); i++) { - const QRect rect = rects.at(i); - wl_surface_damage(mSurface, - rect.x(), rect.y(), rect.width(), rect.height()); + if (!mWaitingForFrameSync) { + mDisplay->frameCallback(QWaylandWindow::frameCallback, mSurface, this); + mWaitingForFrameSync = true; } + + wl_surface_damage(mSurface, + rect.x(), rect.y(), rect.width(), rect.height()); } void QWaylandWindow::newSurfaceCreated() { if (mBuffer) { wl_surface_attach(mSurface,mBuffer->buffer(),0,0); + wl_surface_damage(mSurface, + 0,0,mBuffer->size().width(),mBuffer->size().height()); } } diff --git a/src/plugins/platforms/wayland/qwaylandwindow.h b/src/plugins/platforms/wayland/qwaylandwindow.h index b8eae96..b91f6b6 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.h +++ b/src/plugins/platforms/wayland/qwaylandwindow.h @@ -71,7 +71,7 @@ public: int32_t x, int32_t y, int32_t width, int32_t height); void attach(QWaylandBuffer *buffer); - void damage(const QRegion ®ion); + void damage(const QRect &rect); void waitForFrameSync(); diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland/wayland.pro index dca72fd..5b20a87 100644 --- a/src/plugins/platforms/wayland/wayland.pro +++ b/src/plugins/platforms/wayland/wayland.pro @@ -34,7 +34,10 @@ LIBS += $$QMAKE_LIBS_WAYLAND QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND !isEmpty(QMAKE_LFLAGS_RPATH) { - !isEmpty(QMAKE_LIBDIR_WAYLAND):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBDIR_WAYLAND} + WAYLAND_NEEDS_RPATH = $$system(pkg-config --libs-only-L wayland-client) + !isEmpty(WAYLAND_NEEDS_RPATH) { + !isEmpty(QMAKE_LIBDIR_WAYLAND):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBDIR_WAYLAND} + } } INCLUDEPATH += $$PWD diff --git a/src/plugins/platforms/wayland/wayland_sha1.txt b/src/plugins/platforms/wayland/wayland_sha1.txt index d262437..a696e76 100644 --- a/src/plugins/platforms/wayland/wayland_sha1.txt +++ b/src/plugins/platforms/wayland/wayland_sha1.txt @@ -1,3 +1,3 @@ This version of the Qt Wayland plugin is checked against the following sha1 from the Wayland repository: -eff7fc0d99be2e51eaa351785030c8d374ac71de +bfea3d6befdb688d5354e6f15a9400ea637febf9 diff --git a/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp b/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp index e4a6218..4236f39 100644 --- a/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp +++ b/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.cpp @@ -7,29 +7,29 @@ ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** ** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception +** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. ** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. ** ** ** diff --git a/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.h b/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.h index a79f205..0e3781d 100644 --- a/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.h +++ b/src/plugins/platforms/wayland/windowmanager_integration/qwaylandwindowmanagerintegration.h @@ -7,29 +7,29 @@ ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** ** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception +** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. ** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. ** ** ** diff --git a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp index abc60e1..283f7d4 100644 --- a/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp +++ b/src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp @@ -125,7 +125,13 @@ void QTcpServerConnection::disconnect() bool QTcpServerConnection::waitForMessage() { Q_D(QTcpServerConnection); - return d->protocol->waitForReadyRead(-1); + if (d->protocol->packetsAvailable() > 0) { + QPacket packet = d->protocol->read(); + d->debugServer->receiveMessage(packet.data()); + return true; + } else { + return d->protocol->waitForReadyRead(-1); + } } void QTcpServerConnection::setPort(int port, bool block) @@ -145,10 +151,11 @@ void QTcpServerConnection::listen() d->tcpServer = new QTcpServer(this); QObject::connect(d->tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection())); - if (d->tcpServer->listen(QHostAddress::Any, d->port)) + if (d->tcpServer->listen(QHostAddress::Any, d->port)) { qWarning("QDeclarativeDebugServer: Waiting for connection on port %d...", d->port); - else + } else { qWarning("QDeclarativeDebugServer: Unable to listen on port %d", d->port); + } } @@ -158,10 +165,10 @@ void QTcpServerConnection::readyRead() if (!d->protocol) return; - QPacket packet = d->protocol->read(); - - QByteArray content = packet.data(); - d->debugServer->receiveMessage(content); + while (d->protocol->packetsAvailable() > 0) { + QPacket packet = d->protocol->read(); + d->debugServer->receiveMessage(packet.data()); + } } void QTcpServerConnection::newConnection() diff --git a/src/plugins/s60/feedback/feedback.pro b/src/plugins/s60/feedback/feedback.pro new file mode 100644 index 0000000..1069220 --- /dev/null +++ b/src/plugins/s60/feedback/feedback.pro @@ -0,0 +1,18 @@ +include(../../qpluginbase.pri) + +TARGET = qtactilefeedback$${QT_LIBINFIX} + +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/s60/feedback + +INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + +contains(S60_VERSION, 5.0)|contains(S60_VERSION, symbian3) { + HEADERS += qtactileFeedback.h + SOURCES += qtactileFeedback_s60.cpp + + LIBS += -ltouchfeedback +} + +load(data_caging_paths) + +TARGET.UID3=0x200315B4 diff --git a/src/plugins/s60/feedback/qtactileFeedback.h b/src/plugins/s60/feedback/qtactileFeedback.h new file mode 100644 index 0000000..335feed --- /dev/null +++ b/src/plugins/s60/feedback/qtactileFeedback.h @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QEvent> +#include <QWidget> + +#include "private/qs60style_feedbackinterface_p.h" + +class QTactileFeedback : public TactileFeedbackInterface +{ + Q_OBJECT + Q_INTERFACES(TactileFeedbackInterface) + + public: + void touchFeedback(QEvent *event, const QWidget *widget); + }; diff --git a/src/plugins/s60/feedback/qtactileFeedback_s60.cpp b/src/plugins/s60/feedback/qtactileFeedback_s60.cpp new file mode 100644 index 0000000..b30baf5 --- /dev/null +++ b/src/plugins/s60/feedback/qtactileFeedback_s60.cpp @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QApplication> +#include <QObject> +#include <QSlider> +#include <QScrollBar> + +#include <QtCore/qplugin.h> +#include "qtactileFeedback.h" + +#include <touchfeedback.h> + +void QTactileFeedback::touchFeedback(QEvent *event, const QWidget *widget) +{ + //Lets share the global instance for touch feedback (you are NOT allowed to try and delete it!). + MTouchFeedback* feedback = MTouchFeedback::Instance(); + + //If the widget itself is not handling focus, try to use focusProxy widget. + const QWidget *w = ((widget->focusPolicy() == Qt::NoFocus) && (widget->focusProxy())) ? widget->focusProxy() : widget; + + //Only give tactile feedback for enabled widgets that take focus. + if (feedback && w && w->isEnabled() && w->isWidgetType() && w->isVisible()) { + //Scrollbars are 'special' that they don't take focus (nor they have focusProxy), yet we'd like to have tactile feedback for them + if (w->focusPolicy() == Qt::NoFocus) + if (!qobject_cast<const QScrollBar *>(w)) + return; + + //Don't give tactile feedback for widgets that are outside topmost dialog. + QWidget *dialog = QApplication::activeModalWidget(); + if (dialog) { + QList<const QWidget *> allChildren = dialog->findChildren<const QWidget *>(); + if (!allChildren.contains(w)) + return; + } + + //Widget specific tactile feedback. + if (qobject_cast<const QSlider *>(w) || qobject_cast<const QScrollBar *>(w)) + feedback->InstantFeedback(ETouchFeedbackSensitive); + else + feedback->InstantFeedback(ETouchFeedbackBasic); + } +} + +Q_EXPORT_PLUGIN2("feedback", QTactileFeedback); |