cocoa: remove redundant macOS version checking
Since the current minimum supported macOS version is macOS 11 (Big Sur), we can remove redundant OS version checking and cleanup the code a bit. Change-Id: If42251cc193e8daae81a73cb25582fa014f2b9a0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 23f6d954ec5a4d9437cad433e957a718aeb9ce49) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
18375f3bff
commit
7728b53679
@ -9,7 +9,6 @@
|
||||
#include "qcocoahelpers.h"
|
||||
#include <QtGui/private/qcoregraphics_p.h>
|
||||
#include <QtGui/qutimimeconverter.h>
|
||||
#include <QtCore/qsysinfo.h>
|
||||
#include <QtCore/private/qcore_mac_p.h>
|
||||
|
||||
#include <vector>
|
||||
@ -137,11 +136,6 @@ bool QCocoaDrag::maybeDragMultipleItems()
|
||||
Q_ASSERT(m_drag && m_drag->mimeData());
|
||||
Q_ASSERT(m_executed_drop_action == Qt::IgnoreAction);
|
||||
|
||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::MacOSMojave) {
|
||||
// -dragImage: stopped working in 10.14 first.
|
||||
return false;
|
||||
}
|
||||
|
||||
const QMacAutoReleasePool pool;
|
||||
|
||||
NSView *view = m_lastView ? m_lastView : m_lastEvent.window.contentView;
|
||||
|
@ -14,8 +14,6 @@
|
||||
#include <QtCore/qstringlist.h>
|
||||
#include <QtCore/qvarlengtharray.h>
|
||||
#include <QtCore/qabstracteventdispatcher.h>
|
||||
#include <QtCore/qsysinfo.h>
|
||||
#include <QtCore/qoperatingsystemversion.h>
|
||||
#include <QtCore/qdir.h>
|
||||
#include <QtCore/qregularexpression.h>
|
||||
#include <QtCore/qpointer.h>
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
#include "qcocoatheme.h"
|
||||
|
||||
#include <QtCore/QOperatingSystemVersion>
|
||||
#include <QtCore/QVariant>
|
||||
|
||||
#include "qcocoasystemtrayicon.h"
|
||||
@ -214,12 +213,10 @@ const char *QCocoaTheme::name = "cocoa";
|
||||
QCocoaTheme::QCocoaTheme()
|
||||
: m_systemPalette(nullptr)
|
||||
{
|
||||
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSMojave) {
|
||||
m_appearanceObserver = QMacKeyValueObserver(NSApp, @"effectiveAppearance", [this] {
|
||||
NSAppearance.currentAppearance = NSApp.effectiveAppearance;
|
||||
handleSystemThemeChange();
|
||||
});
|
||||
}
|
||||
|
||||
m_systemColorObserver = QMacNotificationObserver(nil,
|
||||
NSSystemColorsDidChangeNotification, [this] {
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QPointer>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/qsysinfo.h>
|
||||
#include <QtCore/private/qcore_mac_p.h>
|
||||
#include <QtGui/QAccessible>
|
||||
#include <QtGui/QImage>
|
||||
|
@ -11,9 +11,6 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
|
||||
|
||||
- (bool)handleGestureAsBeginEnd:(NSEvent *)event
|
||||
{
|
||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::OSXElCapitan)
|
||||
return false;
|
||||
|
||||
if ([event phase] == NSEventPhaseBegan) {
|
||||
[self beginGestureWithEvent:event];
|
||||
return true;
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "qcocoaintegration.h"
|
||||
|
||||
#include <qpa/qwindowsysteminterface.h>
|
||||
#include <qoperatingsystemversion.h>
|
||||
|
||||
Q_LOGGING_CATEGORY(lcQpaEvents, "qt.qpa.events");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user