summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios
Commit message (Collapse)AuthorAgeFilesLines
...
* iOS: Use dispatch_async instead of performSelectorOnMainThread for IMETor Arne Vestbø2014-08-261-10/+12
| | | | | | | | Gets rid of awkward wrapping of Qt::InputMethodQueries as integer in a NSObject. Change-Id: Ia7e368fc12ec7957ca8ab602d8cec1e0a071af1d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Add UIResponder helper to get current first responderTor Arne Vestbø2014-08-262-0/+29
| | | | | Change-Id: I422d45860a52861893d963fabbecd4ac30477272 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Accessibility iOS: Fix crash after deleting a viewFrederik Gladhorn2014-08-262-3/+6
| | | | | Change-Id: I64e8357fcbf7f312308490351b7c692d31db5a43 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Allow ES3 (and ES1) context creation on iOSJames Turner2014-08-191-5/+18
| | | | | | | | | Instead of hardcoding an ES2 context, use the major version from QSurfaceFormat. The EAGL API constants match the major versions so simply cast to avoid SDK version issues. Change-Id: Ieb46f10ea6b797d65c6c8b778bb043becb7a2f95 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-121-13/+6
|\ | | | | | | | | | | | | | | | | | | | | | | Manually included changes from 3a347a4e70e5a10ee92dd2578316c926a399e894 in src/opengl/qgl.cpp. Conflicts: src/opengl/qgl_qpa.cpp src/plugins/platforms/android/androidjnimain.cpp Change-Id: Ic26b58ee587d4884c9d0fba45c5a94b5a45ee929
| * Font Database: Add support for private, system UI font familiesGabriel de Dietrich2014-08-111-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We introduce QPlatformFontDatabase::isPrivateFontFamily() to allow testing for private, system UI font families. Both QFontComboBox and QFontDialog need to filter out those private font families which, by definition, should be hidden from the end user. (The textedit example had to be updated to fix the issue where the default font would be private. In 5.4, we will be adding an equivalent, public API in QFontDatabase, and a better solution for the textedit example and QTexEdit in general). In particular, on OS X and iOS, private fonts are used for the system UI font. Those have their font family name prefixed by a dot. QCoreTextFontDatabase knows about this, and makes sure those are tested positive as private font families. In order to have a cleaner layer separation, we moved the QPA theme font resolution from the platform theme classes into QCoreTextFontDatabase for both Cocoa and iOS QPA plugins. In both cases, we use CoreText's CTFontCreateUIFontForLanguage(), that nicely maps to the HITheme API we were using so far on Mac. That means one HITheme dependency less. We also cache the font descriptors we get for these font for each time QCTFD::populateFamilies() gets called. (While not common, this currently happens in auto-tests, like tst_QFontDatabase, and could happen in actual applications -- specially when adding and removing application fonts.) Change-Id: Ic6f0b60f9f597afee1a43596a669742dc546b97f Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | iOS: Let QScreen manage UIWindow and root view-controllerTor Arne Vestbø2014-07-237-54/+64
| | | | | | | | | | | | | | | | | | | | Instead of having the application delegate set up a UIWindow and root view-controller, we move the responsibility to QScreen, since in a multi screen scenario we will need one UIWindow per screen, as well as one root viewcontroller per window. Change-Id: If5b0d44b8f8a697d830b33b4fe420bff56a7629b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | iOS: Detect external screen connections and expose as additional QScreenTor Arne Vestbø2014-07-214-24/+87
| | | | | | | | | | | | | | | | The additional QScreen can not be used for anything yet, since we don't set up a window and root view controller for it. Change-Id: I335b796bdd89fc58a27ec4e20c5ed355be0cab66 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* | iOS: Add helper for getting the iOS platform integration instanceTor Arne Vestbø2014-07-216-4/+16
| | | | | | | | | | Change-Id: I550d345ab0f8bcba1225c425464e198d43d9fda8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* | iOS: Fix compilation with Xcode6/iOS8 SDKTor Arne Vestbø2014-07-211-0/+1
| | | | | | | | | | | | | | We were implicitly including OpenGLES/ES2/glext.h prior to iOS8. Change-Id: I353badb5c209b9ebc57c1718223c164590705064 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* | iOS: Refactor qioswindow.mm into quiview.mm and quiview_accessibility.mmTor Arne Vestbø2014-07-216-380/+493
| | | | | | | | | | Change-Id: Ib6297e37d67b2c0ea251ae054b8ff877af2673a5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* | iOS: Fix compilation warningTor Arne Vestbø2014-07-041-2/+1
| | | | | | | | | | | | | | warning: unused variable 'iface' [-Wunused-variable] Change-Id: I882b71e5ae4afac1f3eb8b59d378b1a0c6fcade1 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-013-39/+61
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/network/socket/qnativesocketengine_winrt.cpp src/plugins/platforms/android/androidjniaccessibility.cpp src/plugins/platforms/windows/qwindowswindow.cpp Manually adjusted: mkspecs/qnx-armle-v7-qcc/qplatformdefs.h to include 9ce697f2d54be6d94381c72af28dda79cbc027d4 Thanks goes to Sergio for the qnx mkspecs adjustments. Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
| * iOS: delay callbacks to UITextInput to avoid recursionRichard Moe Gustavsen2014-06-063-39/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the application calls "reset" or "commit" on the input method (or forces active focus on some other item) from a text changed or key pressed handler, iOS will sometimes throw an exception. It does so because we try to change the state of UITextInput (by calling textDidChange) while processing a callback from the same place (insertText). Optimally this should not happen since we would normally post such events to Qt, not send them directly. But with text input we cannot do this since UITextInput expects us to update immediately upon receiving text input callbacks. If not, word completion and spell checking will stop working. This change will guard against recursive callbacks by delaying callbacks to UITextInput when text/selection/first responder changes. Change-Id: I099f30adf1c5aba241fc833a45b423016f4ed8d0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵J-P Nurmi2014-06-071-3/+3
|\| | | | | | | refs/staging/dev
| * iOS: Be more careful when hiding the keyboard upon enterRichard Moe Gustavsen2014-05-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A typical pattern in an application is to listen for "enter" in a line edit and transfer focus to the next edit in the focus chain. This would currently not work on iOS since we would force the keyboard down after delivering the KeyPress/release events, effectively overriding any focus handling done by the app. This patch will hide the keyboard _before_ sending the events, so that we don't override focus handling done by the app. By also hiding the keyboard using QInputMethod, the hiding will also be delayed a bit (in QIOSInputContext) to catch subsequent hide/show calls. Change-Id: Ic19511d494a55d1bda963ed9bc7185d63b51bc03 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | Accessibility iOSFrederik Gladhorn2014-06-0610-2/+495
|/ | | | | | | | | | | | | | | | | | | | | This lays the foundation for iOS accessibility. The approach is slightly different from other a11y bridges in that we completely flaten the hierarchy of wigets/quick items to a list. This works well with VoiceOver since there are comparatively few elements. The cache implementation for OS X is re-used. With this patch VoiceOver on iOS works on many applications out of the box. For now it sends the screen changed notfification somewhat overzealous, that will need revisiting and potentially new API in QAccessible. Device orientation changes are not yet supported. [ChangeLog][iOS] Accessibility was added to the iOS platform port. This enables Qt applications to be read by VoiceOver on iOS devices. Task-number: QTBUG-39097 Change-Id: I441e844652d528cc2fdcc444f43b54ed6fa04f0c Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: don't report negative selection ranges for backspaceRichard Moe Gustavsen2014-05-211-1/+1
| | | | | | | | | | | | | | | | | Qt sometimes report that the selection anchor is placed before the cursor when querying it for current selection. We need to accomodate for this when reporting current selection back to iOS, since it expects the range to always be positive. When pressing backspace, iOS will select the letter that should be deleted, and then call "deleteBackwards". If holding down backspace for a while, it will start selecting whole words instead. Since we reported negative ranges during this process, it caused artifacts and stray letters to be drawn. Task-number: QTBUG-39073 Change-Id: Ida9518307adce915adf49160b541a2f88637a0da Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Gracefully handle cancelling of subset of active touchesTor Arne Vestbø2014-05-081-11/+25
| | | | | | | | | | | | | | | | | | | | | | | When applying the five-finger pinch gesture, we get a touchesCancelled callback with all five touch points, but the pinch gesture ends when the second to last finger is released from the screen. The last finger will not emit any more touch events, _but_, will contribute to starting another pinch gesture. That second pinch gesture will _not_ trigger a touchesCancelled event when starting, but as each finger is released, and we may get touchesMoved events for the remaining fingers. The event property 'allTouches' contains one less touch point than it should, so this behavior is likely a bug in the iOS system gesture recognizer, but have to take it into account when maintaining the Qt touch state. We do this by assuming that there are no cases where a sub-set of the active touch events are intentionally cancelled, and always clear the list of active touches. Task-number: QTBUG-37304 Change-Id: Icee79978508ecbc6854c0fb55d2da48b99d92f96 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-033-5/+29
|\ | | | | | | | | | | | | Manually fixed up: isES -> isOpenGLES src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp Change-Id: I57d2ef26c3d4a7b40ace09f4e8560b7686650ea5
| * iOS: Send updated expose events on application background/foregroundingTor Arne Vestbø2014-04-282-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an application has background processing enabled, for example for communicating with an external accessory or getting location updates, it might trigger code that does UI updates, which will kill the app as doing UI in the background is not allowed on iOS. We guard against this by propagating the backgrounding as updated expose events with a non-exposed region and isExposed() returning false. This means clients who correctly use QWindow::isExposed() to guard their drawing code (including the scene-graph), will live to see another day. Task-number: QTBUG-36956 Change-Id: Ib708394d33093affe68c9f2c7abde7e54be5ec74 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
| * iOS: Send application state changes synchronouslyTor Arne Vestbø2014-04-281-0/+1
| | | | | | | | | | | | | | | | The user might have a limited time to react when the application is suspended, so we need to send the event as soon as possible. Change-Id: Ib6c342f5426cf15e36ba4ef57edf30878f86d1c9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* | Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-011-0/+1
|\| | | | | | | | | | | This merge adds the opengl rename. Change-Id: I84ea0b6abee9780ebb2cf3f64ab9e3fdf2acab3e
| * deprecate import_qpa_plugin and qpa_minimal_pluginOswald Buddenhagen2014-04-241-0/+1
| | | | | | | | | | | | | | | | they have been fully superseded by 4255ba40ab073afcf2a095b135883612859af4c2. Change-Id: If7ac14c8b7d3cf00fb0cb916036b62eb86c9cee0 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | iOS: scroll screen after hiding keyboard programaticallyRichard Moe Gustavsen2014-04-291-0/+7
|/ | | | | | | | | | | When the keyboard is told to hide, we resign first responder. If this is done programatically on touch press, this will make the "hide keyboard gesture" receive a touchesCancelled instead of a touchesEnded. Since we didn't catch this from before, the gesture was left in a mixed state causing the screen not to scroll when later showing the keyboard. Change-Id: I70ed59710128a912097cd5bfbdd8f49b20b7934c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: fix crash in auto correction when using unknown font familyRichard Moe Gustavsen2014-04-161-0/+2
| | | | | | | | | | | | If QFont reports a family name that cannot be used to instanciate a UIFont, we end up trying to insert a nil object to an NSDictionary. This will raise an exception. This patch will check that we have a valid UIFont before using it. Task-number: QTBUG-38018 Change-Id: Id8a2e4afea8c915ff43a7e4680304ba19328f9c2 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* iOS: Share default-FBO for windows between contexts in a share-groupTor Arne Vestbø2014-03-311-4/+9
| | | | | | | | | | | | | | | The current implementation of QOpenGLContext sharing assumes that the contexts form a tree and that leaf-nodes are destroyed before their parents. We build on this assumption and keep track of the default FBOs for windows in the root context of the tree. This allows two shared contexts to both makeCurrent() on the same window surface without resulting in two FBOs being set up (which doesn't work on iOS due to the CEAGLLayer already being tied to another render-buffer). Change-Id: Ib9f8c597effe488480fe99e10846be22c257f490 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* iOS: don't scroll towards cursor during touch pressRichard Moe Gustavsen2014-03-291-0/+19
| | | | | | | | | | While the user is touching the screen, postpone scrolling until we get a touch release. Scrolling in the middle of a touch sequence will change the coordinates under the touch, and cause some artefacts. Change-Id: I02ef420abaab780a459f014d4b4cfb75c8fbb725 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: stop keyboard from reopending after the gesture finishesRichard Moe Gustavsen2014-03-291-2/+38
| | | | | | | | | | | | | | | | | | | On iOS we have set the style hint 'SetFocusOnTouchRelease'. This is in conflict with the 'hide keyboard' gesture, since a control can try to regain focus (and open the keyboard) if the gesture ends on top of it. So we need some extra work-around code to prevent this from happening. The correct way would probably be to cancel the touch sequence once the gesture triggers, but this is not well implemented in Qt yet, especially in combination with widgets and mouse synthesis. Since usage of the gesture behaves really bad in some cases (e.g if using the TextEdit example) we need to apply this for now. Change-Id: Ib3327c0bd94d722b4c4793bc6d152d6d19810e4b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: animate screen from current in-flight geometryRichard Moe Gustavsen2014-03-291-1/+1
| | | | | | | | | | | | If you show/hide the keyboard quickly while we scroll the screen, the scroll will appear to jump. The reason is that the screen animation will start from where the model layer is at, and not the presentation layer. So specify that the animation should start from the current state of the presentation layer. Change-Id: I3db87ab11aab583eb50784b0c0a03a9a07c8b822 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: keep keyboard rect in syncRichard Moe Gustavsen2014-03-291-3/+0
| | | | | | | | | | | | | | If you resign/become first responder several times while the keyboard is animating (e.g changing focus between focus objects while the keyboard is animating), iOS will short-cut the whole animation, and jump directly to keyboard end-state. For that reason, we always need to handle keyboardRectChanged, and not bail out early. This is fine, since the guard we had was really only meant for keyboardWillShow/Hide in the first place. Change-Id: I3a3d1e7061962286c538360029ed38410dc0f347 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* iOS: Add support for offscreen GL surfaces without using hidden windowsTor Arne Vestbø2014-03-283-0/+24
| | | | | | | | | | | | | | There's no need to create a hidden window to get a surface on iOS, as the platform supports FBOs. Note that defaultFramebufferObject() returns 0 in the case of offscreen surfaces, which is technically not a valid FBO on iOS due to the indirect rendering, but binding and rendering to the zero-FBO seems to be no-ops, so clients may safely call eg glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject()) to restore the default FBO after drawing to its own FBO. Change-Id: I2e67f5d69c0698562052f5ac1df0bbfaa3337148 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* iOS: Check FBO status and return failure from QIOSContext::makeCurrent()Tor Arne Vestbø2014-03-272-6/+36
| | | | | | | | | | | | | | The Khronos documentation for glCheckFramebufferStatus recommends calling the function to see if the framebuffer is complete prior to rendering. We now give more info to clients that call makeCurrent(), by storing the state of the default FBO and returning that, instead of always returning true and leaving the clients vulnerable to calling OpenGL functions on a non-complete FBO. Change-Id: Ia99c21f811ac799b350f07e73b2ae4b173d71120 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* iOS: send a Qt::Key_Return when the user hits done/enterRichard Moe Gustavsen2014-03-211-2/+11
| | | | | | | | | | We need to send key events when the user hits enter, otherwise there is no way to know when the user has 'confirmed' the text he wrote. This is on par with how it's done for the Android port. Change-Id: I585d4198de24b0d251e5e0dd2956ce81b6483f82 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: implement 'close keyboard' gestureRichard Moe Gustavsen2014-03-211-3/+27
| | | | | | | | | | | | | | | | | | | | | | Before this patch there were no way for the user to hide the keyboard on iPhone for multi-line edit fields unless the app had a separate button added for it. And even that would be problematic since we scroll the screen (and perhaps the button) to track the cursor. This patch implements a gesture that resembles the 'hide keyboard' gesture that UIScrollView implements on iOS 7. Note that if you start the gesture inside the edit field, you will start selecting text as well. This will also cause the cursor to move and the screen to scroll. After some testing and failing, it seems like we need to live with such artifacts until we do get around to do the only sensible thing; fix up how we do text selection on touch platforms. Working around it becomes just to messy. Change-Id: I1c0d9c88ff1f5430587a49591f165b9708e5dc60 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Workaround for misbehaving [UIScreen screens] in iOS 7.1Eduard Veleba2014-03-191-1/+3
| | | | | | | | | | | | On iOS 7.1 [UIScreen screens] sometimes returns empty NSArray which is against documentation and causes immediate application crash. This workaround uses [UIScreen mainScreen] in case [UIScreen screens] returns empty NSArray. Task-number: QTBUG-37601 Change-Id: I9b341b9ca788b5fc81804489d2e0a3af84207168 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: update keyboard rectangle when scrolling the screenRichard Moe Gustavsen2014-03-151-8/+24
| | | | | | | | | | When we scroll, the keyboard will change position relative to QScreen, even if it appears to stay put. For that reason we also need to update the keyboard rect after doing a scroll. Change-Id: I9bda2ab5b5e4970f488d3e69e44cf58e273f8fcd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: implement clipboardRichard Moe Gustavsen2014-03-065-2/+325
| | | | | | | | This will implement support for copy/paste operations inside, and between, applications. Change-Id: I50031b89bdb07f106950dc90fb8b1accbd1191bb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Re-enable drag-and-drop on iOS after bugfixes to QBasicDrag and friendsTor Arne Vestbø2014-03-061-2/+0
| | | | | Change-Id: I0fd4e5e8d561826841cc78b26cd524ba01a8b689 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* iOS: prevent crash on iOS 5Richard Moe Gustavsen2014-03-041-3/+3
| | | | | | | | | | For some reason, the [] access into NSDictionary causes a crash on iOS 5. So instead use the API as listed in the documentation: objectForKey. Task-number: QTBUG-36532 Change-Id: I19fdf0f4ba1aebaf9477e2bd45040c389923605d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: correctly report Landscape or InvertedLandscape screen orientation.Yoann Lopes2014-02-141-4/+4
| | | | | | | | | | | | The Qt documentation says that PortraitOrientation is rotated 90 degrees clockwise relative to LandscapeOrientation. This means that the home button should be on the right when held in LandscapeOrientation, therefore, Qt::LandscapeOrientation == UIDeviceOrientationLandscapeLeft. Without this patch, all QScreen mapping functions are broken. Change-Id: I2c570cd0307b7fbd59c749d6574dcb258790cfbc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: only activate top-level windowsRichard Moe Gustavsen2014-02-141-9/+12
| | | | | | | | | | | | | | | From before we would activate all QWindows that the user tapped on, or setVisible were called on. This is wrong since a QWindow does not have to be a top-level window. For a non-alien widget application this would mean that we would send activation events for all widgets that the user tapped on all the time. With this patch we do some extra checking before we tell a QWindow to activate. Change-Id: I1afe97e5384c36c67fee0bbd070d880bba7528a1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: activate window on touchesBeganRichard Moe Gustavsen2014-02-141-8/+3
| | | | | | | | | | | | | | We need to activate a window on touchesBegan instead of touchesEnded. The reason we used to do this on touchesEnded was to delay activating a window in case the user started e.g a flick. But delaying the activation can cause problems if the app activates a different window on press. We will then cancel this out on release since we then raise the pressed window instead. This is e.g typical when opening popups, and will cause focus to not be restored properly when later closing the popup again. Change-Id: I709b2f2e2633c9dc85c2761b0b176cd23c2f6b36 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: don't store reference to focus objectRichard Moe Gustavsen2014-02-142-5/+1
| | | | | | | | | | | Sometimes focus object is updated after we get a callback that the cursor rectangle has changed. And there is no reason to keep a local reference to it. Since we also send events to the qApp->focusObject from UIView_textInput, we now end up more consistent. Change-Id: I3976175aae4e3f346be9bc5b771ac0fdefc03ae6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: return correct uiview for IM rectanglesRichard Moe Gustavsen2014-02-061-0/+12
| | | | | | | | | | | UITextView has a property for specifying which UIView the CGRects you return should be aligned with. This makes a difference for widgets when not using alien, since then the view that draws the text will usually not be the same as the view that backs the top level QWindow. Change-Id: I240d63c98544c39308cd91465ee84351e7d7d1f4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: be more specific about IM callbacks to iOSRichard Moe Gustavsen2014-02-061-11/+16
| | | | | | | | | No need to call textWillChange all the time if the text is really not changing. And report that selectionWillChange when Qt reports that it has changed. Change-Id: I7bd9f540cd9302c37888926a6152b803cc871ccb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: return styling hints for text correction pop-upsRichard Moe Gustavsen2014-02-061-0/+18
| | | | | | | | | | By returning the font used at the cursor position, the correction pop-up will be resized to match the point size, and the text marking will get correct height. Change-Id: I362579b793794835323bb9ceb5ddb4655526f392 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: send backspace events directlyRichard Moe Gustavsen2014-02-061-5/+7
| | | | | | | | | | | | | For legacy reasons, we send IM events to the focus object directly instead of through QPA. To be consistent, and to ensure that IM and key events end up at the same object in the same order, we need to send key events directly to the focus object as well. We should consider fixing up QPA to support IM events better, but this will do for now. Change-Id: I8a18a1f7b7295e5c64a109fb98eee928fae06a0f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: send IM events instead of fake key eventsRichard Moe Gustavsen2014-02-061-12/+9
| | | | | | | | | | | | | | | Sending faked key events is not such a good idea, since: 1. We don't get key events on iOS, but text events 2. We cannot determine correct key code or modifiers, nor do we want to fake modifer press/release etc. 3. Android uses IM for all text input So it seems that the correct solution is to avoid sending key events in the first place. This will also bring the iOS port on par with the Android port. Change-Id: Ibac1d335184e62eb4185cfd4218a0ec73dffb2c4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: add spell checking supportRichard Moe Gustavsen2014-02-062-0/+3
| | | | | | | | | We don't have a separate enum just for spell checking in Qt, but Qt::ImhNoPredicitiveText should cover it. So use it to enable/disable both spell checking and auto completion. Change-Id: I7ad661cb7d720988f13bc1ed940573006c0ce229 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>