summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r--src/plugins/platforms/ios/.prev_CMakeLists.txt4
-rw-r--r--src/plugins/platforms/ios/CMakeLists.txt4
-rw-r--r--src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt8
-rw-r--r--src/plugins/platforms/ios/optional/nsphotolibrarysupport/plugin.mm2
-rw-r--r--src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm6
-rw-r--r--src/plugins/platforms/ios/qiosclipboard.mm4
-rw-r--r--src/plugins/platforms/ios/qioseventdispatcher.h6
-rw-r--r--src/plugins/platforms/ios/qioseventdispatcher.mm5
-rw-r--r--src/plugins/platforms/ios/qiosglobal.mm2
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.h10
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.mm4
-rw-r--r--src/plugins/platforms/ios/qiosmenu.mm12
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm12
-rw-r--r--src/plugins/platforms/ios/qiostheme.mm2
-rw-r--r--src/plugins/platforms/ios/quiview.mm2
15 files changed, 47 insertions, 36 deletions
diff --git a/src/plugins/platforms/ios/.prev_CMakeLists.txt b/src/plugins/platforms/ios/.prev_CMakeLists.txt
index 138f323878..2e494c7d23 100644
--- a/src/plugins/platforms/ios/.prev_CMakeLists.txt
+++ b/src/plugins/platforms/ios/.prev_CMakeLists.txt
@@ -42,12 +42,12 @@ qt_internal_add_plugin(QIOSIntegrationPlugin
## Scopes:
#####################################################################
-qt_extend_target(QIOSIntegrationPlugin CONDITION QT_FEATURE_opengl
+qt_internal_extend_target(QIOSIntegrationPlugin CONDITION QT_FEATURE_opengl
PUBLIC_LIBRARIES
Qt::OpenGLPrivate
)
-qt_extend_target(QIOSIntegrationPlugin CONDITION NOT TVOS
+qt_internal_extend_target(QIOSIntegrationPlugin CONDITION NOT TVOS
SOURCES
qiosclipboard.h qiosclipboard.mm
qiosdocumentpickercontroller.h qiosdocumentpickercontroller.mm
diff --git a/src/plugins/platforms/ios/CMakeLists.txt b/src/plugins/platforms/ios/CMakeLists.txt
index 995dcc0a9d..e238cf70fa 100644
--- a/src/plugins/platforms/ios/CMakeLists.txt
+++ b/src/plugins/platforms/ios/CMakeLists.txt
@@ -45,12 +45,12 @@ qt_disable_apple_app_extension_api_only(QIOSIntegrationPlugin)
## Scopes:
#####################################################################
-qt_extend_target(QIOSIntegrationPlugin CONDITION QT_FEATURE_opengl
+qt_internal_extend_target(QIOSIntegrationPlugin CONDITION QT_FEATURE_opengl
PUBLIC_LIBRARIES
Qt::OpenGLPrivate
)
-qt_extend_target(QIOSIntegrationPlugin CONDITION NOT TVOS
+qt_internal_extend_target(QIOSIntegrationPlugin CONDITION NOT TVOS
SOURCES
qiosclipboard.h qiosclipboard.mm
qiosdocumentpickercontroller.h qiosdocumentpickercontroller.mm
diff --git a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt
index 526a053b02..1176e34935 100644
--- a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt
+++ b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt
@@ -21,6 +21,14 @@ qt_internal_add_plugin(QIosOptionalPlugin_NSPhotoLibrary
Qt::GuiPrivate
)
+# special case begin
+set_target_properties(QIosOptionalPlugin_NSPhotoLibrary
+ PROPERTIES
+ DISABLE_PRECOMPILE_HEADERS ON
+)
+# special case end
+
+
#### Keys ignored in scope 1:.:.:nsphotolibrarysupport.pro:<TRUE>:
# OTHER_FILES = "plugin.json"
# PLUGIN_EXTENDS = "-"
diff --git a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/plugin.mm b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/plugin.mm
index 8b372b8749..2a3d8c603e 100644
--- a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/plugin.mm
+++ b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/plugin.mm
@@ -52,7 +52,7 @@ class QIosOptionalPlugin_NSPhotoLibrary : public QObject, QIosOptionalPluginInte
Q_INTERFACES(QIosOptionalPluginInterface)
public:
- explicit QIosOptionalPlugin_NSPhotoLibrary(QObject* = 0) {};
+ explicit QIosOptionalPlugin_NSPhotoLibrary(QObject * = nullptr) {};
~QIosOptionalPlugin_NSPhotoLibrary() {}
UIViewController* createImagePickerController(QIOSFileDialog *fileDialog) const override
diff --git a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm
index c5244a51ad..01524a00e8 100644
--- a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm
+++ b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm
@@ -54,7 +54,7 @@ static QThreadStorage<QString> g_iteratorCurrentUrl;
static QThreadStorage<QPointer<QIOSAssetData> > g_assetDataCache;
static const int kBufferSize = 10;
-static ALAsset *kNoAsset = 0;
+static ALAsset *kNoAsset = nullptr;
static bool ensureAuthorizationDialogNotBlocked()
{
@@ -366,7 +366,7 @@ bool QIOSFileEngineAssetsLibrary::close()
// Delete later, so that we can reuse the asset if a QFile is
// opened with the same path during the same event loop cycle.
m_data->deleteLater();
- m_data = 0;
+ m_data = nullptr;
}
return true;
}
@@ -410,7 +410,7 @@ qint64 QIOSFileEngineAssetsLibrary::read(char *data, qint64 maxlen)
if (!bytesRead)
return 0;
- NSError *error = 0;
+ NSError *error = nullptr;
[[asset defaultRepresentation] getBytes:(uint8_t *)data fromOffset:m_offset length:bytesRead error:&error];
if (error) {
diff --git a/src/plugins/platforms/ios/qiosclipboard.mm b/src/plugins/platforms/ios/qiosclipboard.mm
index 236ca843d8..dc441c7194 100644
--- a/src/plugins/platforms/ios/qiosclipboard.mm
+++ b/src/plugins/platforms/ios/qiosclipboard.mm
@@ -138,7 +138,7 @@ public:
~QIOSMimeData() { }
QStringList formats() const override;
- QVariant retrieveData(const QString &mimeType, QVariant::Type type) const override;
+ QVariant retrieveData(const QString &mimeType, QMetaType type) const override;
private:
const QClipboard::Mode m_mode;
@@ -160,7 +160,7 @@ QStringList QIOSMimeData::formats() const
return foundMimeTypes;
}
-QVariant QIOSMimeData::retrieveData(const QString &mimeType, QVariant::Type) const
+QVariant QIOSMimeData::retrieveData(const QString &mimeType, QMetaType) const
{
UIPasteboard *pb = [UIPasteboard pasteboardWithQClipboardMode:m_mode];
NSArray<NSString *> *pasteboardTypes = [pb pasteboardTypes];
diff --git a/src/plugins/platforms/ios/qioseventdispatcher.h b/src/plugins/platforms/ios/qioseventdispatcher.h
index 1f4c78dc74..cdbaa0931d 100644
--- a/src/plugins/platforms/ios/qioseventdispatcher.h
+++ b/src/plugins/platforms/ios/qioseventdispatcher.h
@@ -53,7 +53,7 @@ public:
bool processPostedEvents() override;
protected:
- explicit QIOSEventDispatcher(QObject *parent = 0);
+ explicit QIOSEventDispatcher(QObject *parent = nullptr);
};
class QIOSJumpingEventDispatcher : public QIOSEventDispatcher
@@ -61,7 +61,7 @@ class QIOSJumpingEventDispatcher : public QIOSEventDispatcher
Q_OBJECT
public:
- QIOSJumpingEventDispatcher(QObject *parent = 0);
+ QIOSJumpingEventDispatcher(QObject *parent = nullptr);
bool processEvents(QEventLoop::ProcessEventsFlags flags) override;
// Public since we can't friend Objective-C methods
@@ -76,4 +76,4 @@ private:
QT_END_NAMESPACE
-#endif // QIOSEVENTDISPATCHER_H \ No newline at end of file
+#endif // QIOSEVENTDISPATCHER_H
diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm
index c5856051de..23aac6ad46 100644
--- a/src/plugins/platforms/ios/qioseventdispatcher.mm
+++ b/src/plugins/platforms/ios/qioseventdispatcher.mm
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -473,7 +473,8 @@ bool QIOSEventDispatcher::processPostedEvents()
return false;
QT_APPLE_SCOPED_LOG_ACTIVITY(lcEventDispatcher().isDebugEnabled(), "sendWindowSystemEvents");
- QEventLoop::ProcessEventsFlags flags = QEventLoop::ProcessEventsFlags(m_processEvents.flags.load());
+ QEventLoop::ProcessEventsFlags flags
+ = QEventLoop::ProcessEventsFlags(m_processEvents.flags.loadRelaxed());
qCDebug(lcEventDispatcher) << "Sending window system events for" << flags;
QWindowSystemInterface::sendWindowSystemEvents(flags);
diff --git a/src/plugins/platforms/ios/qiosglobal.mm b/src/plugins/platforms/ios/qiosglobal.mm
index a523d1be45..c0428dacb9 100644
--- a/src/plugins/platforms/ios/qiosglobal.mm
+++ b/src/plugins/platforms/ios/qiosglobal.mm
@@ -185,7 +185,7 @@ FirstResponderCandidate::FirstResponderCandidate(UIResponder *responder)
{
}
-UIResponder *FirstResponderCandidate::s_firstResponderCandidate = 0;
+UIResponder *FirstResponderCandidate::s_firstResponderCandidate = nullptr;
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/ios/qiosinputcontext.h b/src/plugins/platforms/ios/qiosinputcontext.h
index debdf7a638..36421a57c3 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.h
+++ b/src/plugins/platforms/ios/qiosinputcontext.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -76,10 +76,10 @@ struct KeyboardState
struct ImeState
{
- ImeState() : currentState(0), focusObject(0) {}
+ ImeState() = default;
Qt::InputMethodQueries update(Qt::InputMethodQueries properties);
- QInputMethodQueryEvent currentState;
- QObject *focusObject;
+ QInputMethodQueryEvent currentState = QInputMethodQueryEvent({});
+ QObject *focusObject = nullptr;
};
class QIOSInputContext : public QPlatformInputContext
@@ -111,7 +111,7 @@ public:
void scrollToCursor();
void scroll(int y);
- void updateKeyboardState(NSNotification *notification = 0);
+ void updateKeyboardState(NSNotification *notification = nullptr);
const ImeState &imeState() { return m_imeState; }
const KeyboardState &keyboardState() { return m_keyboardState; }
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm
index d2229df133..0eb12498b4 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.mm
+++ b/src/plugins/platforms/ios/qiosinputcontext.mm
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -297,7 +297,7 @@ QT_BEGIN_NAMESPACE
Qt::InputMethodQueries ImeState::update(Qt::InputMethodQueries properties)
{
if (!properties)
- return 0;
+ return {};
QInputMethodQueryEvent newState(properties);
diff --git a/src/plugins/platforms/ios/qiosmenu.mm b/src/plugins/platforms/ios/qiosmenu.mm
index 74a77de757..737d7798ab 100644
--- a/src/plugins/platforms/ios/qiosmenu.mm
+++ b/src/plugins/platforms/ios/qiosmenu.mm
@@ -54,7 +54,7 @@
// m_currentMenu points to the currently visible menu.
// Only one menu will be visible at a time, and if a second menu
// is shown on top of a first, the first one will be told to hide.
-QIOSMenu *QIOSMenu::m_currentMenu = 0;
+QIOSMenu *QIOSMenu::m_currentMenu = nullptr;
// -------------------------------------------------------------------------
@@ -441,7 +441,7 @@ void QIOSMenu::dismiss()
break;
}
- m_currentMenu = 0;
+ m_currentMenu = nullptr;
m_visible = false;
}
@@ -458,13 +458,13 @@ void QIOSMenu::toggleShowUsingUIMenuController(bool show)
Q_ASSERT(m_menuController);
[[UIMenuController sharedMenuController] setMenuVisible:NO animated:YES];
[m_menuController release];
- m_menuController = 0;
+ m_menuController = nullptr;
}
}
void QIOSMenu::toggleShowUsingUIPickerView(bool show)
{
- static QObject *focusObjectWithPickerView = 0;
+ static QObject *focusObjectWithPickerView = nullptr;
if (show) {
Q_ASSERT(!m_pickerView);
@@ -477,12 +477,12 @@ void QIOSMenu::toggleShowUsingUIPickerView(bool show)
} else {
Q_ASSERT(focusObjectWithPickerView);
focusObjectWithPickerView->removeEventFilter(this);
- focusObjectWithPickerView = 0;
+ focusObjectWithPickerView = nullptr;
Q_ASSERT(m_pickerView);
[m_pickerView listenForKeyboardWillHideNotification:NO];
[m_pickerView release];
- m_pickerView = 0;
+ m_pickerView = nullptr;
qApp->inputMethod()->update(Qt::ImEnabled | Qt::ImPlatformData);
}
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm
index 80636ab9c6..c7dbe43124 100644
--- a/src/plugins/platforms/ios/qiosscreen.mm
+++ b/src/plugins/platforms/ios/qiosscreen.mm
@@ -213,10 +213,12 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen)
{
[super traitCollectionDidChange:previousTraitCollection];
- if (self.screen == UIScreen.mainScreen) {
- if (previousTraitCollection.userInterfaceStyle != self.traitCollection.userInterfaceStyle) {
- QIOSTheme::initializeSystemPalette();
- QWindowSystemInterface::handleThemeChange<QWindowSystemInterface::SynchronousDelivery>(nullptr);
+ if (@available(iOS 12, *)) {
+ if (self.screen == UIScreen.mainScreen) {
+ if (previousTraitCollection.userInterfaceStyle != self.traitCollection.userInterfaceStyle) {
+ QIOSTheme::initializeSystemPalette();
+ QWindowSystemInterface::handleThemeChange<QWindowSystemInterface::SynchronousDelivery>(nullptr);
+ }
}
}
}
@@ -243,7 +245,7 @@ static QString deviceModelIdentifier()
char value[size];
sysctlbyname(key, &value, &size, NULL, 0);
- return QString::fromLatin1(value);
+ return QString::fromLatin1(QByteArrayView(value, qsizetype(size)));
#endif
}
diff --git a/src/plugins/platforms/ios/qiostheme.mm b/src/plugins/platforms/ios/qiostheme.mm
index 1360af9d76..584dd1c8fc 100644
--- a/src/plugins/platforms/ios/qiostheme.mm
+++ b/src/plugins/platforms/ios/qiostheme.mm
@@ -160,7 +160,7 @@ QVariant QIOSTheme::themeHint(ThemeHint hint) const
{
switch (hint) {
case QPlatformTheme::StyleNames:
- return QStringList(QStringLiteral("fusion"));
+ return QStringList(QStringLiteral("Fusion"));
case KeyboardScheme:
return QVariant(int(MacKeyboardScheme));
default:
diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm
index f5dd20bace..4c56e03f42 100644
--- a/src/plugins/platforms/ios/quiview.mm
+++ b/src/plugins/platforms/ios/quiview.mm
@@ -394,7 +394,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
<< "xTilt" << qBound(-60.0, altitudeAngle * azimuth.dx, 60.0) << "yTilt" << qBound(-60.0, altitudeAngle * azimuth.dy, 60.0);
QWindowSystemInterface::handleTabletEvent(self.platformWindow->window(), timeStamp, localViewPosition, globalScreenPosition,
// device, pointerType, buttons
- int(QInputDevice::DeviceType::Stylus), int(QPointingDevice::PointerType::Pen), state == Qt::TouchPointReleased ? Qt::NoButton : Qt::LeftButton,
+ int(QInputDevice::DeviceType::Stylus), int(QPointingDevice::PointerType::Pen), state == QEventPoint::State::Released ? Qt::NoButton : Qt::LeftButton,
// pressure, xTilt, yTilt
pressure, qBound(-60.0, altitudeAngle * azimuth.dx, 60.0), qBound(-60.0, altitudeAngle * azimuth.dy, 60.0),
// tangentialPressure, rotation, z, uid, modifiers