Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qiosimagepickercontroller.mm
Go to the documentation of this file.
1
// Copyright (C) 2017 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
import
<
UIKit
/
UIKit
.
h
>
6
7
#
include
"qiosimagepickercontroller.h"
8
9
@implementation QIOSImagePickerController {
10
QPlatformFileDialogHelper *m_fileDialog;
11
}
12
13
- (instancetype)initWithQIOSFileDialog:(QPlatformFileDialogHelper *)fileDialog
14
{
15
self = [super init];
16
if
(self) {
17
m_fileDialog = fileDialog;
18
self.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
19
self.delegate = self;
20
}
21
return
self;
22
}
23
24
- (
void
)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
25
{
26
Q_UNUSED(picker);
27
NSURL *url = info[UIImagePickerControllerReferenceURL];
28
QUrl fileUrl = QUrl::fromLocalFile(QString::fromNSString(url.description));
29
emit m_fileDialog->filesSelected(QList<QUrl>() << fileUrl);
30
emit m_fileDialog->accept();
31
}
32
33
- (
void
)imagePickerControllerDidCancel:(UIImagePickerController *)picker
34
{
35
Q_UNUSED(picker);
36
emit m_fileDialog->reject();
37
}
38
39
@end
qtbase
src
plugins
platforms
ios
optional
nsphotolibrarysupport
qiosimagepickercontroller.mm
Generated on
for Qt by
1.18.0