Remove obsolete version checks
Our iOS deployment target is now 8, so this code will never be executed. Change-Id: I7dd4001c01d7c8c2e8e977753cb3fa246b19ce06 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This commit is contained in:
parent
b0561e6382
commit
bad4205250
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
#include <QtCore/qoperatingsystemversion.h>
|
|
||||||
#include <QtGui/qwindow.h>
|
#include <QtGui/qwindow.h>
|
||||||
#include <QtGui/private/qguiapplication_p.h>
|
#include <QtGui/private/qguiapplication_p.h>
|
||||||
#include <qpa/qplatformtheme.h>
|
#include <qpa/qplatformtheme.h>
|
||||||
@ -109,8 +108,7 @@ bool QIOSMessageDialog::show(Qt::WindowFlags windowFlags, Qt::WindowModality win
|
|||||||
Q_UNUSED(windowFlags);
|
Q_UNUSED(windowFlags);
|
||||||
if (m_alertController // Ensure that the dialog is not showing already
|
if (m_alertController // Ensure that the dialog is not showing already
|
||||||
|| !options() // Some message dialogs don't have options (QErrorMessage)
|
|| !options() // Some message dialogs don't have options (QErrorMessage)
|
||||||
|| windowModality == Qt::NonModal // We can only do modal dialogs
|
|| windowModality == Qt::NonModal) // We can only do modal dialogs
|
||||||
|| QOperatingSystemVersion::current() < QOperatingSystemVersion(QOperatingSystemVersion::IOS, 8)) // API limitation
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_alertController = [[UIAlertController
|
m_alertController = [[UIAlertController
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
#include "qiosapplicationdelegate.h"
|
#include "qiosapplicationdelegate.h"
|
||||||
#include "qiosviewcontroller.h"
|
#include "qiosviewcontroller.h"
|
||||||
#include "quiview.h"
|
#include "quiview.h"
|
||||||
#include <QtCore/qoperatingsystemversion.h>
|
|
||||||
|
|
||||||
#include <QtGui/private/qwindow_p.h>
|
#include <QtGui/private/qwindow_p.h>
|
||||||
#include <private/qcoregraphics_p.h>
|
#include <private/qcoregraphics_p.h>
|
||||||
@ -275,14 +274,6 @@ void QIOSScreen::updateProperties()
|
|||||||
if (m_uiScreen == [UIScreen mainScreen]) {
|
if (m_uiScreen == [UIScreen mainScreen]) {
|
||||||
Qt::ScreenOrientation statusBarOrientation = toQtScreenOrientation(UIDeviceOrientation([UIApplication sharedApplication].statusBarOrientation));
|
Qt::ScreenOrientation statusBarOrientation = toQtScreenOrientation(UIDeviceOrientation([UIApplication sharedApplication].statusBarOrientation));
|
||||||
|
|
||||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion(QOperatingSystemVersion::IOS, 8)) {
|
|
||||||
// On iOS < 8.0 the UIScreen geometry is always in portait, and the system applies
|
|
||||||
// the screen rotation to the root view-controller's view instead of directly to the
|
|
||||||
// screen, like iOS 8 and above does.
|
|
||||||
m_geometry = mapBetween(Qt::PortraitOrientation, statusBarOrientation, m_geometry);
|
|
||||||
m_availableGeometry = transformBetween(Qt::PortraitOrientation, statusBarOrientation, m_geometry).mapRect(m_availableGeometry);
|
|
||||||
}
|
|
||||||
|
|
||||||
QIOSViewController *qtViewController = [m_uiWindow.rootViewController isKindOfClass:[QIOSViewController class]] ?
|
QIOSViewController *qtViewController = [m_uiWindow.rootViewController isKindOfClass:[QIOSViewController class]] ?
|
||||||
static_cast<QIOSViewController *>(m_uiWindow.rootViewController) : nil;
|
static_cast<QIOSViewController *>(m_uiWindow.rootViewController) : nil;
|
||||||
|
|
||||||
@ -302,20 +293,15 @@ void QIOSScreen::updateProperties()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (m_geometry != previousGeometry) {
|
if (m_geometry != previousGeometry) {
|
||||||
QRectF physicalGeometry;
|
// We can't use the primaryOrientation of screen(), as we haven't reported the new geometry yet
|
||||||
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::IOS, 8)) {
|
Qt::ScreenOrientation primaryOrientation = m_geometry.width() >= m_geometry.height() ?
|
||||||
// We can't use the primaryOrientation of screen(), as we haven't reported the new geometry yet
|
Qt::LandscapeOrientation : Qt::PortraitOrientation;
|
||||||
Qt::ScreenOrientation primaryOrientation = m_geometry.width() >= m_geometry.height() ?
|
|
||||||
Qt::LandscapeOrientation : Qt::PortraitOrientation;
|
|
||||||
|
|
||||||
// On iPhone 6+ devices, or when display zoom is enabled, the render buffer is scaled
|
// On iPhone 6+ devices, or when display zoom is enabled, the render buffer is scaled
|
||||||
// before being output on the physical display. We have to take this into account when
|
// before being output on the physical display. We have to take this into account when
|
||||||
// computing the physical size. Note that unlike the native bounds, the physical size
|
// computing the physical size. Note that unlike the native bounds, the physical size
|
||||||
// follows the primary orientation of the screen.
|
// follows the primary orientation of the screen.
|
||||||
physicalGeometry = mapBetween(nativeOrientation(), primaryOrientation, QRectF::fromCGRect(m_uiScreen.nativeBounds).toRect());
|
const QRectF physicalGeometry = mapBetween(nativeOrientation(), primaryOrientation, QRectF::fromCGRect(m_uiScreen.nativeBounds).toRect());
|
||||||
} else {
|
|
||||||
physicalGeometry = QRectF(0, 0, m_geometry.width() * devicePixelRatio(), m_geometry.height() * devicePixelRatio());
|
|
||||||
}
|
|
||||||
|
|
||||||
static const qreal millimetersPerInch = 25.4;
|
static const qreal millimetersPerInch = 25.4;
|
||||||
m_physicalSize = physicalGeometry.size() / m_physicalDpi * millimetersPerInch;
|
m_physicalSize = physicalGeometry.size() / m_physicalDpi * millimetersPerInch;
|
||||||
|
@ -229,12 +229,6 @@ static void executeBlockWithoutAnimation(Block block)
|
|||||||
borderLayer.cornerRadius = cornerRadius;
|
borderLayer.cornerRadius = cornerRadius;
|
||||||
borderLayer.borderColor = [[UIColor lightGrayColor] CGColor];
|
borderLayer.borderColor = [[UIColor lightGrayColor] CGColor];
|
||||||
[self addSublayer:borderLayer];
|
[self addSublayer:borderLayer];
|
||||||
|
|
||||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion(QOperatingSystemVersion::IOS, 7)) {
|
|
||||||
// [UIView snapshotViewAfterScreenUpdates:] is available since iOS 7.0.
|
|
||||||
// Just silently ignore showing the loupe for older versions.
|
|
||||||
self.hidden = YES;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
@ -278,9 +272,6 @@ static void executeBlockWithoutAnimation(Block block)
|
|||||||
|
|
||||||
- (void)display
|
- (void)display
|
||||||
{
|
{
|
||||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion(QOperatingSystemVersion::IOS, 7))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Take a snapshow of the target view, magnify the area around the focal
|
// Take a snapshow of the target view, magnify the area around the focal
|
||||||
// point, and add the snapshow layer as a child of the container layer
|
// point, and add the snapshow layer as a child of the container layer
|
||||||
// to make it look like a loupe. Then place this layer at the position of
|
// to make it look like a loupe. Then place this layer at the position of
|
||||||
|
Loading…
Reference in New Issue
Block a user