summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios
Commit message (Collapse)AuthorAgeFilesLines
* Fix broken QIOSContext setup due to missing 0-initialization of EAGLContextTor Arne Vestbø2015-12-101-3/+4
| | | | | | Change-Id: Ia4dbb2e3b055a7899c4a3e02698c5776ea7f73ea Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* iOS: filter edit menu actions depending on selection stateRichard Moe Gustavsen2015-12-091-0/+26
| | | | | | | | | | | | When showing an edit menu on iOS, UIKit will always populate the menu with actions according to what the current first responder supports. But it doesn't make sense to show all the actions every time the menu opens, so introduce some filtering depending on selection state. Change-Id: I943a09928233a3a10de003fe15ed8fd8b6fc1e18 Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: support edit action 'select'Richard Moe Gustavsen2015-12-091-0/+7
| | | | | | | | | Now that we don't populate the edit menu from qtquickcontrols anymore (because of shortcut issues), report to UIKit that we support select so that the action shows in the menu. Change-Id: I92508da4e1789c361d778cc6c1c77c86308f4c73 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Favor OpenGLES 3 on iOS if availableMike Krus2015-12-091-3/+5
| | | | | | | | | | | | First tries OpenGLES 3 context since it’s strictly compatible with OpenGLES 2. If it fails, then try 2. This is required to use QOpenGLFramebufferObject::blitFramebuffer without having to look at using an Apple-specific extension. Change-Id: I01f8f058fa82e7f2c90d1b894ad36f3d3939c994 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Respond with a sound for certain message boxes on windowsJan Arve Saether2015-12-041-0/+2
| | | | | | | | | | | | | | | This was a regression (it worked in 4.8) that was probably introduced by the refactoring of the accessibility framework in Qt 5. Now, QPlatformAccessibility::notifyAccessibilityUpdate() is called regardless of isActive(), so its the responsibility of each implementation of notifyAccessibilityUpdate() to check for isActive() where it matters. Task-number: QTBUG-33303 Change-Id: I0d18f8c1890ef679460408b05e704712b886bf7c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-271-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_p.h src/network/ssl/qsslsocket_mac.cpp src/network/ssl/qsslsocket_mac_p.h src/widgets/kernel/qwidget.cpp Change-Id: I39592cb37d710dfaf8640769ba3c1b637927d7f4
| * iOS: always flush spontaneous key press eventsRichard Moe Gustavsen2015-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we changed sending key events through QPA instead of directly to the focus object, we only flushed from deleteBackward (06be9f026). The reason was to avoid unnecessary flushes, as this in general can be a source to recursion problems. It turns out that this is also needed when sending Qt::Key_Return. The reason is that we sometimes resign first responder when the return key is pressed, which will also change the focus object in Qt. And without flushing the key event first, it will be processed after the change and therefore end up at the wrong object. It seems like the most sensible thing is to always flush upon receiving spontaneous key/text events from iOS, which is also how it was before. Task-number: QTBUG-49021 Change-Id: I44885a11275dee5039ef6a8abbcbdadc092695e7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | iOS: Add support for delivering touch pressure on iPhone 6s/6s+ devicesTor Arne Vestbø2015-11-262-6/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As 3D touch can be disabled/enabled at runtime on those devices, we need to watch for changes to the relevant settings and update the touch device capabilities that we report to the user. Note that iOS will deliver touchesBegan with a touch force of 0, which we will reflect/propagate as a 0 pressure, but there is no clear alternative, as we don't want to wait for a touchedMoved before sending a touch press event to Qt, just to have a valid pressure. Change-Id: I47fb8a9f98ab3244e16a337bbfcf1fe24e4c7aa2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | iOS: Update pixel density (PPI) logic to detect new iOS devicesTor Arne Vestbø2015-11-192-11/+16
| | | | | | | | | | | | | | | | | | | | | | Since the iPhone 6(S) Plus devices have a PPI of 401, we change the logic from storing the unscaled PPI to storing the scaled PPI, and applying that to a scaled geometry when computing the physical size. Task-number: QTBUG-49467 Change-Id: I1741ff075749a301d2434cd35f642fcc9ea4b581 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | iOS: only force-finish start-up from file engine when on main threadRichard Moe Gustavsen2015-11-091-14/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The authorization dialog that grants the application access to the assets will only show after returning back from applicationDidFinishLaunching. Therefore, trying to load an asset from main before qApp->exec() would normally fail. To remedy that, we added a path that starts a QEventLoop for a split second to force the application init process to finish. But this can only work if we start it from the main thread. A bug with this is seen in QML FileDialog, since it (clumsy enough) starts to iterate, in a separate thread, all the files in its currently set directory upon start-up construction (which should be fixed as well). The result is that the application gets dead-locked on start-up. Change-Id: I0047272d53314752903960b33f88b33dc0d7e78d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Move QEventDispatcherCoreFoundation to QtCoreMorten Johan Sørvig2015-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Export it for use by the iOS platform plugin. Also move QCFSocketNotifier, and export for use by the Cocoa platform plugin. This is a pure code move with no intended behavior changes, in anticipation of using the Core Foundation event dispatcher as the default Qt Core event dispatcher on OS X. Change-Id: I43677d2f6f3c1d0ed0415c964225aa97d2f13078 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Make the CoreFoundation event dispatcher depend on QtCore onlyMorten Johan Sørvig2015-10-132-0/+22
| | | | | | | | | | | | | | | | | | | | In anticipation of moving it to QtCore. The call to QWindowSystemInterface::sendWindowSystemEvents() has been moved to QIOSEventDispatcher by making processPostedEvents() virtual. Change-Id: I9e03be4153a9f5f34e9a0ac942cdff572a44c318 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-025-17/+224
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
| * iOS: silence compiler warning about unimplemented 'selectionRectsForRange'Richard Moe Gustavsen2015-09-101-0/+9
| | | | | | | | | | | | | | | | | | | | | | Implement a dummy method to silence the compiler. After testing, this method seems to never be called. Which is good, since the current IM API in Qt have little to offer to resolve what is being asked. Until a need arise, we just return an empty array. Change-Id: I573eb8205a7e635a46d487ae175fb46e3a602001 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: filter responder actions from menu syncRichard Moe Gustavsen2015-09-041-1/+1
| | | | | | | | | | | | | | | | | | Follow up from b494d85. We need to filter the responder actions after a sync as well, otherwise they will be added back if a menu item e.g changes text. Change-Id: I2ecbcc292400ada97a8e29d4b97f087349d8a061 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: compose key events from QKeySequencesRichard Moe Gustavsen2015-09-041-10/+18
| | | | | | | | | | | | | | | | | | Instead of hard-coding the key and modifier that should trigger a shortcut, we read it out from the QKeySequence that corresponds to a StandardKey instead. Change-Id: I6325534d3ff91c788d7e660d9009954e437b8534 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: handle all directions when calculating positionFromPositionRichard Moe Gustavsen2015-09-011-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method is currently a bit buggy, since it does not take UITextLayoutDirectionUp and UITextLayoutDirectionDown into account. This patch is mostly for fixing something "just in case", since we so far have not seen UIKit calling this method for those directions unless a hardware keyboard is connected. And in that case, we anyway override IM navigation by dealing with the arrow keys explicit. Since IM in Qt does not support getting the position above or below the current position, we just return the current position, making it a no-op. Change-Id: I4bcb9e2a00ab4e3d785058d7ff7f4855142dabbc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: filter first responder actions from edit menuRichard Moe Gustavsen2015-09-012-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | UIResponderStandardEditActions found in first responder will be prepended to the edit menu automatically (or e.g made available as buttons on the virtual keyboard). So we filter them out to avoid duplicates, and let first responder handle the actions instead. In case of QIOSTextResponder, edit actions will be converted to key events that ends up triggering the shortcuts of the filtered menu items. Change-Id: I046c6cc5b358d8a6f7623e10579e2dcd92f75139 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: store shortcut sequence in menu itemRichard Moe Gustavsen2015-09-012-1/+7
| | | | | | | | | | Change-Id: I4c99516fb98ce0da84b8690cc4c1fd71c0db9dca Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: add undo/redo supportRichard Moe Gustavsen2015-09-011-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable the undo/redo buttons on the keyboard, as well as the Cmd-Z/Cmd-Shift-Z shortcuts. For UIKit to support this, we need to add undo actions to first responders undo manager. Since we don't know if Qt has anything to undo/redo, we just enable the shortcuts all the time. To do that, we trick NSUndoManager to always have both an undo operation and a redo operation in the stack. Change-Id: I3294a962cc24f56585e7e515856142f3dda56d0a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: listen for standard text edit shortcutsRichard Moe Gustavsen2015-09-011-0/+18
| | | | | | | | | | | | | | | | | | Catch the missing shortcuts sent by UIKit, and forward them to Qt as key events so that the app can respond to them. Change-Id: If63c4b05466e64843982fce32fbd594d2a0ef312 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: send arrow keys to Qt to handle cursor movementRichard Moe Gustavsen2015-09-012-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Controlling cursor position through input methods in Qt is very limited. You cannot e.g move the cursor vertically, or select text that spans several paragraphs. The reason for the latter is that Qt works with input methods on a per-paragraph basis, which effectively locks UIKit to only being able to move the cursor and select text within a single paragraph. Fixing up input methods to support more advanced navigation means changing the whole design (working on a whole document, instead of per paragraph), and is out of scope. Instead we choose to listen for arrow keys and forward them to Qt in the same fashing as we already do for backspace and enter. This will make the iOS port on-par with the other platforms, which also sends control characters like these on the side of IM events. Note that registering shortcuts and overriding default IM navigation behavior will only take effect when a hardware keyboard is connected. Only then will [UIresponder keyCommands] be called from UIKit. Change-Id: I634205e0578447c4aa6e9fdff342ee3b281901ea Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: send key events through QPARichard Moe Gustavsen2015-09-011-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | So far we have chosen to send key events directly to the focus object since we do already do that for IM events. But Qt expects key events (especially control keys) to be sendt through QPA. This means that key events can end up somewhere else than at the focus object, which is expected and needed if shortcut propagation is to work. Change-Id: I160bf3309572719eda352cdb11b46c4b5a455e0d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: Make setFrame in desktop view take superview transforms into accountTor Arne Vestbø2015-08-281-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An assumption we do for the QIOSDesktopManagerView is that it should always cover the whole UIWindow. To achieve that, we override setFrame to be stop any attempt from UIKit to make our view smaller, e.g. when the statusbar changes height. In case the view is not a direct child of the window, we need to take any transformations into account when computing the new frame. This happens e.g. during presentation of other view-controllers, where our view is temporarily reparented into a UITransitionView that may have a transform set. Task-number: QTBUG-47506 Change-Id: I388143f2cbb566541ffb1068443ce21e62ea2b42 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | iOS: Restore mirror mode using [UIScreen mainScreen] instead of nilTor Arne Vestbø2015-09-091-1/+1
| | | | | | | | | | | | | | | | | | The latter had the same effect, but is an invalid assignment for a value that is documented to be non-nil. Change-Id: Ice00482138481556ad839bc3721e577dafcb26fe Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-08-262-10/+45
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/snippets/code/doc_src_qmake-manual.pro qmake/doc/src/qmake-manual.qdoc src/corelib/io/qstorageinfo_unix.cpp src/corelib/tools/qbytearray.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp tests/auto/network/access/qnetworkreply/BLACKLIST Change-Id: I9efcd7e1cce1c394eed425c43aa6fce7d2edf31c
| * iOS: calculate bounds in desktop view using transformed window bounds for ↵Richard Moe Gustavsen2015-08-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | both width and height Depending on the orientation, UIKit might shrink either the width or the height of the view to fit the status bar. Since we anyway want the view to fill the whole window, we simply ignore this, and use the bounds of the whole window directly. Task-number: QTBUG-47506 Change-Id: I73294e5792f8d98fb0c0b0a42198207baca08e3c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: ensure that we restore text selection with correct cursor and anchor posRichard Moe Gustavsen2015-08-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | Qt keeps track of the selection direction since a selection anchor can be placed both to the left or to the right of the cursor. On iOS, the selection should instead always be specified from left to right (using a position together with a positive length). So when restoring the selection after performing the calculation of the text rect, we need to ensure that we follow this format. Change-Id: Id8bea6c35e2781e1431ee963f601b6e9ef05dbf5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: support cut/copy/paste shortcuts when using Bluetooth keyboardRichard Moe Gustavsen2015-08-111-8/+42
| | | | | | | | | | Change-Id: Iaa602771227f64c3a477a27656362a361f78e8dd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devFrederik Gladhorn2015-08-069-46/+48
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/qt-cpp-defines.qdocconf src/3rdparty/forkfd/forkfd.c src/corelib/codecs/qtextcodec.cpp src/corelib/kernel/qmetatype.cpp src/corelib/tools/qset.qdoc src/gui/accessible/qaccessible.cpp src/gui/image/qpixmapcache.cpp src/opengl/qgl.cpp src/tools/qdoc/generator.cpp src/widgets/kernel/qwidget.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I4fbe1fa756a54c6843aa75f4ef70a1069ba7b085
| * iOS: add missing Q_DECL_OVERRIDERichard Moe Gustavsen2015-07-277-45/+45
| | | | | | | | | | | | | | Add missing Q_DECL_OVERRIDE to silence clang. Change-Id: I57261a39f0dcf4e0ffd8d9c079a95f2d3347d34a Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
| * iOS: use UIKeyboardTypeNumbersAndPunctuation for Qt::ImhPreferNumbersRichard Moe Gustavsen2015-07-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Using Qt::ImhPreferNumbers means that we should use a keyboard that has focus on typing numbers. But it's important that we don't restrict typing to numbers only, it also needs to support normal text input. And this seems to be exactly what UIKeyboardTypeNumbersAndPunctuation does. Task-number: QTBUG-47365 Change-Id: I5bb88cedcbe0e89ea884dc9c14d3ffd9fb368060 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * ios: Do not drop the user-provided default QSurfaceFormatLaszlo Agocs2015-07-251-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-47195 Change-Id: I40bc7be816f5e23a63a2fe6d32842143b52f9d58 Reviewed-by: jian liang <jianliang79@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-013-2/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * Return format as specified in original QWindowMike Krus2015-06-262-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Overload QPlatformWindow::format() to return the desired format defined in the QWindow. This is required for windows that define specific surface formats (such as those used in Qt3d which require a depth buffer). This is similar to what is done in the OS X Cocoa QPA plugin. Change-Id: I7661a2a9c4e13603d03d3a5be10d000f73c712e6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * iOS: handle loading assets with different format than jpgRichard Moe Gustavsen2015-06-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The current implementation assumed that the image format of the file loaded would be jpg. This has proven not to be correct, e.g sometimes the format is png. This patch will change how the image url is reconstructed so we doesn't loose/hard code the format. Change-Id: I22d8ca0108e52d3670c2601f0bb9255406b896cf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | iOS: Use LC_MAIN to wrap user main() instead of mangling object filesTor Arne Vestbø2015-06-291-14/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With iOS 6.0 and above the LC_MAIN load command is available, which allows dyld to call the application entrypoint directly instead of going through _start in crt.o. By passing -e to the linker we can change this entrypoint to our wrapper that sets up the separate stack before entering the native iOS runloop through UIApplicationMain. As before, we call the user's main() from applicationDidFinishLaunching. By using LC_MAIN instead of messing with the object files we open up the possibility of generating Bitcode instead of object code, which can be useful for link-time optimizations, either locally or by Apple. Change-Id: If2153bc919581cd93dfa10fb6ff1c305b3e39a52 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* | Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/devSimon Hausmann2015-06-049-72/+407
|\ \
| * | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-039-72/+407
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
| | * iOS: remove 'truncation from double to float' compiler warningRichard Moe Gustavsen2015-05-131-1/+1
| | | | | | | | | | | | | | | Change-Id: I0b4b1f062180cfe09ceb275484c39afeaaa90cac Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| | * QPA plugins: Use _iid macros instead of strings in Q_PLUGIN_METADATA.Friedemann Kleint2015-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it easier to change the version numbers by changing the macros in QtGui. Task-number: QTBUG-46009 Change-Id: I94c9591ec6f7c9173a698df9e1fe8fd6a904caf4 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| | * ios: change file engine caching logic for loading assetsRichard Moe Gustavsen2015-05-101-18/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current caching strategy had a flaw in that it tried to lazy-lock the mutex only if g_currentAssetData was non-zero. For this to be somewhat reliable, g_currentAssetData would have to be volatile. But that would still not be enough since thread-unaware code optimizations might also happen on the CPU level. Instead of complicating the current logic more, change it to only do caching per thread. Since QThreadStorage will take ownership of its data, we can't let it store a pointer to QIOSAssetData directly since we need to control the life time of QIOSAssetData using deleteLater. Change-Id: I2c3ffb3257ec2bdec8be71a3d63f666ab33b5277 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| | * ios: Add support for QOpenGLWidget and QQuickWidgetLaszlo Agocs2015-05-074-9/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The global shared context is now always enabled on iOS. This means that contexts used by QOpenGLWindow/Widget and QQuickWindow/Widget and the iOS backingstore will share with each other. [ChangeLog][QtGui] QOpenGLWidget and QQuickWidget are now supported on iOS. Task-number: QTBUG-40034 Change-Id: Ibfb99ffcb18f8f8d263662fbf237bc348fc730ee Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| | * ios: implement Qt::WindowTransparentForInputRichard Moe Gustavsen2015-05-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the flag is set, report to UIKit that it should continue searching for the touch target by returning 'NO' from [UIView pointInside:]. Change-Id: I723f64fd855284fa60d0be18b2535dfa61f31381 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| | * ios: don't autoactivate if _q_showWithoutActivatingRichard Moe Gustavsen2015-05-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Widgets can have the attribute Qt::WA_ShowWithoutActivating set, which is forwarded to QWindow as a property (_q_showWithoutActivating). Both The cocoa plugin and the windows plugin check for this property before activating a window upon setVisible, so lets do the same for the iOS plugin. Note that this is not the same as shouldAutoActivate, since the window should gain focus like normal if the user taps on it. Change-Id: Ie6c95d4044906d97f0a03d27009a23d462c6ca34 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| | * ios: don't accept first responder if Qt::WindowDoesNotAcceptFocusRichard Moe Gustavsen2015-05-062-1/+4
| | | | | | | | | | | | | | | Change-Id: I01801648a1971444e0727e1bf0790cb3a0d0aad5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| | * ios: factor out authorization checkRichard Moe Gustavsen2015-05-061-29/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out the check since it's needed both when loading assets and when creating an entry list. Note that the file flags returned from the file engine will report if the asset is not readable due to authorization status, so we don't need to check this again when trying to load. Change-Id: I77ebbc370f0a7a6020ed484e53ece32bc7fa51bd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| | * ios: add support for fetching entry list in QIOSFileEngineAssetsLibraryRichard Moe Gustavsen2015-05-062-4/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch will implement support for listing all available pictures on the device by e.g doing: QDir dir(QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).last()); QStringList list = dir.entryList(); Change-Id: I52a07ba48e074bc6e509f2ed3afc3dfea17abc5d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| | * ios: add fallback in QIOSFileEngineAssetsLibrary for loading assets from ↵Richard Moe Gustavsen2015-05-061-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ALAssetsGroupPhotoStream [ALAssetsLibrary assetForUrl:] will not load assets coming from ALAssetsGroupPhotoStream. Such assets can be stored in the cloud and might need to be downloaded first. Unfortunately, forcing that to happen is hidden behind private APIs ([ALAsset requestDefaultRepresentation]). So if the user through QIOSFileDialog opens the photo stream folder and chooses a photo inside it, QIOSFileEngineAssetsLibrary will fail loading it. This patch implements a work-around that basically asks ALAssetLibrary to enumerate all assets in the photo library, and stop once we find an asset with the correct url. At that point we also have a pointer to a ALAsset that can be used for loading. This is off course a slow way of loading an asset, but at least better than not being able to load it at all. Change-Id: Ie50344974f043f909ee94fa12e7eb4a40a666c7f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| | * ios: add helper class for enumerating all available assetsRichard Moe Gustavsen2015-05-061-0/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for enumerating all available assets on the device. Trailing patches will use the class to fetch a list of all available assets for directory listing, and to search for assets that cannot be loaded by [ALAssetsLibrary assetForURL:]. Change-Id: I319721b536b14424fc8f54f683513aa7ca64e7f0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>