QIOSFileDialog: present image picker view without 'parent'

QFileDialog::show()/exec() can be called without having any parent
at all, so the check for 'winGuard' in authorization callback
would prevent image picker from being presented. In the end
we don't need this parent and using 'presentationWindow()' instead.
Check before asking for authorization that we indeed have/no
a parent window.

Fixes: QTBUG-130973
Pick-to: 6.8
Change-Id: Ie3ba285dfff82ac3f53245a032e133bc26763883
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Timur Pocheptsov 2024-11-11 14:27:44 +01:00
parent 49543ffe1c
commit 6026a5aa21

View File

@ -100,7 +100,7 @@ bool QIOSFileDialog::showImagePickerDialog(QWindow *parent)
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
dispatch_async(dispatch_get_main_queue(), ^{
if (status == PHAuthorizationStatusAuthorized) {
if (thisGuard && winGuard)
if (thisGuard && (winGuard || !parent))
thisGuard->showImagePickerDialog_helper(winGuard);
} else if (thisGuard) {