From 071a0a6937432ad60c1b261af9f5b48861fbb70c Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 15 May 2019 14:31:08 +0200 Subject: iOS: be more careful about hiding the edit menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code that deals with text selection in the iOS QPA plugin, listen for changes to text selection. And depending on whether we have a selection or not, we show or hide the selection handles together with the edit menu. The problem is that the edit menu will also be told to show from other places, even if there is no selection. And for those cases, we should avoid closing it. This patch will check, before we close the edit menu, if we're tracking a selection. If not, we leave the edit menu alone. Fixes: QTBUG-75099 Change-Id: I001d818fa2ad4a215cc3fa6aa4c7faf516e1ed59 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiostextinputoverlay.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/ios') diff --git a/src/plugins/platforms/ios/qiostextinputoverlay.mm b/src/plugins/platforms/ios/qiostextinputoverlay.mm index e5419b1766..0561a826c6 100644 --- a/src/plugins/platforms/ios/qiostextinputoverlay.mm +++ b/src/plugins/platforms/ios/qiostextinputoverlay.mm @@ -834,9 +834,14 @@ static void executeBlockWithoutAnimation(Block block) - (void)updateSelection { if (!hasSelection()) { - _cursorLayer.visible = NO; - _anchorLayer.visible = NO; - QIOSTextInputOverlay::s_editMenu.visible = NO; + if (_cursorLayer.visible) { + _cursorLayer.visible = NO; + _anchorLayer.visible = NO; + // Only hide the edit menu if we had a selection from before, since + // the edit menu can also be used for other purposes by others (in + // which case we try our best not to interfere). + QIOSTextInputOverlay::s_editMenu.visible = NO; + } return; } -- cgit v1.2.3 From 55a15a1c1b93d36d705fc69e44b5c806b807dd55 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 8 Apr 2019 17:23:57 +0200 Subject: Add initial support for cross-building to iOS Tested locally with the following configurations: - iOS device builds (arm64) - iOS simulator builds (x86_64) - iOS simulator_and_device builds (fat arm64 and x86_64 archives) All iOS builds currently require a custom vcpkg fork which contains fixes for building the required 3rd party libraries. qtsvg, qtdeclarative, qtgraphicaleffects and qtquickcontrols2 have also been tested to build successfully. simulator_and_device builds are also supported, but require an umerged patch in upstream CMake as well as further patches to vcpkg. Task-number: QTBUG-75576 Change-Id: Icd29913fbbd52a60e07ea5253fd9c7af7f8ce44c Reviewed-by: Cristian Adam Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert --- src/plugins/platforms/ios/.prev_CMakeLists.txt | 81 ++++++++++++++++++++++ src/plugins/platforms/ios/CMakeLists.txt | 72 +++++++++++++++++++ src/plugins/platforms/ios/optional/CMakeLists.txt | 6 ++ .../optional/nsphotolibrarysupport/CMakeLists.txt | 30 ++++++++ 4 files changed, 189 insertions(+) create mode 100644 src/plugins/platforms/ios/.prev_CMakeLists.txt create mode 100644 src/plugins/platforms/ios/CMakeLists.txt create mode 100644 src/plugins/platforms/ios/optional/CMakeLists.txt create mode 100644 src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt (limited to 'src/plugins/platforms/ios') diff --git a/src/plugins/platforms/ios/.prev_CMakeLists.txt b/src/plugins/platforms/ios/.prev_CMakeLists.txt new file mode 100644 index 0000000000..f23cf8c300 --- /dev/null +++ b/src/plugins/platforms/ios/.prev_CMakeLists.txt @@ -0,0 +1,81 @@ +# Generated from ios.pro. + +##################################################################### +## qios Plugin: +##################################################################### + +add_qt_plugin(qios + TYPE platforms + CLASS_NAME QIOSIntegrationPlugin + SOURCES + plugin.mm + qiosapplicationdelegate.h qiosapplicationdelegate.mm + qiosapplicationstate.h qiosapplicationstate.mm + qiosbackingstore.h qiosbackingstore.mm + qioscontext.h qioscontext.mm + qioseventdispatcher.h qioseventdispatcher.mm + qiosglobal.h qiosglobal.mm + qiosinputcontext.h qiosinputcontext.mm + qiosintegration.h qiosintegration.mm + qiosplatformaccessibility.h qiosplatformaccessibility.mm + qiosscreen.h qiosscreen.mm + qiosservices.h qiosservices.mm + qiostextresponder.h qiostextresponder.mm + qiostheme.h qiostheme.mm + qiosviewcontroller.h qiosviewcontroller.mm + qioswindow.h qioswindow.mm + quiaccessibilityelement.h quiaccessibilityelement.mm + quiview.h quiview.mm + LIBRARIES + Qt::ClipboardSupportPrivate + Qt::CorePrivate + Qt::FontDatabaseSupportPrivate + Qt::GraphicsSupportPrivate + Qt::GuiPrivate + PUBLIC_LIBRARIES + ${FWAudioToolbox} + ${FWFoundation} + ${FWQuartzCore} + ${FWUIKit} + Qt::ClipboardSupport + Qt::Core + Qt::FontDatabaseSupport + Qt::GraphicsSupport + Qt::Gui +) + +#### Keys ignored in scope 2:.:.:kernel.pro:: +# OTHER_FILES = "quiview_textinput.mm" "quiview_accessibility.mm" +# PLUGIN_CLASS_NAME = "QIOSIntegrationPlugin" +# PLUGIN_TYPE = "platforms" +# _LOADED = "qt_plugin" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:.:kernel.pro:QT_FEATURE_shared: +# CONFIG = "static" + +extend_target(qios CONDITION NOT APPLE_TVOS + SOURCES + qiosclipboard.h qiosclipboard.mm + qiosfiledialog.h qiosfiledialog.mm + qiosmenu.h qiosmenu.mm + qiosmessagedialog.h qiosmessagedialog.mm + qiostextinputoverlay.h qiostextinputoverlay.mm + PUBLIC_LIBRARIES + ${FWAssetsLibrary} +) + +#### Keys ignored in scope 5:.:.:kernel.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" +add_subdirectory(optional) + + if(QT_FEATURE_shared) + endif() + + if(NOT APPLE_TVOS) + endif() + + if(NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN) + endif() diff --git a/src/plugins/platforms/ios/CMakeLists.txt b/src/plugins/platforms/ios/CMakeLists.txt new file mode 100644 index 0000000000..4c9cac2bee --- /dev/null +++ b/src/plugins/platforms/ios/CMakeLists.txt @@ -0,0 +1,72 @@ +# Generated from ios.pro. + +##################################################################### +## qios Plugin: +##################################################################### + +add_qt_plugin(qios + TYPE platforms + CLASS_NAME QIOSIntegrationPlugin + SOURCES + plugin.mm + qiosapplicationdelegate.h qiosapplicationdelegate.mm + qiosapplicationstate.h qiosapplicationstate.mm + qiosbackingstore.h qiosbackingstore.mm + qioscontext.h qioscontext.mm + qioseventdispatcher.h qioseventdispatcher.mm + qiosglobal.h qiosglobal.mm + qiosinputcontext.h qiosinputcontext.mm + qiosintegration.h qiosintegration.mm + qiosplatformaccessibility.h qiosplatformaccessibility.mm + qiosscreen.h qiosscreen.mm + qiosservices.h qiosservices.mm + qiostextresponder.h qiostextresponder.mm + qiostheme.h qiostheme.mm + qiosviewcontroller.h qiosviewcontroller.mm + qioswindow.h qioswindow.mm + quiaccessibilityelement.h quiaccessibilityelement.mm + quiview.h quiview.mm + LIBRARIES + Qt::ClipboardSupportPrivate + Qt::CorePrivate + Qt::FontDatabaseSupportPrivate + Qt::GraphicsSupportPrivate + Qt::GuiPrivate + PUBLIC_LIBRARIES + ${FWAudioToolbox} + ${FWFoundation} + ${FWQuartzCore} + ${FWUIKit} + Qt::ClipboardSupport + Qt::Core + Qt::FontDatabaseSupport + Qt::GraphicsSupport + Qt::Gui +) + +#### Keys ignored in scope 2:.:.:kernel.pro:: +# OTHER_FILES = "quiview_textinput.mm" "quiview_accessibility.mm" +# PLUGIN_CLASS_NAME = "QIOSIntegrationPlugin" +# PLUGIN_TYPE = "platforms" +# _LOADED = "qt_plugin" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:.:kernel.pro:QT_FEATURE_shared: +# CONFIG = "static" + +extend_target(qios CONDITION NOT APPLE_TVOS + SOURCES + qiosclipboard.h qiosclipboard.mm + qiosfiledialog.h qiosfiledialog.mm + qiosmenu.h qiosmenu.mm + qiosmessagedialog.h qiosmessagedialog.mm + qiostextinputoverlay.h qiostextinputoverlay.mm + PUBLIC_LIBRARIES + ${FWAssetsLibrary} +) + +#### Keys ignored in scope 5:.:.:kernel.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" +add_subdirectory(optional) diff --git a/src/plugins/platforms/ios/optional/CMakeLists.txt b/src/plugins/platforms/ios/optional/CMakeLists.txt new file mode 100644 index 0000000000..a3807bee6c --- /dev/null +++ b/src/plugins/platforms/ios/optional/CMakeLists.txt @@ -0,0 +1,6 @@ +# Generated from optional.pro. + + +if(APPLE_IOS) + add_subdirectory(nsphotolibrarysupport) +endif() diff --git a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt new file mode 100644 index 0000000000..5adac3cabb --- /dev/null +++ b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from nsphotolibrarysupport.pro. + +##################################################################### +## qiosnsphotolibrarysupport Plugin: +##################################################################### + +add_qt_plugin(qiosnsphotolibrarysupport + TYPE platforms/darwin + CLASS_NAME QIosOptionalPlugin_NSPhotoLibrary + SOURCES + plugin.mm + qiosfileengineassetslibrary.h qiosfileengineassetslibrary.mm + qiosfileenginefactory.h + qiosimagepickercontroller.h qiosimagepickercontroller.mm + LIBRARIES + Qt::GuiPrivate + PUBLIC_LIBRARIES + ${FWAssetsLibrary} + ${FWFoundation} + ${FWUIKit} + Qt::Core + Qt::Gui +) + +#### Keys ignored in scope 1:.:.:nsphotolibrarysupport.pro:: +# OTHER_FILES = "plugin.json" +# PLUGIN_EXTENDS = "-" + +## Scopes: +##################################################################### -- cgit v1.2.3 From b10d8eab047c387409716ae87422d2efffee3159 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 22 Jan 2020 14:23:02 +0100 Subject: Regenerate plugin projects to get new target names And also to get the original output names (qmake's "TARGET"), so that the plugin file names are as they were in Qt 5. Change-Id: I96a060d1a81693652847857372bec334728cb549 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- .../platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/ios') diff --git a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt index 5adac3cabb..0f9128c6f7 100644 --- a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt +++ b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt @@ -1,12 +1,12 @@ # Generated from nsphotolibrarysupport.pro. ##################################################################### -## qiosnsphotolibrarysupport Plugin: +## QIosOptionalPlugin_NSPhotoLibrary Plugin: ##################################################################### -add_qt_plugin(qiosnsphotolibrarysupport +add_qt_plugin(QIosOptionalPlugin_NSPhotoLibrary + OUTPUT_NAME qiosnsphotolibrarysupport TYPE platforms/darwin - CLASS_NAME QIosOptionalPlugin_NSPhotoLibrary SOURCES plugin.mm qiosfileengineassetslibrary.h qiosfileengineassetslibrary.mm -- cgit v1.2.3