Commit Graph

12513 Commits

Author SHA1 Message Date
Richard Moe Gustavsen
19de726725 iOS: create top-level UIWindow and UIViewController
Create a UIWIndow with a view controller and a view
where we can reparent our QIOSWindow views inside.

Change-Id: Ic90707d3ebe1af970a3aa2aa0f8c0f4be192456a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-02-27 23:55:38 +01:00
Tor Arne Vestbø
09187f602c iOS: Implement QIOSBackingStore in terms of a QOpenGLPaintDevice
We build on top of the QPlatformOpenGLContext implementation to get
automatic support for QBackingStore-based painting. Since the OpenGL
renderer does not clear the backingstore between frames, we actually
also get support for partial updates, and we get the benefit of an
accelerated paint engine for Qt Quick 1 without setting a GLWidget
as the viewport, which would cause issues such as an extra QWindow.

This patch also removes the dependency to QtOpenGL and QtWidgets, which
were leftovers from the Qt4 platform plugin. In Qt5 the needed GL bits
are in QtGui.

Change-Id: Id9b736bfb2e4aec56c0fa9f5b7b4d8bff8e3d1dc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 23:55:37 +01:00
Tor Arne Vestbø
3c4f48f9e2 iOS: Implement QPlatformOpenGLContext
The iOS platform GL context is an EAGLContext, which is wrapped by
the new class QIOSContext. The class takes care of makeCurrent()
and swapBuffers(), but defers framebuffer management to the
corresponding QIOSWindow.

At the moment only a single framebuffer is created, and changing the
geometry of the QWindow does not trigger any sort of invalidation of
the buffers.

The implementation assumes OpenGL ES2.x support. Though strictly
speaking we could support ES1 for QtGui, it serves little purpose
as Qt Quick 2 requires ES2.

This patch also disabled touch event synthesization until we have
figured out where we will maintain the connection to UIWindow.

QPlatformOpenGLContext::getProcAddress() for getting extensions is
implemented by using dlsym() to look up the symbol. This should not
present any issues for App Store deployment, like dlopen() would.

Change-Id: I166f800f3ecc0d180133c590465371ac1642b0ec
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 23:55:37 +01:00
Richard Moe Gustavsen
ac8d906a3a iOS: support killing timers
Implement the remaining timer functions in the event dispatcher

Change-Id: Ie323962c898a2ee95ea60a8ca63b93cbd4544fd1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-02-27 23:55:37 +01:00
Richard Moe Gustavsen
458382f35b iOS: call UIApplicationMain from event dispatcher, and add application delegate
This change will let you call QApplication::exec() instead of UiApplicationMain
from main. Also added an application delegate that we will need sooner
or later for catching application activation events.

Change-Id: I4edba5ce2059a804782d67c160755fc0e2e5267d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-02-27 23:55:36 +01:00
Tor Arne Vestbø
05d0f60ebe iOS: Flesh out initial QPlatformScreen implementation
We check the device's model identifier to tweak the screen values based
on the precense of older iPhone/iPod touch models, or the iPad Mini.
This does not work when running under the simulator, which reports its
model identifier as the architecture of the host platform. There doesn't
appear to be any APIs to get the simulated device of the simulator, but
if this becomes an issue we can always look at the UIDevice model and
screen resolution and apply a few heuristics.

We do not update the screen geometry on orientation-changes. This matches
what UIScreen reports for bounds, but may not be the most intuitive solution
from a Qt perspective compared to the way other platform-plugins work.

Change-Id: I74783e053601de9ce805f8b52b944c116f9a1e3e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-02-27 23:55:36 +01:00
Tor Arne Vestbø
44c3ef790e iOS: Fix build on case sensitive filesystems
Change-Id: Ic7a2b38ffcc2bd83e268c5caf5bec17006879969
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 23:55:36 +01:00
Richard Moe Gustavsen
407cf7341e iOS: QIOSEventDispatcher: implement timer support
Change-Id: I1966a64e6535f32005681db37b4fe5d89dafc70c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-02-27 23:55:35 +01:00
Richard Moe Gustavsen
145abdc442 iOS: QIOSEventDispatcher: add runloop source for processing events
Change-Id: I6cd649a493dab9a982d71921f19d2a9252fc14b0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-02-27 23:55:35 +01:00
Tor Arne Vestbø
a685df0584 iOS: Add ability to get the UIView for a QWindow through QPlatformNativeInterface
Change-Id: Iab2742bbaa97ff345871ad07ef0162b12248506a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 23:55:34 +01:00
Tor Arne Vestbø
422eed16eb iOS: Style nitpicking, rename m_fontDb to m_fontDatabase
Change-Id: I9d92843af9018d51b73fadcc7c20d792fad772fa
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 23:55:34 +01:00
Tor Arne Vestbø
5e85aa9ab4 iOS: Keep UIScreen* for current QIOSScreen instead of looking up each time
Also, add enum for screen numbers, for better code readability.

Change-Id: Id5162c34e80ff5efb149ae86b49f51df183d1c1d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 23:55:34 +01:00
Tor Arne Vestbø
14e93f7e8e iOS: Add screen like other platform plugins
We may add support for external displays at a later point, but for now
we follow the same pattern as the other platform plugins. Either way we
should call screenAdded() to let the platform integration know about the
screen.

Change-Id: Id01785a5262df0180caf957c7de8ecbbf169f233
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 23:55:33 +01:00
Tor Arne Vestbø
6d36a83b41 iOS: Get rid of singleton instance accessor in platform plugin
None of the other platform plugins have one, and it's not used anywhere.

Change-Id: Id46ab5f75c9819511c3e9d123d0338c3c8799869
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 23:55:33 +01:00
Tor Arne Vestbø
3020d06fdb iOS: Change member variable style to be consistent with Qt's de facto standard
Change-Id: Idd65ad9cbb77114466c5b69a799b98a7fee5068f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 23:55:33 +01:00
Tor Arne Vestbø
9c8ce6afb0 iOS: Don't add to OBJECTIVE_HEADERS, there's no such thing
We should add to HEADERS, so that moc will realize it needs to run on
the headers.

Change-Id: I582e989e4faf0835c4bf9a677cbd8ac075559319
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-02-27 23:55:32 +01:00
Tor Arne Vestbø
8c00149078 iOS: Don't include QtPrintSupport dialogs on iOS
It pulls in a dependency on Cocoa.

Change-Id: I293063adfdef8b92f80ffda0c66ac6e6d12958ff
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 23:55:32 +01:00
Tor Arne Vestbø
c7fbff7bf2 iOS: Add required public dependencies of the CoreText font database
CoreText and CoreGraphics are available on iOS as stand-alone
frameworks, but on Mac OS X they are part of the ApplicationServices
umbrella framework.

Mac OS 10.8 actually introduced both as stand-alone frameworks,
but for simplicity we link to ApplicationServices, as there's
still symlinks from ApplicationServices to the real frameworks.

Change-Id: I7f7ef795629cc37da85857d5c42283754acc4474
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 23:54:56 +01:00
Paul Olav Tvete
01292ac849 Make -force-debug-info option work
Should be applied to Qt modules. Not interesting for third party
users.

Change-Id: I8fce821af397e3ace011a426c762319f6d30004f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-02-27 23:06:15 +01:00
Olivier Goffart
123ce761c0 QT_MESSAGE_OUTPUT: add support for condition depending on the type
The motivation is to enable coloration the way KDE currently does.
It can now  be achieved with a QT_MESSAGE_OUTPUT set to
"%{appname}(%{category}) \033[31m%{if-debug}\033[34m%{endif}%{function}\033[0m: %{message}"

I was thinking about supporting directly color using something like
%{begin-category-color} that would be smart and detect if we are running
on a terminal, but it would be less flexible in the way the colors van
be configured.

Changelog: QT_MESSAGE_OUTPUT can contain conditionals based on the type
of the message

Change-Id: Icd8de04734a94a3afcbf542a5b78b290a1914960
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-02-27 22:29:43 +01:00
Israel Lins
70bb34ccd5 ODBC: implementation of lastInsertId()
Implemented lastInsertId() for some ODBC compatible databases.

Change-Id: I0b75a8e68369af39e258e4761b384767ab8a371e
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-27 22:01:17 +01:00
Friedemann Kleint
e265a1a4bd Disable maximize button for fixed-size windows.
Task-number: QTBUG-28407

Change-Id: I5bab7fcf4ad3ecc7008ef02b9d3575d75893895d
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-02-27 20:17:25 +01:00
Friedemann Kleint
7867f03f8a Stabilize tst_qprogressbar.
- Wait for shown to ensure events are processed.
- Move away from screen corners/potential task bar areas.

Change-Id: I2c3aa9b675c6b33ca0da67ee99cc6f76c502098a
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-27 20:17:19 +01:00
BogDan Vatra
afaa6e42f0 Export QAbstractFileEngine[XXXX] classes.
We still need them for Android assets implementation.

Change-Id: I12bb809c05ac88f3c4a7d6796692b4dc3987027c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-02-27 18:02:50 +01:00
Paul Olav Tvete
023644cae1 Style fixes for android enablers
Change-Id: I0b942865c29f4bdf29f0e7f56af0d620acbc39c6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-02-27 18:02:34 +01:00
Paul Olav Tvete
1199136bd3 Fix test script
This script was completely broken, and seems to have been abandoned.

Change-Id: If307f001237609ccb054c0a469213290294161c9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-02-27 18:02:22 +01:00
BogDan Vatra
d88ec35b11 Fix compile on Android
This is a workaround for a broken compiler

Change-Id: I10c8c750caf56036419807ec4a2439bf14cf64d6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-02-27 18:02:10 +01:00
Paul Olav Tvete
660a615a37 Update the display to reflect changes by input method
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>

Change-Id: If3804f2a514ba4635f841de6377f2b328a4e928a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-02-27 18:01:56 +01:00
Gabriel de Dietrich
48d39a01a7 Cocoa: Remove qt_mac_toCGImage warnings
We got these because we were flushing the backing store with a
null QImage.

Change-Id: I372cb3fc7c82d3bdcfe735fcadfa72806d0ef39b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-02-27 17:50:57 +01:00
David Faure
e433553c1b tst_qfile: remove unused variable
Change-Id: I3c827b8a372158815cf234a548a85cf6165c189e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-27 16:00:08 +01:00
David Faure
2cb2a2e29e Add ISO 8859-11 as an alias for TIS-620
(qsimplecodec.cpp says so, but is unused when ICU is used)

ISO 8859-16 is still missing though...

Change-Id: Idbccedd7bad63f9788cec2f7fc1bbfcb7a891acc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-02-27 16:00:02 +01:00
Richard Moe Gustavsen
f6dc54ded4 iOS: network should not link against CoreServices on iOS
Change-Id: Ia3e21a3d73f696f0e77c427bdb263333646c48d3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-02-27 13:07:25 +01:00
Tor Arne Vestbø
8716c42ee2 iOS: Add missing QuartzCore dependency to platform plugin
Change-Id: Ic69a5a7faa9b7f9907d0325260b6b6e2389a4c3a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-02-27 13:07:25 +01:00
Tor Arne Vestbø
cb25d67f01 iOS: Don't link ios platform plugin to Cocoa
Change-Id: I2348b19617d3e342cd344bf7d0fa894118cbfae8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-02-27 13:07:24 +01:00
Tor Arne Vestbø
f2168f2688 iOS: Build platform plugin like other platform plugins
... by loading(qt_plugin)

Change-Id: I9be438b72be986a991a81c2cf1a3e5047bcf0a60
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-02-27 13:07:24 +01:00
Tor Arne Vestbø
e5111d5e02 iOS: Build ios platform plugin when appropriate
Defining QT_QPA_DEFAULT_PLATFORM_NAME in qplatformdefs.h is not
neccecary, as qconfig.h will already have this define written by
configure.

Change-Id: I89d9191533f6b4e6bfd5eade6cc0dced02b50f81
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-02-27 13:07:23 +01:00
Tor Arne Vestbø
a6286039ba iOS: Write default code signing identify for iOS in Xcode generator
Change-Id: Ic04da6063863585665c9133caba0279ba478fbb4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Ian Dean <ian@mediator-software.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-02-27 13:07:23 +01:00
Tor Arne Vestbø
5da648043d iOS: Target both iPhone and iPad by default
Change-Id: I3122b9391c6187da17389c889a456c58210dca09
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 13:07:23 +01:00
Tor Arne Vestbø
e846edff33 iOS: Allow projects to disable the main wrapper
In case they provide their own main that calls UIApplicationMain.

Change-Id: Ia050277ae5cbcbf01bc57b87ec37a74db9568059
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 13:07:22 +01:00
Tor Arne Vestbø
5b99d46b39 iOS: Link to the platform plugin and iosmain plugin and define main
Ideally we'd only have to do QTPLUGIN += ios, but this doesn't work as
we need to link with the force_load linker option. Even trying to build
on QTPLUGIN and then replace the -l line with what we need will fail, as
the prl logic in qmake which runs after all the prf files does not know
about the force_load option and will then fail to resolve dependencies
from the prl file.

Since we load the platform plugin using -force_load, there's no need to
generate a cpp file that does the plugin import.

The main wrapper is not a real Qt plugin, and doesn't have an import
function that we can call, so we link it manually instead of relying
on QTPLUGIN.

Change-Id: I0381a3c9ed7f8d41a4121e1fc0b7c0e210a8b832
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 13:07:22 +01:00
Tor Arne Vestbø
77168c03ff iOS: Make Xcode output the default for GUI applications
As long as Qt Creator does not provide any iOS integration, and the
app bundle we create using the Makefile generator is not good enough
to deploy to a device anyways, producing Xcode projects make the most
sense.

We base the decicion on whether or not the project depends
on QtGui and has app_bundles enabled. This prevents configure
tests and other tools from having Xcode projects, but allows
examples and demos to build out of the box.

Instead of setting the generator unconditionally we unset it in
default_pre so that we can detect if the user set it manually. This
means the user won't be able to inspect the MAKEFILE_GENERATOR variable
from the pro file, but this is less of a use-case then overriding the
generator from the command line or prooject file.

Change-Id: I881cf3e29631445f83ea4ff0979f7a566e4810f5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 13:07:21 +01:00
Tor Arne Vestbø
c3278e3353 iOS: Replace device and simulator makespecs with single makespec
And use configure's -sdk argument to choose between the iphoneos and the
iphonesimulator SDK. xcodebuild -showsdks can be used to list the
available SDKs. Passing an SDK without a version postfix implies
the latest version of the SDK.

Change-Id: I881df754d522fc91aaa16ba3e39cf0c37a21a1f1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-02-27 13:07:16 +01:00
Mitch Curtis
a65982d659 Add snippet for QT_VERSION_CHECK.
Change-Id: I048771f21ce694329a7e9acd4dbfbebfec964b05
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-27 12:02:34 +01:00
Andy Shaw
4a6a066df2 Fix generation of XCode projects for XCode 4.6
When a framework is referenced in the XCode project then it is known as
a framework by the lastKnownFileType and not the reference type. This
ensures it works in both XCode 3 and XCode 4.

Task-number: QTBUG-29371
Change-Id: I434246a46d6c5bfd50ba7de1a7c710c0caf0bc0a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-02-27 12:01:28 +01:00
Mitch Curtis
6269c9a414 Fix some punctuation errors.
Change-Id: I6aa2ad2b506466fbef6a22380d151988930807c9
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-02-27 12:00:46 +01:00
Paul Olav Tvete
c65ecc50ae Enablers for input methods on Android
Adding QInputMethod::inputItemRectangle()/setInputItemRectangle().

Known bugs: inputItemRectangle() not implemented for graphics view
items; inputItemTransform() implementation was already missing.

Change-Id: I72b1d43350e93858a2b374de3f2199500a96dc79
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-02-27 11:24:24 +01:00
BogDan Vatra
323ba46f72 Fix thumb armv5 atomics
Change-Id: Ie9f98e5f5a08908d9d99e04bdc95fd506cc4a51e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-02-27 11:24:24 +01:00
Paul Olav Tvete
212ff4f34d Add multi-line input method hint
Enabler for input on Android.

Change-Id: I44670b95b35f773814125c5d35c67e9713567813
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-02-27 11:24:24 +01:00
Friedemann Kleint
cd1e245877 QStandardPaths: Use forward slash consistently.
Task-number: QTBUG-29249

Change-Id: I027f9ae18544dc47e1378214244487c8a5ae704c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-27 09:24:33 +01:00
Samuel Rødal
b56caf5f4e Introduced QWindow::setMask() to expose existing platform functionality.
Task-number: QTBUG-28555
Change-Id: I2c649b6d9e9dc69be246cb7658b3edbe9682b1bf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-27 09:11:18 +01:00