summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios
Commit message (Collapse)AuthorAgeFilesLines
* iOS: Track QIOSViewController -> QIOSScreen using QPointerTor Arne Vestbø2015-02-021-3/+4
| | | | | | | | | We may receive viewWillLayoutSubviews calls for the view controller even if QIOSScreen has released the UIWindow that retains the view controller. Change-Id: I0cc7c50dbb5ee00224aec46d070b04efe069e85a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Guard QIOSScreen against notifying Qt about changes to deleted QScreensTor Arne Vestbø2015-02-021-6/+14
| | | | | | | | | | | Now that we can rely on screen() returning 0 when the QScreen is not available we can return early from updateProperties(). We still compute the member variables as they may be accessed directly for the still alive QPlatformScreen. Change-Id: Ia7d0d29a6b50a9c932b565dc53b23d66331c275e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Disconnect focusWindowChanged connection on QIOSViewController deallocTor Arne Vestbø2015-02-021-1/+8
| | | | | | Change-Id: I6acac4c926fcf5459364133b6cc58baff0519074 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Keep size and device pixel ratio of QIOSBackingStore in sync with windowTor Arne Vestbø2015-02-022-10/+10
| | | | | | | | | | We were only doing this for the size, which caused problems when moving a window from one screen to another where the two screens had different device pixel ratios. Change-Id: If56df34677417369639ee8e4df05820fddd9198d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Limit auto-rotation to device screen (excludes external screens)Tor Arne Vestbø2015-01-242-21/+23
| | | | | | | | | | | An external screen should always stay in the native orientation of the screen, and not be affected by rotations of the device. If the user requires the external content to follow the device rotation, this can be done explicitly by listening to orientation changes of the main screen, or using QSensors. Change-Id: I3a98655d11915f0db107930e7d97a24417656bc9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Track QPlatformScreen -> QScreen using QPointerTor Arne Vestbø2015-01-241-0/+3
| | | | | | | | | | Allows the QPlatformScreen to verify that the QScreen is alive before sending events to QPA for the given screen (which will assert if the screen is being destroyed). Change-Id: Ie77674fead3e0a4d4f6fedbf1f7f3c98364c7485 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Associate UIScreen and show UIWindow on initial QWindow mappingTor Arne Vestbø2015-01-232-13/+43
| | | | | | | | | | | | We delay showing the UIWindow until the first QWindow is created and mapped to the screen. This allows external screens to stay in mirror mode until a QWindow has been explicitly created on that screen. We also remove the screen-association when the last QWindow on that screen has been removed, which will return the external screen to mirror mode. Change-Id: Iccecb297281d0c4f397f69f2494debff051ade01 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Base [QIOSViewController shouldAutorotate] on the locked orientationTor Arne Vestbø2015-01-233-16/+14
| | | | | | | | | Instead of keeping a separate property for the auto-rotation. Allows us to override shouldAutorotate later on to make the decision even more fine grained. Change-Id: I9a3cd6c1316f2a5485a94ef8d9b633df87f46f5f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Ignore statusbar changes for windows on external screensTor Arne Vestbø2015-01-231-0/+5
| | | | | Change-Id: Ib7919abb2da324f6ffa058e8b215bf566ff43e40 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Decouple screen geometry calculations from UIWindow geometryTor Arne Vestbø2015-01-231-11/+20
| | | | | | | | | | | | | At startup or when a new UIWindow has been created but not associated with a UIScreen yet, its geometry will be invalid, and cause the wrong geometry for its corresponding QScreen when we use it to map geometry. Instead we explicitly use the status bar orientation to map to the correct geometry. Change-Id: If37b3ab2ad5db65e20a7e3af5c3854b3e3ddff0d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Don't re-apply window state during QIOSWindow constructionTor Arne Vestbø2015-01-231-1/+5
| | | | | | | | | | | We set the parent of the window as part of constructing it, which will cause a layout of the QIOSDesktopManagerView's subviews, but in this case we don't need to re-set the window state as that's taken care of later on in the QIOSWindow constructor. Change-Id: Ic197c9a50394908c8aa2155abdc97bc322937a85 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Simplify QIOSWindow::setParent()Tor Arne Vestbø2015-01-231-11/+4
| | | | | | Change-Id: I78c47c6ccdb53045f3fa412b1489e08691d3e195 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Only use [UIDevice orientation] for the main/device screenTor Arne Vestbø2015-01-231-0/+4
| | | | | | | | Auxiliary screens are always in their primaryOrientation. Change-Id: I078151ccbdb8a78eb095a05672f7804ab608ff24 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Make screen orientation reporting more consistentTor Arne Vestbø2015-01-222-12/+19
| | | | | Change-Id: Ic21efb939639711c4071161e3c742525a55d41be Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Fall back to statusbar orientation for initial QScreen::orientation()Tor Arne Vestbø2015-01-211-3/+13
| | | | | | | | | | | | | | At startup, iOS will report UIDeviceOrientationUnknown for the device orientation, which toQtScreenOrientation() maps to portrait. We can be smarter than that, by falling back to the orientation of the statusbar, which in most cases match the physical orientation of the screen at startup, unless the Info.plist file has been modified to limit the possible orientations. See also: https://gist.github.com/torarnv/40c1931205e33d2b1ed3 Change-Id: I5c78fbe5c670ed2909a51b478bd4814e2433554f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Use QPlatformIntegration::destroyScreen() instead of manual deleteTor Arne Vestbø2015-01-212-1/+4
| | | | | Change-Id: I8128fa1a4b7d6d202d15c03d51f6360a74d75d8c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-217-32/+166
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/global.pri src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.h src/corelib/tools/qdatetime.cpp src/plugins/platforms/xcb/qxcbscreen.h src/plugins/platforms/xcb/qxcbwindow.h src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qcolordialog_p.h tools/configure/configureapp.cpp Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
| * iOS: guard text responder from clearing selectionRichard Moe Gustavsen2015-01-152-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When programatically setting a text selection on iOS, we call [UITextInputDelegate selectionWillChange] to report the change. If auto correction is enabled, UIKit will then reset the current tracking, and for some reason tell us to clear the selection. This is contradictory to us saying the the selection is about to change, and will cause an unwanted recursion back to Qt. Since there seems to be no way to stop UIKit from doing this, this patch will instead add a guard that refuses to change the selection recursively while processing a selection change from Qt. Task-number: QTBUG-43716 Change-Id: Id487a57cdda55d7e2d09c3efc14c7f03f566f15a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: Prevent recursion when updating/syncing QIOSViewController propertiesTor Arne Vestbø2015-01-091-0/+12
| | | | | | | | | | | | Change-Id: I22f1eaa892cba23c498ae210a9a483e468268581 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: Fix QWindow::reportContentOrientationChange on iOS6+Tor Arne Vestbø2015-01-094-17/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | On iOS 6 and above, [UIViewController supportedInterfaceOrientations] needs to return 0 for [UIApplication setStatusBarOrientation] to work. This means once you report a content orientation other than the primary orientation, you'll disable auto-rotation. Reporting the orientation as Qt::PrimaryOrientation restores the auto-rotation behavior. Change-Id: I1b8c765c507728fdbc5b828e0b4215324014e221 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: Move implementation details of QIOSViewController to class extensionTor Arne Vestbø2015-01-082-6/+10
| | | | | | | | | | | | Change-Id: I602d8f1c9f20d3bfed4db3405460021146b546d8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: Raise window level instead of hiding statusbar during VKB scrollTor Arne Vestbø2015-01-072-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hiding the statusbar using the normal iOS APIs result in QScreen reporting new availableGeometry, which is not what we want. The scroll of the screen is a purely visual effect, and shouldn't have any effect on observable Qt APIs besides the keyboard rect changing. Instead of actually hiding the statusbar, we achieve the same effect by raising the key window (and any other application windows, including the keyboard) to the level of the statusbar, effectively putting them above the statusbar. This still leaves popups and alert windows above the key window, as normal. Change-Id: Ib7694240ca86cfb9000de35bf0c49343ffb37e32 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: Remove QIOSKeyboardListener self-change assert/guardTor Arne Vestbø2015-01-061-2/+0
| | | | | | | | | | | | | | | | | | We're fairly confident self won't change in that case, and the assert was causing warnings in release builds. Change-Id: I4a826579bb4cedef8423e8d43cb370e1f3b80407 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Add a function for QPA plugins to explicitly destroy QScreensGiulio Camuffo2014-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously QPlatformScreen was automatically deleting its QScreen in ~QPlatformScreen(). That means that we cannot use QScreen's methods when the screen is being removed, because doing so would call virtual methods of QPlatformScreen. By that point the QPlatformScreen subclass object does not exist anymore, and we call the default implementation instead of the subclassed one, or get a crash for the pure virtual methods. This happens for example when removing a screen which contains a QWindow with some QML item using QQuickScreenAttached. This patch adds a QPlatformIntegration::destroyScreen() function, which deletes the QScreen and later the QPlatformScreen. ~QPlatformScreen will still delete the QScreen if it was not deleted with destroyScreen(), so code not ported to the new approach will continue to work as before, with only a warning added. Task-number: QTBUG-41141 Change-Id: Ie4a03dee08ceb4c3e94a81875411f6f723273fe1 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-183-27/+36
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/platformsupport/platformcompositor/qopenglcompositor.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I5422868500be695584a496dbbbc719d146bc572d
| * iOS: let keyboard gesture work better with other gesturesRichard Moe Gustavsen2014-12-111-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let the keyboard gesture work better alongside other gestures by reporting that it should: 1. not prevent other gestures from triggering. This means that even if our gesture triggers (we close the keyboard), gestures attached to sub-views will still continue tracking. 2. not be prevented by other gestures. This means that if a gesture in a sub-view triggeres before our gesture, our gesture will still continue to track. In short it means that regardless of other gestures, we always close the keyboard if our text responder is first responder and the user flicks down. And we do so as "silently" as possible. Change-Id: I22386b5ef5dedbc498a2899929ddd07424e514d8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: only clear focus object if it supports IMRichard Moe Gustavsen2014-12-112-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We try to keep a on-to-one relationship between UI controls with text input and keyboard visibility. But if the control does not use text input, then there is no reason for us to clear focus when the keyboard hides. In fact, we should avoid doing so, since that will stop e.g buttons from working correctly. The typical flow is: - a touch release targeting a button is sendt to QApplication. - QApplication transfers focus to the button. - qiosinputcontext gets notified, we refuse, and clear focus again. - QApplication enters a propagation loop where it tried to find out the receiver of the event. Since the button is now unfocused, the event will propagate up to a grandparent instead. - the button will as such not trigger. Change-Id: I70baa38299f40defc4a77f62790502e2d6ebbba9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: Only scroll to cursor on keyboard hide gesture reset if requestedTor Arne Vestbø2014-12-111-3/+12
| | | | | | | | | | | | Change-Id: I15b313b5f0d57358e405f16e941fc5061028c6a7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * iOS: Don't scroll screen on changes to input item transformTor Arne Vestbø2014-12-112-20/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | We auto-scroll the screen to reveal the cursor whenever the cursor rect changes or other properties of the input methods are updated, but the expected behavior when explicitly moving an item under the keyboard, such as when scrolling a view or moving an item using drag, is to not scroll the screen until typing commences. This matches how eg. Safari or the Notes app handles the same use-case. Change-Id: I6b6932d9bcbdccd8df26db982246c162f1574d86 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.4' into devSimon Hausmann2014-12-105-127/+213
|\| | | | | | | | | | | | | | | Conflicts: doc/global/template/style/online.css mkspecs/android-g++/qmake.conf Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
| * iOS: Guard against UIGestureRecognizer messing with selfTor Arne Vestbø2014-12-021-0/+3
| | | | | | | | | | | | | | | | We pass in self to initWithTarget, so we need to be sure that the init doesn't return a new self. Change-Id: I90d0d10d2fd1a5d38ef1ff3f23169dcce00b28e2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
| * iOS: Properly support QInputMethod's visible and animating propertiesTor Arne Vestbø2014-12-022-99/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now emit and change the 'visible' and 'animating' properties of the QInputMethod according to the documentation, which means the 'visible' property will change immediately when the keyboard is about to become visible, or about to hide, and the 'animating' property will determine if the visibility-change is just starting out, or has ended. The keyboard rect will at all times reflect the currently visible area of the virtual keyboard on screen (in focus-window-coordinates), not future state after the animating completes. Getting the future state is a missing piece of the QInputMethod API, and could be solved in the future by adding arguments to the animatingChanged signal that allow platform plugins to pass on the before- and after states. The logic for determining the keyboard state has been moved into a central function, updateKeyboardState(), which allows us to change and emit property changes atomically. There is still some parts left of the old approach, but these are left in to make further changes to the code easier to diff and understand in isolation. Change-Id: Ica52718eba503165ba101f1f82c4a425e3621002 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
| * iOS: Simplify view management in QIOSKeyboardListenerTor Arne Vestbø2014-12-024-31/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | We don't need to keep track of the view-controller or add ourselves as a gesture recognizer inside QIOSKeyboardListener. In fact, leaving the call to removeGestureRecognizer in [QIOSKeyboardListener dealloc] will result in QIOSKeyboardListener never being released, as the view that we add the recognizer to will keep a strong reference to the recognizer, so dealloc is never called unless the view is also released, which is unlikely to happen. We now fully control the lifetime of the recognizer. Change-Id: I6755e8cdfcc8f1062314db51aa54a2b7ecd1b967 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
| * iOS: Refactor QIOSKeyboardListener implementation and usageTor Arne Vestbø2014-12-022-60/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | QIOSKeyboardListener takes care of both maintaining the virtual keyboard state, and acting as a gesture recognizer for the hide keyboard gesture. We make this explicit though a union in QIOSInputContext, so that we can access each 'mode' separately. This improved code readability and allows later refactoring of the state and gesture into separate classes without changing the call sites. Change-Id: Icc60f4a542983cda7ca0fd6622963d32d1e90db9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
| * Merge remote-tracking branch 'origin/5.4.0' into 5.4Frederik Gladhorn2014-11-271-1/+7
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: dist/changes-5.4.0 7231e1fbe24102f2a93b34dfa70e3dca884440d2 went into 5.4 instead of the 5.4.0 branch, thus the conflict. Change-Id: I70b8597ab52506490dcaf700427183950d42cbd1
| | * iOS: fallback to use [UIScreen mainScreen] when [UIScreen screens] failRichard Moe Gustavsen2014-11-261-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On iOS 7.1 [UIScreen screens] sometimes (and against documentation) returns an empty array, which will lead to a crash. This patch will add a fallback path that uses [UIScreen mainScreen] instead when the screen count is 0. Task-number: QTBUG-42345 Change-Id: Ie72578ff7ecd0c8fbc971fafea45047bf1347cd9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-273-13/+17
|\| | | | | | | | | | | Change-Id: Id20053d261b4fbbcc0ac8ba49dd3ef2253fa4b95
| * | iOS: override QPlatformWindow::propagateSizeHints()Richard Moe Gustavsen2014-11-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | propagate size hints means that we should forward minimum/maximum size set on QWindow to the underlying native window to restrict how the user can resize the window. On iOS this does not make sense, but nevertheless, if we don't override the function, the default implementation will issue a warning. This again will always make creator inform that the application ended with error upon exit. Change-Id: I0a8bd74c47fafe2115add5b6eb4e77616fcbc365 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| * | iOS: only skip activating the most simple popup typesRichard Moe Gustavsen2014-11-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current approach of not activating transient windows with the popup flag set was found to be too restrictive, as it would e.g stop transient dialogs from being able to contain editable controls. This patch will restrict the number of popup types that we skip activation for to only contain a few subtypes. Task-number: QTBUG-41613 Change-Id: I381a5a79fb4f7082da18a6b4e06a7255ff400b1a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| * | iOS: Clean up QPlatformInputContext subclass headerTor Arne Vestbø2014-11-251-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implements isValid(), which should be returning true for subclasses, and re-orders and adds Q_DECL_OVERRIDE where appropriate. Change-Id: I03519bf674b6f7b7ccc07a7154c9a1fb9a8105f2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-2411-137/+384
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
| * | Merge remote-tracking branch 'origin/5.4.0' into 5.4Frederik Gladhorn2014-11-215-45/+35
| |\| | | | | | | | | | Change-Id: I95f235a66ce2e9b1fa435c0f911c6f7e811755f0
| | * iOS: close menu when keyboard hidesRichard Moe Gustavsen2014-11-131-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the menu is closed from the keyboard gesture, and the focus object doesn't change, the menu will still be in a visible state, even if the keyboard is hidden. This patch will ensure that this can not be the case by listening for keyboardWillHideNotification. Since we have no guarantee for when the destructor runs, we apply a pessimistic approach and ensure we stop listen when the menu gets closed. Task-number: QTBUG-42523 Change-Id: If734ea32d1823b978c9c1c67ebcc5b6c3c5c338c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: let focusobject be ImEnabled when a menu is attachedRichard Moe Gustavsen2014-11-131-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since the picker menu uses IM to set an alternative input view, we also need to specify that we IM is enabled. Task-number: QTBUG-42523 Change-Id: Ia559fbc0ca7e6a1a4499d5eb179baa2d915ecb17 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: close keyboard by resigning first responderRichard Moe Gustavsen2014-11-133-41/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current approach of reloading input views assumes that the first responder is not a QIOSTextResponder, but a QUIView. This is not always the case, e.g if someone calls update after setting IM enabled on current focus object to false. In that case we'll try to close the keyboard by reloading input views on a quitextresponder which can fail if the text responder has an external input view attached. This patch will instead hide the keyboard by resigning first responder when it is a QIOSTextResponder. If it is not a QIOSTextResponder it means that the keyboard is already closed, or a third-party UIVIew that supports key input is first responder. In either case we then leave it as-is. Task-number: QTBUG-42523 Change-Id: I4dab648af9029941a8d5d3b00011fbd169be5482 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: QtFirstResponderEvent needs to release firstResponder to avoid leakRichard Moe Gustavsen2014-11-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without setting firstResponder to 0 upon destruction, the current retain count would never reach zero after the event was used. The result being that QIOSTextResponder was seldom destroyed, which would also affect its inputView etc which would also be kept alive. Change-Id: Ia88e6a9d8764e7e9532487153e5e81a7ad0f9741 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| | * iOS: Remove assert when transferring or clearing first-responderTor Arne Vestbø2014-11-121-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We'd transfer or clear first-responder in a lot more cases than just when transferring to a new Qt window, such as when presenting a new view-controller on top to send an e-mail or take a picture using the camera. Change-Id: I6b2a8a6d9fd99910b96a86cf9847b7ff0128f20a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| * | Ignore nodes with no text name, value and description.Jan Arve Sæther2014-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is in order to skip certain nodes that usually only carry structural information (such as ListItem nodes). However, because of the flattening, this structural information is never used on iOS, so we can just skip the accessible node completely. Change-Id: I17018c6565f8b39831f2d2944422c6670a438ab9 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
| * | Do not skip the parent node when flattening the hierarchy.Jan Arve Sæther2014-11-201-6/+3
| |/ | | | | | | | | | | | | | | | | The weather app had a search field with a clear button as a child. Because of this bug it didn't report the content of the text edit (but only the clear button) Change-Id: I174c6e150e1991fa9aa2a911048590030b5ccc40 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
| * iOS: Allow virtual keyboard to be hidden by QInputMethod::hide()Tor Arne Vestbø2014-11-082-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling the function has the same effect as dismissing the keyboard using the native keyboard dismiss button or the hide-keyboard gesture, and will result in the QIOSTextInputResponder losing first-responder status and the current focus object being cleared. QtWidgets and other parts of Qt will try to hide the keyboard during focus changes between widgets, which we already take care of when the focus object changes, so we detect the situation and ignore it, by requiring that the current focus object matches the one we've brought up the text responder for. Showing the virtual keyboard is still a no-op, as there is no way to show the virtual keyboard without a focus-object. Change-Id: Iefcb403c2b6d3da8a4df3fcd53bc1244ba9c4d23 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>