diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2022-03-04 14:29:27 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-03-05 09:04:26 +0000 |
commit | b6cd2b8a4d26abb478166c8a8e9f1988c80f27b4 (patch) | |
tree | df0b9cd6344fad5d9dca4b8cb2903e5b612ee05b /src/plugins/platforms/ios/qiosdocumentpickercontroller.h | |
parent | 0ff26fde8531cc58b2e47cfcc768b72a55f766f6 (diff) |
QIOSFileDialog/QIOSDocumentPickerController - handle dismissed view controller
When we use a native view controller for selecting documents, we have
two methods to implement from UIDocumentPickerDelegate (a file was selected
or the selection was cancelled). Unfortunately, swiping a view away
was not handled, so neither 'accept' nor 'reject' was called. Depending
on the classes using QIOSFileDialog, this may leave them in some incorrect
state, not knowing that they are 'closed' anyway.
As suggested by Tor Arne, the solution is to implement
UIAdaptivePresentationControllerDelegate's method, namely
-presentationControllerDidDismiss:, which never gets called if the
controller was dismissed programatically (the case of accept/reject).
Fixes: QTBUG-93505
Change-Id: I28404aa280465ef8eb0f5c26c8c2e4e4a6c66641
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit bb30beb72642bf7c33f502f81e0dc7f4951ba8ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/plugins/platforms/ios/qiosdocumentpickercontroller.h')
-rw-r--r-- | src/plugins/platforms/ios/qiosdocumentpickercontroller.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qiosdocumentpickercontroller.h b/src/plugins/platforms/ios/qiosdocumentpickercontroller.h index dba6f24fc5..2fe3c9e382 100644 --- a/src/plugins/platforms/ios/qiosdocumentpickercontroller.h +++ b/src/plugins/platforms/ios/qiosdocumentpickercontroller.h @@ -41,6 +41,8 @@ #include "qiosfiledialog.h" -@interface QIOSDocumentPickerController : UIDocumentPickerViewController <UIDocumentPickerDelegate, UINavigationControllerDelegate> +@interface QIOSDocumentPickerController : UIDocumentPickerViewController <UIDocumentPickerDelegate, + UINavigationControllerDelegate, + UIAdaptivePresentationControllerDelegate> - (instancetype)initWithQIOSFileDialog:(QIOSFileDialog *)fileDialog; @end |