diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-29 08:02:38 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-29 08:02:38 (GMT) |
commit | 6b3f2a3b96d01dc339d07a076300d29616603b28 (patch) | |
tree | 1681542fa9b680811c84f0efa13502d848d58a4c | |
parent | 9d6c186f418ea77f202404408aa6692805038bea (diff) | |
parent | ba21727195a1e7a98c731d1357a00d7b7bc058b6 (diff) | |
download | Qt-6b3f2a3b96d01dc339d07a076300d29616603b28.zip Qt-6b3f2a3b96d01dc339d07a076300d29616603b28.tar.gz Qt-6b3f2a3b96d01dc339d07a076300d29616603b28.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging:
Fix vertical positioning of glyphs in raster engine with FreeType
Ensure a small event check interval on uikit platform.
Change default application font for uikit platform.
Use the QPoint memory layout change only on Desktop Mac
Fix 2cb398e1d901e62384bb2b388761cfd18fc8804a in case of no coreservices
Add IPHONEOS deployment vars to makespec
Post key events via QWindowSystemInterface, don't post events direcly
Use nicer fonts and a few little patches to uikit platform.
Update README and qmlapplicationviewer to suit 4.8.
Updated proof-of-concept UIKit mkspecs
25 files changed, 236 insertions, 225 deletions
diff --git a/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf b/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf new file mode 100644 index 0000000..d69f58d --- /dev/null +++ b/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf @@ -0,0 +1,61 @@ +# +# qmake configuration for iphone-device-g++ +# +include(../../common/mac.conf) +include(../../common/gcc-base-macx.conf) +include(../../common/g++-macx.conf) + +MAKEFILE_GENERATOR = UNIX +TEMPLATE = app +CONFIG += qt warn_on release incremental global_init_link_order lib_version_first plugin_no_soname link_prl +QT += core gui +QMAKE_INCREMENTAL_STYLE = sublib + +# Build everything as static libs +CONFIG += static +CONFIG -= app_bundle + +# This is Apple Darwin without the Carbon framework +DEFINES += DARWIN_NO_CARBON + +# Do not compile a few things +DEFINES += QT_NO_AUDIO_BACKEND + +# You may need to change this to point to the iOS SDK you want to use. +QMAKE_IOS_DEV_PATH = /Developer/Platforms/iPhoneOS.platform/Developer +QMAKE_IOS_SDK = $$QMAKE_IOS_DEV_PATH/SDKs/iPhoneOS4.3.sdk + +# Set up deployment targets +QMAKE_IPHONEOS_DEPLOYMENT_TARGET = 4.0 +QMAKE_MACOSX_DEPLOYMENT_TARGET = + +QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_IOS_SDK/System/Library/Frameworks/OpenGLES.framework/Headers +QMAKE_LIBDIR_OPENGL_ES1 = +QMAKE_LIBS_OPENGL_ES1 += -framework OpenGLES + +QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_IOS_SDK/System/Library/Frameworks/OpenGLES.framework/Headers +QMAKE_LIBDIR_OPENGL_ES2 = +QMAKE_LIBS_OPENGL_ES2 += -framework OpenGLES + +# TARGET_PLATFORM = ios +QMAKE_CC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 +QMAKE_CXX = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 +QMAKE_LINK = $$QMAKE_CXX +QMAKE_LINK_SHLIB = $$QMAKE_CXX + +QMAKE_CFLAGS += -arch armv7 -marm -isysroot $$QMAKE_IOS_SDK -fmessage-length=0 -fexceptions -miphoneos-version-min=4.2 +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden +QMAKE_OBJECTIVE_CFLAGS += -arch armv7 -marm -isysroot $$QMAKE_IOS_SDK -fmessage-length=0 -fexceptions -miphoneos-version-min=4.2 +QMAKE_LFLAGS += -arch armv7 -marm -miphoneos-version-min=4.2 -Wl,-syslibroot,$$QMAKE_IOS_SDK +QMAKE_LFLAGS += -framework Foundation -framework UIKit -framework QuartzCore -lz + +QMAKE_INCDIR_OPENGL = +QMAKE_LIBS_OPENGL = +QMAKE_LIBS_OPENGL_QT = + +#QMAKE_RESOURCE = +QMAKE_FIX_RPATH = $$QMAKE_IOS_DEV_PATH/usr/bin/install_name_tool -id +QMAKE_AR = $$QMAKE_IOS_DEV_PATH/usr/bin/ar cq +QMAKE_RANLIB = $$QMAKE_IOS_DEV_PATH/usr/bin/ranlib -s + +load(qt_config) diff --git a/mkspecs/qws/macx-iphonesimulator-g++/qplatformdefs.h b/mkspecs/qpa/macx-iphonedevice-g++/qplatformdefs.h index 629d57f..629d57f 100644 --- a/mkspecs/qws/macx-iphonesimulator-g++/qplatformdefs.h +++ b/mkspecs/qpa/macx-iphonedevice-g++/qplatformdefs.h diff --git a/mkspecs/qpa/macx-iphonesimulator-g++/qmake.conf b/mkspecs/qpa/macx-iphonesimulator-g++/qmake.conf new file mode 100644 index 0000000..481a268 --- /dev/null +++ b/mkspecs/qpa/macx-iphonesimulator-g++/qmake.conf @@ -0,0 +1,62 @@ +# +# qmake configuration for iphone-simulator-g++ +# +include(../../common/mac.conf) +include(../../common/gcc-base-macx.conf) +include(../../common/g++-macx.conf) + +MAKEFILE_GENERATOR = UNIX +TEMPLATE = app +CONFIG += qt warn_on release incremental global_init_link_order lib_version_first plugin_no_soname link_prl +QT += core gui +QMAKE_INCREMENTAL_STYLE = sublib + +# Build everything as static libs +CONFIG += static +CONFIG -= app_bundle + +# This is Apple Darwin without the Carbon framework +DEFINES += DARWIN_NO_CARBON + +# Do not compile a few things +DEFINES += QT_NO_AUDIO_BACKEND + +# You may need to change this to point to the iOS SDK you want to use. +QMAKE_IOS_DEV_PATH = /Developer/Platforms/iPhoneSimulator.platform/Developer +QMAKE_IOS_SDK = $$QMAKE_IOS_DEV_PATH/SDKs/iPhoneSimulator4.2.sdk + +# Set up deployment targets +QMAKE_IPHONEOS_DEPLOYMENT_TARGET = 4.0 +QMAKE_MACOSX_DEPLOYMENT_TARGET = + +QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_IOS_SDK/System/Library/Frameworks/OpenGLES.framework/Headers +QMAKE_LIBDIR_OPENGL_ES1 = +QMAKE_LIBS_OPENGL_ES1 += -framework OpenGLES + +QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_IOS_SDK/System/Library/Frameworks/OpenGLES.framework/Headers +QMAKE_LIBDIR_OPENGL_ES2 = +QMAKE_LIBS_OPENGL_ES2 += -framework OpenGLES + +# TARGET_PLATFORM = ios +QMAKE_CC = /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 +QMAKE_CXX = /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 +QMAKE_LINK = $$QMAKE_CXX +QMAKE_LINK_SHLIB = $$QMAKE_CXX + +QMAKE_CFLAGS += -arch i386 -isysroot $$QMAKE_IOS_SDK -fmessage-length=0 -fexceptions -miphoneos-version-min=4.2 +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden +QMAKE_OBJECTIVE_CFLAGS += -arch i386 -isysroot $$QMAKE_IOS_SDK -fmessage-length=0 -fexceptions -miphoneos-version-min=4.2 +QMAKE_OBJECTIVE_CFLAGS_X86 += -arch i386 -isysroot $$QMAKE_IOS_SDK -fmessage-length=0 -fexceptions -miphoneos-version-min=4.2 +QMAKE_LFLAGS += -arch i386 -Wl,-syslibroot,$$QMAKE_IOS_SDK +QMAKE_LFLAGS += -framework Foundation -framework UIKit -framework QuartzCore -lz + +QMAKE_INCDIR_OPENGL = +QMAKE_LIBS_OPENGL = +QMAKE_LIBS_OPENGL_QT = + +#QMAKE_RESOURCE = +QMAKE_FIX_RPATH = $$QMAKE_IOS_DEV_PATH/usr/bin/install_name_tool -id +QMAKE_AR = $$QMAKE_IOS_DEV_PATH/usr/bin/ar cq +QMAKE_RANLIB = $$QMAKE_IOS_DEV_PATH/usr/bin/ranlib -s + +load(qt_config) diff --git a/mkspecs/qws/macx-iphonedevice-g++/qplatformdefs.h b/mkspecs/qpa/macx-iphonesimulator-g++/qplatformdefs.h index 629d57f..629d57f 100644 --- a/mkspecs/qws/macx-iphonedevice-g++/qplatformdefs.h +++ b/mkspecs/qpa/macx-iphonesimulator-g++/qplatformdefs.h diff --git a/mkspecs/qws/macx-iphonedevice-g++/Info.plist.lib b/mkspecs/qws/macx-iphonedevice-g++/Info.plist.lib deleted file mode 100644 index 97609ed..0000000 --- a/mkspecs/qws/macx-iphonedevice-g++/Info.plist.lib +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> -<plist version="0.9"> -<dict> - <key>CFBundlePackageType</key> - <string>FMWK</string> - <key>CFBundleShortVersionString</key> - <string>@SHORT_VERSION@</string> - <key>CFBundleGetInfoString</key> - <string>Created by Qt/QMake</string> - <key>CFBundleSignature</key> - <string>@TYPEINFO@</string> - <key>CFBundleExecutable</key> - <string>@LIBRARY@</string> - <key>NOTE</key> - <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> -</dict> -</plist> diff --git a/mkspecs/qws/macx-iphonedevice-g++/qmake.conf b/mkspecs/qws/macx-iphonedevice-g++/qmake.conf deleted file mode 100644 index 227d24e..0000000 --- a/mkspecs/qws/macx-iphonedevice-g++/qmake.conf +++ /dev/null @@ -1,48 +0,0 @@ -# -# qmake configuration for iphone-device-g++ -# -include(../../common/mac.conf) -include(../../common/gcc-base-macx.conf) -include(../../common/g++-macx.conf) - -MAKEFILE_GENERATOR = UNIX -TEMPLATE = app -CONFIG += qt warn_on release app_bundle incremental global_init_link_order lib_version_first plugin_no_soname link_prl -QT += core gui -QMAKE_INCREMENTAL_STYLE = sublib - -# Do not compile a few things -DEFINES += QT_NO_AUDIO_BACKEND QT_NO_NETWORKPROXY QT_NO_FILESYSTEMWATCHER - -# You may need to change this to point to the iOS SDK you want to use. -QMAKE_IOS_DEV_PATH = /Developer/Platforms/iPhoneOS.platform/Developer -QMAKE_IOS_SDK = $$QMAKE_IOS_DEV_PATH/SDKs/iPhoneOS4.3.sdk -DEFINES += __IPHONE_OS_VERSION_MIN_REQUIRED=40200 - -#clear -QMAKE_MACOSX_DEPLOYMENT_TARGET = - -QMAKE_LIBS_OPENGL_ES1 += -framework OpenGLES -QMAKE_LIBS_OPENGL_ES2 += -framework OpenGLES - -# TARGET_PLATFORM = ios -QMAKE_CC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -QMAKE_CXX = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 -QMAKE_LINK = $$QMAKE_CXX -QMAKE_LINK_SHLIB = $$QMAKE_CXX - -QMAKE_CFLAGS += -arch armv7 -marm -isysroot $$QMAKE_IOS_SDK -fmessage-length=0 -fexceptions -miphoneos-version-min=4.2 -QMAKE_CXXFLAGS += $$QMAKE_CFLAGS -QMAKE_OBJECTIVE_CFLAGS += -arch armv7 -marm -isysroot $$QMAKE_IOS_SDK -fmessage-length=0 -fexceptions -miphoneos-version-min=4.2 -fobjc-abi-version=2 -fobjc-legacy-dispatch -QMAKE_LFLAGS += -arch armv7 -marm -miphoneos-version-min=4.2 -Wl,-syslibroot,$$QMAKE_IOS_SDK - -QMAKE_INCDIR_OPENGL = -QMAKE_LIBS_OPENGL = -QMAKE_LIBS_OPENGL_QT = - -#QMAKE_RESOURCE = -QMAKE_FIX_RPATH = $$QMAKE_IOS_DEV_PATH/usr/bin/install_name_tool -id -QMAKE_AR = $$QMAKE_IOS_DEV_PATH/usr/bin/ar cq -QMAKE_RANLIB = $$QMAKE_IOS_DEV_PATH/usr/bin/ranlib -s - -load(qt_config) diff --git a/mkspecs/qws/macx-iphonesimulator-g++/Info.plist.lib b/mkspecs/qws/macx-iphonesimulator-g++/Info.plist.lib deleted file mode 100644 index 97609ed..0000000 --- a/mkspecs/qws/macx-iphonesimulator-g++/Info.plist.lib +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> -<plist version="0.9"> -<dict> - <key>CFBundlePackageType</key> - <string>FMWK</string> - <key>CFBundleShortVersionString</key> - <string>@SHORT_VERSION@</string> - <key>CFBundleGetInfoString</key> - <string>Created by Qt/QMake</string> - <key>CFBundleSignature</key> - <string>@TYPEINFO@</string> - <key>CFBundleExecutable</key> - <string>@LIBRARY@</string> - <key>NOTE</key> - <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string> -</dict> -</plist> diff --git a/mkspecs/qws/macx-iphonesimulator-g++/qmake.conf b/mkspecs/qws/macx-iphonesimulator-g++/qmake.conf deleted file mode 100644 index 93c4786..0000000 --- a/mkspecs/qws/macx-iphonesimulator-g++/qmake.conf +++ /dev/null @@ -1,49 +0,0 @@ -# -# qmake configuration for macx-g++ -# -include(../../common/mac.conf) -include(../../common/gcc-base-macx.conf) -include(../../common/g++-macx.conf) - -MAKEFILE_GENERATOR = UNIX -TEMPLATE = app -CONFIG += qt warn_on release app_bundle incremental global_init_link_order lib_version_first plugin_no_soname link_prl -QT += core gui -QMAKE_INCREMENTAL_STYLE = sublib - -# Do not compile a few things -DEFINES += QT_NO_AUDIO_BACKEND QT_NO_NETWORKPROXY QT_NO_FILESYSTEMWATCHER - -# You may need to change this to point to the iOS SDK you want to use. -QMAKE_IOS_DEV_PATH = /Developer/Platforms/iPhoneSimulator.platform/Developer -QMAKE_IOS_SDK = $$QMAKE_IOS_DEV_PATH/SDKs/iPhoneSimulator4.2.sdk -DEFINES += __IPHONE_OS_VERSION_MIN_REQUIRED=40200 -#clear -QMAKE_MACOSX_DEPLOYMENT_TARGET = - -QMAKE_LIBS_OPENGL_ES1 += -framework OpenGLES -QMAKE_LIBS_OPENGL_ES2 += -framework OpenGLES - -# TARGET_PLATFORM = ios -QMAKE_CC = /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -QMAKE_CXX = /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 -QMAKE_LINK = $$QMAKE_CXX -QMAKE_LINK_SHLIB = $$QMAKE_CXX - -QMAKE_CFLAGS += -arch i386 -isysroot $$QMAKE_IOS_SDK -QMAKE_CXXFLAGS += $$QMAKE_CFLAGS -QMAKE_OBJECTIVE_CFLAGS += -arch i386 -isysroot $$QMAKE_IOS_SDK -fobjc-abi-version=2 -fobjc-legacy-dispatch -QMAKE_LFLAGS += -arch i386 -Wl,-syslibroot,$$QMAKE_IOS_SDK - -QMAKE_INCDIR_OPENGL = -QMAKE_LIBS_OPENGL = -QMAKE_LIBS_OPENGL_QT = - -#QMAKE_RESOURCE = -QMAKE_FIX_RPATH = $$QMAKE_IOS_DEV_PATH/usr/bin/install_name_tool -id -QMAKE_AR = $$QMAKE_IOS_DEV_PATH/usr/bin/ar cq -QMAKE_RANLIB = $$QMAKE_IOS_DEV_PATH/usr/bin/ranlib -s - -load(qt_config) - -QMAKE_OBJECTIVE_CFLAGS_X86 += -arch i386 -isysroot $$QMAKE_IOS_SDK -fobjc-abi-version=2 -fobjc-legacy-dispatch diff --git a/src/corelib/kernel/qcore_mac.cpp b/src/corelib/kernel/qcore_mac.cpp index e705c31..490031f 100644 --- a/src/corelib/kernel/qcore_mac.cpp +++ b/src/corelib/kernel/qcore_mac.cpp @@ -87,6 +87,7 @@ QCFString::operator CFStringRef() const } +#ifndef QT_NO_CORESERVICES void qt_mac_to_pascal_string(const QString &s, Str255 str, TextEncoding encoding, int len) { if(len == -1) @@ -135,5 +136,6 @@ OSErr qt_mac_create_fsspec(const QString &file, FSSpec *spec) ret = FSGetCatalogInfo(&fsref, kFSCatInfoNone, 0, 0, spec, 0); return ret; } +#endif // QT_NO_CORESERVICES QT_END_NAMESPACE diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h index 4b8c16f..df269ec 100644 --- a/src/corelib/kernel/qcore_mac_p.h +++ b/src/corelib/kernel/qcore_mac_p.h @@ -148,12 +148,15 @@ private: QString string; }; + +#ifndef QT_NO_CORESERVICES Q_CORE_EXPORT void qt_mac_to_pascal_string(const QString &s, Str255 str, TextEncoding encoding = 0, int len = -1); Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr); Q_CORE_EXPORT OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref); // Don't use this function, it won't work in 10.5 (Leopard) and up Q_CORE_EXPORT OSErr qt_mac_create_fsspec(const QString &file, FSSpec *spec); +#endif // QT_NO_CORESERVICES QT_END_NAMESPACE diff --git a/src/corelib/tools/qpoint.h b/src/corelib/tools/qpoint.h index c0cf219..9f03606 100644 --- a/src/corelib/tools/qpoint.h +++ b/src/corelib/tools/qpoint.h @@ -93,7 +93,7 @@ public: private: friend class QTransform; // ### Qt 5; remove the ifdef and just have the same order on all platforms. -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) int yp; int xp; #else diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 30553b5..9ba4592 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2774,10 +2774,12 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, { Q_D(QRasterPaintEngine); QRasterPaintEngineState *s = state(); + const QFixed offs = QFixed::fromReal(aliasedCoordinateDelta); #if !defined(QT_NO_FREETYPE) if (fontEngine->type() == QFontEngine::Freetype) { QFontEngineFT *fe = static_cast<QFontEngineFT *>(fontEngine); + const QFixed xOffs = fe->supportsSubPixelPositions() ? 0 : offs; QFontEngineFT::GlyphFormat neededFormat = painter()->device()->devType() == QInternal::Widget ? fe->defaultGlyphFormat() @@ -2851,8 +2853,8 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, }; alphaPenBlt(glyph->data, pitch, depth, - qFloor(positions[i].x) + glyph->x, - qFloor(positions[i].y) - glyph->y, + qFloor(positions[i].x + xOffs) + glyph->x, + qFloor(positions[i].y + offs) - glyph->y, glyph->width, glyph->height); } if (lockedFace) @@ -2892,7 +2894,6 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, rightShift = 3; // divide by 8 int margin = cache->glyphMargin(); - const QFixed offs = QFixed::fromReal(aliasedCoordinateDelta); const uchar *bits = image.bits(); for (int i=0; i<numGlyphs; ++i) { 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 |