From 8a11d317d04beebde7bfb22e5e51ec17e2248e8c Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 21 Jun 2011 11:02:14 +0200 Subject: Updated proof-of-concept UIKit mkspecs Merge-request: 1275 Reviewed-by: con --- mkspecs/qpa/macx-iphonedevice-g++/qmake.conf | 60 +++++++++++++ mkspecs/qpa/macx-iphonedevice-g++/qplatformdefs.h | 99 ++++++++++++++++++++++ mkspecs/qpa/macx-iphonesimulator-g++/qmake.conf | 61 +++++++++++++ .../qpa/macx-iphonesimulator-g++/qplatformdefs.h | 99 ++++++++++++++++++++++ mkspecs/qws/macx-iphonedevice-g++/Info.plist.lib | 18 ---- mkspecs/qws/macx-iphonedevice-g++/qmake.conf | 48 ----------- mkspecs/qws/macx-iphonedevice-g++/qplatformdefs.h | 99 ---------------------- .../qws/macx-iphonesimulator-g++/Info.plist.lib | 18 ---- mkspecs/qws/macx-iphonesimulator-g++/qmake.conf | 49 ----------- .../qws/macx-iphonesimulator-g++/qplatformdefs.h | 99 ---------------------- 10 files changed, 319 insertions(+), 331 deletions(-) create mode 100644 mkspecs/qpa/macx-iphonedevice-g++/qmake.conf create mode 100644 mkspecs/qpa/macx-iphonedevice-g++/qplatformdefs.h create mode 100644 mkspecs/qpa/macx-iphonesimulator-g++/qmake.conf create mode 100644 mkspecs/qpa/macx-iphonesimulator-g++/qplatformdefs.h delete mode 100644 mkspecs/qws/macx-iphonedevice-g++/Info.plist.lib delete mode 100644 mkspecs/qws/macx-iphonedevice-g++/qmake.conf delete mode 100644 mkspecs/qws/macx-iphonedevice-g++/qplatformdefs.h delete mode 100644 mkspecs/qws/macx-iphonesimulator-g++/Info.plist.lib delete mode 100644 mkspecs/qws/macx-iphonesimulator-g++/qmake.conf delete mode 100644 mkspecs/qws/macx-iphonesimulator-g++/qplatformdefs.h diff --git a/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf b/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf new file mode 100644 index 0000000..b11c2d7 --- /dev/null +++ b/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf @@ -0,0 +1,60 @@ +# +# 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 + +#clear +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/qpa/macx-iphonedevice-g++/qplatformdefs.h b/mkspecs/qpa/macx-iphonedevice-g++/qplatformdefs.h new file mode 100644 index 0000000..629d57f --- /dev/null +++ b/mkspecs/qpa/macx-iphonedevice-g++/qplatformdefs.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec 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$ +** +****************************************************************************/ + +#ifndef QPLATFORMDEFS_H +#define QPLATFORMDEFS_H + +// Get Qt defines/settings + +#include "qglobal.h" + +// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs + +#include + + +// We are hot - unistd.h should have turned on the specific APIs we requested + + +#include +#include +#include +#include +#include +#include +#define QT_NO_LIBRARY_UNLOAD + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef QT_NO_IPV6IFNAME +#include +#endif + +#include "../../common/posix/qplatformdefs.h" + +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE + +#define QT_OPEN_LARGEFILE 0 + +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) +#define QT_SOCKLEN_T socklen_t +#else +#define QT_SOCKLEN_T int +#endif + +#define QT_SIGNAL_IGNORE (void (*)(int))1 + +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf + +#define QT_QPA_DEFAULT_PLATFORM_NAME "uikit" + +#endif // 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..8098dbf --- /dev/null +++ b/mkspecs/qpa/macx-iphonesimulator-g++/qmake.conf @@ -0,0 +1,61 @@ +# +# 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 + +#clear +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/qpa/macx-iphonesimulator-g++/qplatformdefs.h b/mkspecs/qpa/macx-iphonesimulator-g++/qplatformdefs.h new file mode 100644 index 0000000..629d57f --- /dev/null +++ b/mkspecs/qpa/macx-iphonesimulator-g++/qplatformdefs.h @@ -0,0 +1,99 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec 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$ +** +****************************************************************************/ + +#ifndef QPLATFORMDEFS_H +#define QPLATFORMDEFS_H + +// Get Qt defines/settings + +#include "qglobal.h" + +// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs + +#include + + +// We are hot - unistd.h should have turned on the specific APIs we requested + + +#include +#include +#include +#include +#include +#include +#define QT_NO_LIBRARY_UNLOAD + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef QT_NO_IPV6IFNAME +#include +#endif + +#include "../../common/posix/qplatformdefs.h" + +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE + +#define QT_OPEN_LARGEFILE 0 + +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) +#define QT_SOCKLEN_T socklen_t +#else +#define QT_SOCKLEN_T int +#endif + +#define QT_SIGNAL_IGNORE (void (*)(int))1 + +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf + +#define QT_QPA_DEFAULT_PLATFORM_NAME "uikit" + +#endif // 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 @@ - - - - - CFBundlePackageType - FMWK - CFBundleShortVersionString - @SHORT_VERSION@ - CFBundleGetInfoString - Created by Qt/QMake - CFBundleSignature - @TYPEINFO@ - CFBundleExecutable - @LIBRARY@ - NOTE - Please, do NOT change this file -- It was generated by Qt/QMake. - - 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-iphonedevice-g++/qplatformdefs.h b/mkspecs/qws/macx-iphonedevice-g++/qplatformdefs.h deleted file mode 100644 index 629d57f..0000000 --- a/mkspecs/qws/macx-iphonedevice-g++/qplatformdefs.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the qmake spec 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$ -** -****************************************************************************/ - -#ifndef QPLATFORMDEFS_H -#define QPLATFORMDEFS_H - -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -#include - - -// We are hot - unistd.h should have turned on the specific APIs we requested - - -#include -#include -#include -#include -#include -#include -#define QT_NO_LIBRARY_UNLOAD - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef QT_NO_IPV6IFNAME -#include -#endif - -#include "../../common/posix/qplatformdefs.h" - -#undef QT_OPEN_LARGEFILE -#undef QT_SOCKLEN_T -#undef QT_SIGNAL_IGNORE - -#define QT_OPEN_LARGEFILE 0 - -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t -#else -#define QT_SOCKLEN_T int -#endif - -#define QT_SIGNAL_IGNORE (void (*)(int))1 - -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf - -#define QT_QPA_DEFAULT_PLATFORM_NAME "uikit" - -#endif // QPLATFORMDEFS_H 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 @@ - - - - - CFBundlePackageType - FMWK - CFBundleShortVersionString - @SHORT_VERSION@ - CFBundleGetInfoString - Created by Qt/QMake - CFBundleSignature - @TYPEINFO@ - CFBundleExecutable - @LIBRARY@ - NOTE - Please, do NOT change this file -- It was generated by Qt/QMake. - - 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/mkspecs/qws/macx-iphonesimulator-g++/qplatformdefs.h b/mkspecs/qws/macx-iphonesimulator-g++/qplatformdefs.h deleted file mode 100644 index 629d57f..0000000 --- a/mkspecs/qws/macx-iphonesimulator-g++/qplatformdefs.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the qmake spec 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$ -** -****************************************************************************/ - -#ifndef QPLATFORMDEFS_H -#define QPLATFORMDEFS_H - -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -#include - - -// We are hot - unistd.h should have turned on the specific APIs we requested - - -#include -#include -#include -#include -#include -#include -#define QT_NO_LIBRARY_UNLOAD - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef QT_NO_IPV6IFNAME -#include -#endif - -#include "../../common/posix/qplatformdefs.h" - -#undef QT_OPEN_LARGEFILE -#undef QT_SOCKLEN_T -#undef QT_SIGNAL_IGNORE - -#define QT_OPEN_LARGEFILE 0 - -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t -#else -#define QT_SOCKLEN_T int -#endif - -#define QT_SIGNAL_IGNORE (void (*)(int))1 - -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf - -#define QT_QPA_DEFAULT_PLATFORM_NAME "uikit" - -#endif // QPLATFORMDEFS_H -- cgit v0.12 From cad13a0bbe738a71b9716cb6676c4f11521f0030 Mon Sep 17 00:00:00 2001 From: con Date: Mon, 27 Jun 2011 14:16:11 +0200 Subject: Update README and qmlapplicationviewer to suit 4.8. --- src/plugins/platforms/uikit/README | 4 +- .../platforms/uikit/examples/qmltest/main.mm | 2 +- .../moc_qmlapplicationviewer.cpp | 110 ------------ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 196 -------------------- .../qmlapplicationviewer/qmlapplicationviewer.h | 80 --------- .../qmltest/qmltest.xcodeproj/project.pbxproj | 28 +-- .../moc_qmlapplicationviewer.cpp | 122 +++++++++++++ .../qmlapplicationviewer/qmlapplicationviewer.cpp | 198 +++++++++++++++++++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 83 +++++++++ 9 files changed, 420 insertions(+), 403 deletions(-) delete mode 100644 src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/moc_qmlapplicationviewer.cpp delete mode 100644 src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.cpp delete mode 100644 src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/moc_qmlapplicationviewer.cpp create mode 100644 src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.h 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 -#include "qmlapplicationviewer/qmlapplicationviewer.h" +#include "../share/qmlapplicationviewer/qmlapplicationviewer.h" #include #include diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/moc_qmlapplicationviewer.cpp b/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/moc_qmlapplicationviewer.cpp deleted file mode 100644 index a5c02be..0000000 --- a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/moc_qmlapplicationviewer.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins 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$ -** -****************************************************************************/ - -/**************************************************************************** -** 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) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#include "qmlapplicationviewer.h" -#if !defined(Q_MOC_OUTPUT_REVISION) -#error "The header file 'qmlapplicationviewer.h' doesn't include ." -#elif Q_MOC_OUTPUT_REVISION != 62 -#error "This file was generated using the moc from 4.7.2. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" -#endif - -QT_BEGIN_MOC_NAMESPACE -static const uint qt_meta_data_QmlApplicationViewer[] = { - - // content: - 5, // revision - 0, // classname - 0, 0, // classinfo - 0, 0, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - 0, // flags - 0, // signalCount - - 0 // eod -}; - -static const char qt_meta_stringdata_QmlApplicationViewer[] = { - "QmlApplicationViewer\0" -}; - -const QMetaObject QmlApplicationViewer::staticMetaObject = { - { &QDeclarativeView::staticMetaObject, qt_meta_stringdata_QmlApplicationViewer, - qt_meta_data_QmlApplicationViewer, 0 } -}; - -#ifdef Q_NO_DATA_RELOCATION -const QMetaObject &QmlApplicationViewer::getStaticMetaObject() { return staticMetaObject; } -#endif //Q_NO_DATA_RELOCATION - -const QMetaObject *QmlApplicationViewer::metaObject() const -{ - return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; -} - -void *QmlApplicationViewer::qt_metacast(const char *_clname) -{ - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_QmlApplicationViewer)) - return static_cast(const_cast< QmlApplicationViewer*>(this)); - return QDeclarativeView::qt_metacast(_clname); -} - -int QmlApplicationViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QDeclarativeView::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - return _id; -} -QT_END_MOC_NAMESPACE diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.cpp b/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.cpp deleted file mode 100644 index 47d0870..0000000 --- a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins 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$ -** -****************************************************************************/ - -// checksum 0x17fa version 0x3000a -/* - This file was generated by the Qt Quick Application wizard of Qt Creator. - QmlApplicationViewer is a convenience class containing mobile device specific - code such as screen orientation handling. Also QML paths and debugging are - handled here. - It is recommended not to modify this file, since newer versions of Qt Creator - may offer an updated version of it. -*/ - -#include "qmlapplicationviewer.h" - -#include -#include -#include -#include -#include -#include - -#if defined(QMLJSDEBUGGER) -#include -#endif - -#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) -#include -#endif -#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) -#include -#endif - -#if defined(QMLJSDEBUGGER) - -// Enable debugging before any QDeclarativeEngine is created -struct QmlJsDebuggingEnabler -{ - QmlJsDebuggingEnabler() - { - QDeclarativeDebugHelper::enableDebugging(); - } -}; - -// Execute code in constructor before first QDeclarativeEngine is instantiated -static QmlJsDebuggingEnabler enableDebuggingHelper; - -#endif // QMLJSDEBUGGER - -class QmlApplicationViewerPrivate -{ - QString mainQmlFile; - friend class QmlApplicationViewer; - static QString adjustPath(const QString &path); -}; - -QString QmlApplicationViewerPrivate::adjustPath(const QString &path) -{ -#ifdef Q_OS_UNIX -#ifdef Q_OS_MAC - if (!QDir::isAbsolutePath(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; -#endif -#endif - return path; -} - -QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : - QDeclarativeView(parent), - m_d(new QmlApplicationViewerPrivate) -{ - connect(engine(), SIGNAL(quit()), SLOT(close())); - setResizeMode(QDeclarativeView::SizeRootObjectToView); -#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER) - new QmlJSDebugger::JSDebuggerAgent(engine()); -#endif -#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER) - new QmlJSDebugger::QDeclarativeViewObserver(this, parent); -#endif -} - -QmlApplicationViewer::~QmlApplicationViewer() -{ - delete m_d; -} - -void QmlApplicationViewer::setMainQmlFile(const QString &file) -{ - m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file); - setSource(QUrl::fromLocalFile(m_d->mainQmlFile)); -} - -void QmlApplicationViewer::addImportPath(const QString &path) -{ - engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path)); -} - -void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) -{ -//#if defined(Q_OS_SYMBIAN) -// // If the version of Qt on the device is < 4.7.2, that attribute won't work -// if (orientation != ScreenOrientationAuto) { -// const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.')); -// if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) { -// qWarning("Screen orientation locking only supported with Qt 4.7.2 and above"); -// return; -// } -// } -//#endif // Q_OS_SYMBIAN -// -// Qt::WidgetAttribute attribute; -// switch (orientation) { -//#if QT_VERSION < 0x040702 -// // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes -// case ScreenOrientationLockPortrait: -// attribute = static_cast(128); -// break; -// case ScreenOrientationLockLandscape: -// attribute = static_cast(129); -// break; -// default: -// case ScreenOrientationAuto: -// attribute = static_cast(130); -// break; -//#else // QT_VERSION < 0x040702 -// case ScreenOrientationLockPortrait: -// attribute = Qt::WA_LockPortraitOrientation; -// break; -// case ScreenOrientationLockLandscape: -// attribute = Qt::WA_LockLandscapeOrientation; -// break; -// default: -// case ScreenOrientationAuto: -// attribute = Qt::WA_AutoOrientation; -// break; -//#endif // QT_VERSION < 0x040702 -// }; -// setAttribute(attribute, true); -} - -void QmlApplicationViewer::showExpanded() -{ -#ifdef Q_OS_SYMBIAN - showFullScreen(); -#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) - showMaximized(); -#else - show(); -#endif -} diff --git a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.h b/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.h deleted file mode 100644 index d7d9fe2..0000000 --- a/src/plugins/platforms/uikit/examples/qmltest/qmlapplicationviewer/qmlapplicationviewer.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the plugins 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$ -** -****************************************************************************/ - -// checksum 0x5a59 version 0x3000a -/* - This file was generated by the Qt Quick Application wizard of Qt Creator. - QmlApplicationViewer is a convenience class containing mobile device specific - code such as screen orientation handling. Also QML paths and debugging are - handled here. - It is recommended not to modify this file, since newer versions of Qt Creator - may offer an updated version of it. -*/ - -#ifndef QMLAPPLICATIONVIEWER_H -#define QMLAPPLICATIONVIEWER_H - -#include - -class QmlApplicationViewer : public QDeclarativeView -{ - Q_OBJECT - -public: - enum ScreenOrientation { - ScreenOrientationLockPortrait, - ScreenOrientationLockLandscape, - ScreenOrientationAuto - }; - - explicit QmlApplicationViewer(QWidget *parent = 0); - virtual ~QmlApplicationViewer(); - - void setMainQmlFile(const QString &file); - void addImportPath(const QString &path); - void setOrientation(ScreenOrientation orientation); - void showExpanded(); - -private: - class QmlApplicationViewerPrivate *m_d; -}; - -#endif // QMLAPPLICATIONVIEWER_H 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 = ""; }; 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 = ""; }; + D333CCF713B88A690070E08E /* qmlapplicationviewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = qmlapplicationviewer.cpp; path = ../share/qmlapplicationviewer/qmlapplicationviewer.cpp; sourceTree = ""; }; + D333CCF813B88A690070E08E /* qmlapplicationviewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qmlapplicationviewer.h; path = ../share/qmlapplicationviewer/qmlapplicationviewer.h; sourceTree = ""; }; D35784231345D8C90046D202 /* libQtOpenGL_debug.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libQtOpenGL_debug.a; path = "../../../../../../../qt-lighthouse-ios-simulator/lib/libQtOpenGL_debug.a"; sourceTree = ""; }; 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 = ""; }; D3CAA7C713264AAD008BB877 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = ""; }; - D3CAA7E313264EA6008BB877 /* moc_qmlapplicationviewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = moc_qmlapplicationviewer.cpp; path = qmlapplicationviewer/moc_qmlapplicationviewer.cpp; sourceTree = ""; }; - D3CAA7E413264EA6008BB877 /* qmlapplicationviewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = qmlapplicationviewer.cpp; path = qmlapplicationviewer/qmlapplicationviewer.cpp; sourceTree = ""; }; - D3CAA7E513264EA6008BB877 /* qmlapplicationviewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = qmlapplicationviewer.h; path = qmlapplicationviewer/qmlapplicationviewer.h; sourceTree = ""; }; 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 = ""; @@ -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/share/qmlapplicationviewer/moc_qmlapplicationviewer.cpp b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/moc_qmlapplicationviewer.cpp new file mode 100644 index 0000000..75114f9 --- /dev/null +++ b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/moc_qmlapplicationviewer.cpp @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins 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$ +** +****************************************************************************/ + +/**************************************************************************** +** Meta object code from reading C++ file 'qmlapplicationviewer.h' +** +** 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! +*****************************************************************************/ + +#include "qmlapplicationviewer.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'qmlapplicationviewer.h' doesn't include ." +#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 + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_QmlApplicationViewer[] = { + + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +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, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &QmlApplicationViewer::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *QmlApplicationViewer::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *QmlApplicationViewer::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_QmlApplicationViewer)) + return static_cast(const_cast< QmlApplicationViewer*>(this)); + return QDeclarativeView::qt_metacast(_clname); +} + +int QmlApplicationViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDeclarativeView::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} +QT_END_MOC_NAMESPACE diff --git a/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.cpp b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000..02f0471 --- /dev/null +++ b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,198 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins 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$ +** +****************************************************************************/ + +// 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 + code such as screen orientation handling. Also QML paths and debugging are + handled here. + It is recommended not to modify this file, since newer versions of Qt Creator + may offer an updated version of it. +*/ + +#include "qmlapplicationviewer.h" + +#include +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800 + +#include + +#if !defined(NO_JSDEBUGGER) +#include +#endif +#if !defined(NO_QMLOBSERVER) +#include +#endif + +// Enable debugging before any QDeclarativeEngine is created +struct QmlJsDebuggingEnabler +{ + QmlJsDebuggingEnabler() + { + QDeclarativeDebugHelper::enableDebugging(); + } +}; + +// Execute code in constructor before first QDeclarativeEngine is instantiated +static QmlJsDebuggingEnabler enableDebuggingHelper; + +#endif // QMLJSDEBUGGER + +class QmlApplicationViewerPrivate +{ + QString mainQmlFile; + friend class QmlApplicationViewer; + static QString adjustPath(const QString &path); +}; + +QString QmlApplicationViewerPrivate::adjustPath(const QString &path) +{ +#ifdef Q_OS_UNIX +#ifdef Q_OS_MAC + if (!QDir::isAbsolutePath(path)) + return QCoreApplication::applicationDirPath() + + QLatin1String("/../Resources/") + path; +#else + 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; +} + +QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : + QDeclarativeView(parent), + m_d(new QmlApplicationViewerPrivate) +{ + connect(engine(), SIGNAL(quit()), SLOT(close())); + setResizeMode(QDeclarativeView::SizeRootObjectToView); + // 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(NO_QMLOBSERVER) + new QmlJSDebugger::QDeclarativeViewObserver(this, this); +#endif +#endif +} + +QmlApplicationViewer::~QmlApplicationViewer() +{ + delete m_d; +} + +void QmlApplicationViewer::setMainQmlFile(const QString &file) +{ + m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file); + setSource(QUrl::fromLocalFile(m_d->mainQmlFile)); +} + +void QmlApplicationViewer::addImportPath(const QString &path) +{ + engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path)); +} + +void QmlApplicationViewer::setOrientation(ScreenOrientation orientation) +{ +//#if defined(Q_OS_SYMBIAN) +// // If the version of Qt on the device is < 4.7.2, that attribute won't work +// if (orientation != ScreenOrientationAuto) { +// const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.')); +// if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) { +// qWarning("Screen orientation locking only supported with Qt 4.7.2 and above"); +// return; +// } +// } +//#endif // Q_OS_SYMBIAN + +// Qt::WidgetAttribute attribute; +// switch (orientation) { +//#if QT_VERSION < 0x040702 +// // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes +// case ScreenOrientationLockPortrait: +// attribute = static_cast(128); +// break; +// case ScreenOrientationLockLandscape: +// attribute = static_cast(129); +// break; +// default: +// case ScreenOrientationAuto: +// attribute = static_cast(130); +// break; +//#else // QT_VERSION < 0x040702 +// case ScreenOrientationLockPortrait: +// attribute = Qt::WA_LockPortraitOrientation; +// break; +// case ScreenOrientationLockLandscape: +// attribute = Qt::WA_LockLandscapeOrientation; +// break; +// default: +// case ScreenOrientationAuto: +// attribute = Qt::WA_AutoOrientation; +// break; +//#endif // QT_VERSION < 0x040702 +// }; +// setAttribute(attribute, true); +} + +void QmlApplicationViewer::showExpanded() +{ +#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) + showMaximized(); +#else + show(); +#endif +} diff --git a/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.h b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000..9b125e0 --- /dev/null +++ b/src/plugins/platforms/uikit/examples/share/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins 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$ +** +****************************************************************************/ + +// 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 + code such as screen orientation handling. Also QML paths and debugging are + handled here. + It is recommended not to modify this file, since newer versions of Qt Creator + may offer an updated version of it. +*/ + +#ifndef QMLAPPLICATIONVIEWER_H +#define QMLAPPLICATIONVIEWER_H + +#include + +class QmlApplicationViewer : public QDeclarativeView +{ + Q_OBJECT + +public: + enum ScreenOrientation { + ScreenOrientationLockPortrait, + ScreenOrientationLockLandscape, + ScreenOrientationAuto + }; + + explicit QmlApplicationViewer(QWidget *parent = 0); + virtual ~QmlApplicationViewer(); + + 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: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H -- cgit v0.12 From 6f9cd3170d917c8ab3b526d3e4cc33c714e26648 Mon Sep 17 00:00:00 2001 From: Ian Date: Mon, 20 Jun 2011 15:26:26 +0200 Subject: Use nicer fonts and a few little patches to uikit platform. Merge-request: 1275 Reviewed-by: con --- src/plugins/platforms/uikit/quikiteventloop.mm | 11 ++++++----- src/plugins/platforms/uikit/quikitintegration.h | 1 + src/plugins/platforms/uikit/quikitintegration.mm | 19 +++++++++++++------ src/plugins/platforms/uikit/quikitwindow.mm | 8 +++----- src/plugins/platforms/uikit/quikitwindowsurface.mm | 2 +- src/plugins/platforms/uikit/uikit.pro | 2 +- 6 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/plugins/platforms/uikit/quikiteventloop.mm b/src/plugins/platforms/uikit/quikiteventloop.mm index 8884f63..c049563 100644 --- a/src/plugins/platforms/uikit/quikiteventloop.mm +++ b/src/plugins/platforms/uikit/quikiteventloop.mm @@ -72,7 +72,8 @@ Q_UNUSED(application) foreach (QWidget *widget, qApp->topLevelWidgets()) { QUIKitWindow *platformWindow = static_cast(widget->platformWindow()); - platformWindow->ensureNativeWindow(); + if (platformWindow) platformWindow->ensureNativeWindow(); + else qDebug() << "Failed to get platform window: " << widget; } return YES; } @@ -156,15 +157,15 @@ bool QUIKitSoftwareInputHandler::eventFilter(QObject *obj, QEvent *event) if (event->type() == QEvent::RequestSoftwareInputPanel) { QWidget *widget = qobject_cast(obj); if (widget) { - QUIKitWindow *platformWindow = static_cast(widget->platformWindow()); - [platformWindow->nativeView() becomeFirstResponder]; + QUIKitWindow *platformWindow = static_cast(widget->window()->platformWindow()); + if (platformWindow) [platformWindow->nativeView() becomeFirstResponder]; return true; } } else if (event->type() == QEvent::CloseSoftwareInputPanel) { QWidget *widget = qobject_cast(obj); if (widget) { - QUIKitWindow *platformWindow = static_cast(widget->platformWindow()); - [platformWindow->nativeView() resignFirstResponder]; + QUIKitWindow *platformWindow = static_cast(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 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 @@ -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/quikitwindow.mm b/src/plugins/platforms/uikit/quikitwindow.mm index 29ca88b..fe29fd6 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); @@ -335,9 +334,8 @@ QUIKitWindow::QUIKitWindow(QWidget *tlw) : mScreen = static_cast(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 -- cgit v0.12 From 053b3620fc182b4d4f7917926235f5631fc4a504 Mon Sep 17 00:00:00 2001 From: Ian Date: Mon, 20 Jun 2011 16:19:11 +0200 Subject: Post key events via QWindowSystemInterface, don't post events direcly Merge-request: 1275 Reviewed-by: con --- src/plugins/platforms/uikit/quikiteventloop.mm | 3 --- src/plugins/platforms/uikit/quikitwindow.mm | 36 +++++++++----------------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/src/plugins/platforms/uikit/quikiteventloop.mm b/src/plugins/platforms/uikit/quikiteventloop.mm index c049563..a7c276f 100644 --- a/src/plugins/platforms/uikit/quikiteventloop.mm +++ b/src/plugins/platforms/uikit/quikiteventloop.mm @@ -73,7 +73,6 @@ foreach (QWidget *widget, qApp->topLevelWidgets()) { QUIKitWindow *platformWindow = static_cast(widget->platformWindow()); if (platformWindow) platformWindow->ensureNativeWindow(); - else qDebug() << "Failed to get platform window: " << widget; } return YES; } @@ -81,8 +80,6 @@ - (void)applicationWillTerminate:(UIApplication *)application { Q_UNUSED(application) - // TODO this isn't called for some reason - qDebug() << "quit"; qApp->quit(); } diff --git a/src/plugins/platforms/uikit/quikitwindow.mm b/src/plugins/platforms/uikit/quikitwindow.mm index fe29fd6..ec33cd0 100644 --- a/src/plugins/platforms/uikit/quikitwindow.mm +++ b/src/plugins/platforms/uikit/quikitwindow.mm @@ -289,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 -- cgit v0.12 From f4021929ef802a5b5093a03c37f5f1b8021b46e7 Mon Sep 17 00:00:00 2001 From: Ian Date: Mon, 27 Jun 2011 12:33:50 +0200 Subject: Add IPHONEOS deployment vars to makespec Merge-request: 1275 Reviewed-by: con --- mkspecs/qpa/macx-iphonedevice-g++/qmake.conf | 3 ++- mkspecs/qpa/macx-iphonesimulator-g++/qmake.conf | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf b/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf index b11c2d7..d69f58d 100644 --- a/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf +++ b/mkspecs/qpa/macx-iphonedevice-g++/qmake.conf @@ -25,7 +25,8 @@ DEFINES += QT_NO_AUDIO_BACKEND QMAKE_IOS_DEV_PATH = /Developer/Platforms/iPhoneOS.platform/Developer QMAKE_IOS_SDK = $$QMAKE_IOS_DEV_PATH/SDKs/iPhoneOS4.3.sdk -#clear +# 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 diff --git a/mkspecs/qpa/macx-iphonesimulator-g++/qmake.conf b/mkspecs/qpa/macx-iphonesimulator-g++/qmake.conf index 8098dbf..481a268 100644 --- a/mkspecs/qpa/macx-iphonesimulator-g++/qmake.conf +++ b/mkspecs/qpa/macx-iphonesimulator-g++/qmake.conf @@ -25,7 +25,8 @@ DEFINES += QT_NO_AUDIO_BACKEND QMAKE_IOS_DEV_PATH = /Developer/Platforms/iPhoneSimulator.platform/Developer QMAKE_IOS_SDK = $$QMAKE_IOS_DEV_PATH/SDKs/iPhoneSimulator4.2.sdk -#clear +# 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 -- cgit v0.12 From 604279b4dd0a01256f7a06fa3578a3c1dc225134 Mon Sep 17 00:00:00 2001 From: con Date: Tue, 28 Jun 2011 09:30:20 +0200 Subject: Fix 2cb398e1d901e62384bb2b388761cfd18fc8804a in case of no coreservices Reviewed-by: Ritt Konstantin --- src/corelib/kernel/qcore_mac.cpp | 2 ++ src/corelib/kernel/qcore_mac_p.h | 3 +++ 2 files changed, 5 insertions(+) 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 -- cgit v0.12 From 1a4bdffffc8f294e71cf9a9683e9030bd6e0644c Mon Sep 17 00:00:00 2001 From: con Date: Tue, 28 Jun 2011 11:57:01 +0200 Subject: Use the QPoint memory layout change only on Desktop Mac Reviewed-by: gunnar --- src/corelib/tools/qpoint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v0.12 From 938a66e93a279027b812b386d98a77c46f314294 Mon Sep 17 00:00:00 2001 From: con Date: Tue, 28 Jun 2011 12:13:57 +0200 Subject: Change default application font for uikit platform. --- src/plugins/platforms/uikit/quikitscreen.mm | 6 ++++++ 1 file changed, 6 insertions(+) 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]; } -- cgit v0.12 From b88e225da2cd471e7a3985793f114ee5d142d64e Mon Sep 17 00:00:00 2001 From: con Date: Tue, 28 Jun 2011 12:39:13 +0200 Subject: Ensure a small event check interval on uikit platform. For some reason I sometimes get huge nextTimerEvent() values. --- src/plugins/platforms/uikit/quikiteventloop.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/uikit/quikiteventloop.mm b/src/plugins/platforms/uikit/quikiteventloop.mm index a7c276f..7c3e929 100644 --- a/src/plugins/platforms/uikit/quikiteventloop.mm +++ b/src/plugins/platforms/uikit/quikiteventloop.mm @@ -103,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]; -- cgit v0.12 From 9088661c63f61fbfa02e2e11aefe32cfa0f52171 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Tue, 28 Jun 2011 15:53:28 +0200 Subject: Fix vertical positioning of glyphs in raster engine with FreeType Reviewed-by: aavit --- src/gui/painting/qpaintengine_raster.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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(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