summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/quiview.mm
Commit message (Collapse)AuthorAgeFilesLines
...
* iOS: Add support for delivering touch pressure on iPhone 6s/6s+ devicesTor Arne Vestbø2015-11-261-3/+26
| | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-031-2/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * 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 accept first responder if Qt::WindowDoesNotAcceptFocusRichard Moe Gustavsen2015-05-061-1/+1
| | | | | | | | | | Change-Id: I01801648a1971444e0727e1bf0790cb3a0d0aad5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | iOS: Clean up style in Objective-C message signaturesTor Arne Vestbø2015-05-241-2/+2
|/ | | | | | | | | | - Space between class/instance signifier - No space between return type and message name - No space in message arguments Change-Id: Ie25e0be3c134586c44bb82bf7075f6eb153388a9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* iOS: Check if window was active on setVisible(false) through native APIsTor Arne Vestbø2015-03-161-0/+17
| | | | | | | | | | | | | When a QWindow is closed and destroyed it resets QGuiApp::focus_window before calling setVisible(false) on the platform window, so we don't have the needed information anymore to check if the window we are hiding was the focus-window. To work around this we use the native state instead, which should still be valid if the window was the focus window. Change-Id: I98057e6393411471f03668e3e5ce544f6b49c01d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Add platform plugin option to debug window managementTor Arne Vestbø2015-03-161-0/+14
| | | | | | | | | | | | When the 'debugWindowManagement' option is enabled, e.g. by passing the argument -platform ios:debugWindowManagement to the application, the plugin will add a background color and outline to all QUIViews, as well as draw a grid for the underlying QUIViewController. This makes it easier to see where windows are placed when the window itself doesn't draw anything, e.g. in unit tests. Change-Id: If9a59822e0b320b154ad8e338f9fb5ec7cf191a2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-2/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/xml/htmlinfo/simpleexample.html examples/xml/rsslisting/rsslisting.cpp qmake/generators/win32/msbuild_objectmodel.cpp src/3rdparty/harfbuzz-ng/src/hb-private.hh src/corelib/global/qlogging.cpp src/corelib/io/qstorageinfo_unix.cpp src/corelib/thread/qwaitcondition_unix.cpp src/gui/kernel/qguiapplication.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp src/testlib/doc/src/qt-webpages.qdoc tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
| * iOS: only flush non-user input events from layoutSubviewsRichard Moe Gustavsen2015-02-151-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change a4e1c15b1 will cause setGeometry to take immediate effect by doing a synchronuous layout and a flush. As a side-effect, the flush will also send posted touch events. So if the current setGeometry call comes from a touchMove, a touchEnd might be delivered before the touchMove returns. A crash in QToolBar drag-n-drop is seen from this. There drag data is deleted on mouse release (during the flush), while a mouse move is already handled on the stack. When the code returns to the move handler, drag-data has been deleted, and we have a crash. Since the root problem is that we flush events on a callback from the app, we can be more careful and precise by only flushing non-user input events from layoutSubviews. Change-Id: I3f5e025d774d21509ef837de9d7e85a1ac6e48cc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | | | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-111-22/+14
|/ | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* iOS: Make QIOSTextInputResponder a proper first-responder during text inputTor Arne Vestbø2014-11-031-0/+10
| | | | | | | | | Instead of faking it, by returning YES for isFirstResponder, which caused issues when iOS would try to dismiss the keyboard by resigning the true first-responder. Change-Id: I816c4cf9c699d72995ce7968e1f1a4aa9c9c167e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Detect window deactivation without waiting for next runloop iterationTor Arne Vestbø2014-10-281-17/+41
| | | | | | | | | Since we know and control whether or not we are making a new QUIView first responder, we can take not of this at that point, and use that information when another view is resigning first responder. Change-Id: I508720d418c92dc8a8011b489cc5cace8fc82633 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Don't auto-activate popup windows unless they are standaloneTor Arne Vestbø2014-10-201-1/+1
| | | | | | | | | | | | We try to emulate a traditional window manager by activating windows on touch press (before delivering the event), and on showing/hiding windows, but this logic should not apply to popup windows (including tooltips and tool windows), as they are in most cases already active through their parent or transient parent, and should not steal keyboard focus and bring the virtual keyboard down. Change-Id: If10082bd48cdf1a9e1c41d8809066e86dafd7ffc Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: ensure edit menu works on iOS6Richard Moe Gustavsen2014-10-191-3/+8
| | | | | | | | | Method "- (id)targetForAction:(SEL)action withSender:(id)sender" is only available from iOS7. So change implementation to use whats available on iOS 6. Change-Id: I4e21495073364e83ef396dfab47a7ea2a23bbead Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Properly scope window deactivation on resignFirstResponderTor Arne Vestbø2014-10-031-1/+2
| | | | | | | | We were missing brackets, but luckily the only result was that we unconditionally flushed events through flushWindowSystemEvents. Change-Id: If10bcc6a07501b9fb0db891e01b8ecc9d794ab30 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Move statusbar visibility handling to QIOSViewControllerTor Arne Vestbø2014-10-021-0/+10
| | | | | | | | | | | | | It doesn't belong in QIOScreen, and simplifies the flow when changing the focus window or the window state of the focus window. Both will result in calling updateProperties on the view-controller, which will re-configure the statusbar visibility and hide/show it as appropriate, before triggering a re-layout of its own view, which will in turn trigger an update of the screen properties based on the new statusbar state, before re-layouting of QWindow based on the new screen state. Change-Id: I89077a3fb5f843949ce833e4e727d2c753ea2eb6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Fix touch point translation when root view controller is offsetTor Arne Vestbø2014-09-241-13/+16
| | | | | | | | | | Instead of doing manual translation of the local touch point to global screen (QScreen) coordinates we take advantage of the fact that QWindow already has a position that's adjusted for all of the view-controller offsets in its parent hierarchy. Change-Id: Ib34173db5ac053c20712dfff469c4a1286f2a324 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Simplify QWindow/UIView geometry mappingTor Arne Vestbø2014-09-241-14/+1
| | | | | | | | | As we now have a root viewcontroller that always has a geometry that matches the containing UIWindow, we don't need to do any fancy calculations when mapping between the two. Change-Id: I08a7b9992be7b7238cbad2a2da20488bba1c0939 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Implement support for native menusRichard Moe Gustavsen2014-09-231-0/+8
| | | | | Change-Id: I2c7278697499aa046ac7b1240b7bc713ad1fc709 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: Refactor text input handling to standalone responderTor Arne Vestbø2014-09-201-10/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of coupling the visibility of the virtual keyboard to the first-responder status of the currently active QUIView, we now treat first-responder as a separate state, tied directly to QWindow activation. This fits better with the concept of first-responders in iOS, as a UIView can become first-responder without dealing with text input, eg when dealing with touch events or menu actions. The decision point on whether or not to show the virtual keyboard is then handled by implementing the conformsToProtocol method and selectively returning YES for the UIKeyInput protocol. iOS internally calls _requiresKeyboardWhenFirstResponder on the UIResponder to determine this, but since we can't override a private method (like WKContentView in WebKit does) we have to rely on the fact that the implementation of the method uses the protocol conformance to make its decision. Once the virtual keyboard is up, we then need to react to changes to its configuration, such as keyboard type or the type of return key. Normally this would be a simple call to [view reloadInputViews], but iOS will not reload the built-in keyboards unless the UIResponder returns YES for _requiresKeyboardResetOnReload. Since we again can't override this private method (like WebKit does), we work around it by taking advantage of the fact that iOS will treat any change to the first-responder as a reason to do a keyboard reset. By using a stand-alone UIResponder for text input we can init and destroy these responders as needed, so that every call to reloadInputViews will trigger a reset, as the responder has not been seen before. We keep track of changes to the input-method-query, and detect whether or not we need to bring up a new UIResponder for text handling. As part of this refactoring we now tie the visibility of the virtual keyboard to the presence of a focus object that has input-methods enabled. This means that we automatically will track changes to input-elements through the focus changes, and reconfigure or hide the keyboard as appropriate. As a result the hide() method of QInputMethod becomes a no-op on iOS. Change-Id: I4c4834df490bc8b0bac32aeedbd819780bd5aaba Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Move accessibility/textinput includes in quiview.mmTor Arne Vestbø2014-09-101-4/+5
| | | | | Change-Id: Id982afb06f164bd398a6e642a48a85f277075e74 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Add helper for getting the iOS platform integration instanceTor Arne Vestbø2014-07-211-2/+1
| | | | | Change-Id: I550d345ab0f8bcba1225c425464e198d43d9fda8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* iOS: Refactor qioswindow.mm into quiview.mm and quiview_accessibility.mmTor Arne Vestbø2014-07-211-0/+346
Change-Id: Ib6297e37d67b2c0ea251ae054b8ff877af2673a5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>