mirror of https://github.com/qt/qtbase.git
Replace usages of QSysInfo with QOperatingSystemVersion
Occurrences which should simply be removed entirely (due to always being true or always being false as a result of the current OS support matrix) have been left untouched for now. Change-Id: I86d5a084cb84bc28fefc5191d40924de1439b3de Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
parent
8a48d66da9
commit
6616617a87
|
@ -38,7 +38,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include "qfilesystemengine_p.h"
|
||||
|
||||
#include "qoperatingsystemversion.h"
|
||||
#include "qplatformdefs.h"
|
||||
#include "qsysinfo.h"
|
||||
#include "private/qabstractfileengine_p.h"
|
||||
|
@ -637,7 +637,7 @@ QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry)
|
|||
FILE_SHARE_READ, OPEN_EXISTING, NULL);
|
||||
#endif // Q_OS_WINRT
|
||||
if (handle) {
|
||||
result = QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS8 ?
|
||||
result = QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows8 ?
|
||||
fileIdWin8(handle) : fileId(handle);
|
||||
CloseHandle(handle);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
#include "qfilesystemiterator_p.h"
|
||||
#include "qfilesystemengine_p.h"
|
||||
#include "qoperatingsystemversion.h"
|
||||
#include "qplatformdefs.h"
|
||||
#include "qvector.h"
|
||||
|
||||
|
@ -93,7 +94,7 @@ bool QFileSystemIterator::advance(QFileSystemEntry &fileEntry, QFileSystemMetaDa
|
|||
haveData = true;
|
||||
int infoLevel = 0 ; // FindExInfoStandard;
|
||||
DWORD dwAdditionalFlags = 0;
|
||||
if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7) {
|
||||
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows7) {
|
||||
dwAdditionalFlags = 2; // FIND_FIRST_EX_LARGE_FETCH
|
||||
infoLevel = 1 ; // FindExInfoBasic;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
#include "qcoreapplication.h"
|
||||
#include <private/qsystemlibrary_p.h>
|
||||
#include "qoperatingsystemversion.h"
|
||||
#include "qpair.h"
|
||||
#include "qset.h"
|
||||
#include "qsocketnotifier.h"
|
||||
|
@ -236,7 +237,7 @@ static inline UINT inputTimerMask()
|
|||
// QTBUG 28513, QTBUG-29097, QTBUG-29435: QS_TOUCH, QS_POINTER became part of
|
||||
// QS_INPUT in Windows Kit 8. They should not be used when running on pre-Windows 8.
|
||||
#if WINVER > 0x0601
|
||||
if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8)
|
||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8)
|
||||
result &= ~(QS_TOUCH | QS_POINTER);
|
||||
#endif // WINVER > 0x0601
|
||||
return result;
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
#include "qopenglcontext.h"
|
||||
#include "qopenglfunctions.h"
|
||||
#include "qoperatingsystemversion.h"
|
||||
#include "qoffscreensurface.h"
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
@ -221,29 +222,25 @@ struct OsTypeTerm
|
|||
static QString hostOsRelease() {
|
||||
QString ver;
|
||||
#ifdef Q_OS_WIN
|
||||
switch (QSysInfo::windowsVersion()) {
|
||||
case QSysInfo::WV_XP:
|
||||
case QSysInfo::WV_2003:
|
||||
ver = QStringLiteral("xp");
|
||||
break;
|
||||
case QSysInfo::WV_VISTA:
|
||||
ver = QStringLiteral("vista");
|
||||
break;
|
||||
case QSysInfo::WV_WINDOWS7:
|
||||
const auto osver = QOperatingSystemVersion::current();
|
||||
#define Q_WINVER(major, minor) (major << 8 | minor)
|
||||
switch (Q_WINVER(osver.majorVersion(), osver.minorVersion())) {
|
||||
case Q_WINVER(6, 1):
|
||||
ver = QStringLiteral("7");
|
||||
break;
|
||||
case QSysInfo::WV_WINDOWS8:
|
||||
case Q_WINVER(6, 2):
|
||||
ver = QStringLiteral("8");
|
||||
break;
|
||||
case QSysInfo::WV_WINDOWS8_1:
|
||||
case Q_WINVER(6, 3):
|
||||
ver = QStringLiteral("8.1");
|
||||
break;
|
||||
case QSysInfo::WV_WINDOWS10:
|
||||
case Q_WINVER(10, 0):
|
||||
ver = QStringLiteral("10");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#undef Q_WINVER
|
||||
#endif
|
||||
return ver;
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <qabstracteventdispatcher.h>
|
||||
#include <qsysinfo.h>
|
||||
#include <qoperatingsystemversion.h>
|
||||
#include <qglobal.h>
|
||||
#include <QDir>
|
||||
|
||||
|
@ -163,7 +164,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSOpenSavePanelDelegate);
|
|||
[mSavePanel setDelegate:self];
|
||||
|
||||
#if QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_11)
|
||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_11)
|
||||
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::OSXElCapitan)
|
||||
mOpenPanel.accessoryViewDisclosed = YES;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
+ (NSGraphicsContext *)qt_graphicsContextWithCGContext:(CGContextRef)graphicsPort flipped:(BOOL)initialFlippedState
|
||||
{
|
||||
#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_10, __IPHONE_NA)
|
||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_10)
|
||||
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::OSXYosemite)
|
||||
return [self graphicsContextWithCGContext:graphicsPort flipped:initialFlippedState];
|
||||
#endif
|
||||
return [self graphicsContextWithGraphicsPort:graphicsPort flipped:initialFlippedState];
|
||||
|
|
|
@ -1336,7 +1336,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
|
|||
|
||||
- (bool)handleGestureAsBeginEnd:(NSEvent *)event
|
||||
{
|
||||
if (QSysInfo::QSysInfo::MacintoshVersion < QSysInfo::MV_10_11)
|
||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::OSXElCapitan)
|
||||
return false;
|
||||
|
||||
if ([event phase] == NSEventPhaseBegan) {
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
#include <QtPlatformSupport/private/qcoretextfontdatabase_p.h>
|
||||
#include <QtPlatformSupport/private/qmacmime_p.h>
|
||||
#include <QDir>
|
||||
#include <QOperatingSystemVersion>
|
||||
|
||||
#import <AudioToolbox/AudioServices.h>
|
||||
|
||||
|
@ -117,7 +118,7 @@ QIOSIntegration::QIOSIntegration()
|
|||
m_touchDevice = new QTouchDevice;
|
||||
m_touchDevice->setType(QTouchDevice::TouchScreen);
|
||||
QTouchDevice::Capabilities touchCapabilities = QTouchDevice::Position | QTouchDevice::NormalizedPosition;
|
||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_IOS_9_0) {
|
||||
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::IOS, 9)) {
|
||||
if (mainScreen.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)
|
||||
touchCapabilities |= QTouchDevice::Pressure;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#include <QtCore/qoperatingsystemversion.h>
|
||||
#include <QtGui/qwindow.h>
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
#include <qpa/qplatformtheme.h>
|
||||
|
@ -109,7 +110,7 @@ bool QIOSMessageDialog::show(Qt::WindowFlags windowFlags, Qt::WindowModality win
|
|||
if (m_alertController // Ensure that the dialog is not showing already
|
||||
|| !options() // Some message dialogs don't have options (QErrorMessage)
|
||||
|| windowModality != Qt::ApplicationModal // We can only do app modal dialogs
|
||||
|| QSysInfo::MacintoshVersion < QSysInfo::MV_IOS_8_0) // API limitation
|
||||
|| QOperatingSystemVersion::current() < QOperatingSystemVersion(QOperatingSystemVersion::IOS, 8)) // API limitation
|
||||
return false;
|
||||
|
||||
m_alertController = [[UIAlertController
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include "qiosapplicationdelegate.h"
|
||||
#include "qiosviewcontroller.h"
|
||||
#include "quiview.h"
|
||||
#include <QtCore/qoperatingsystemversion.h>
|
||||
|
||||
#include <QtGui/private/qwindow_p.h>
|
||||
|
||||
|
@ -271,7 +272,7 @@ void QIOSScreen::updateProperties()
|
|||
if (m_uiScreen == [UIScreen mainScreen]) {
|
||||
Qt::ScreenOrientation statusBarOrientation = toQtScreenOrientation(UIDeviceOrientation([UIApplication sharedApplication].statusBarOrientation));
|
||||
|
||||
if (QSysInfo::MacintoshVersion < QSysInfo::MV_IOS_8_0) {
|
||||
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.
|
||||
|
@ -299,7 +300,7 @@ void QIOSScreen::updateProperties()
|
|||
|
||||
if (m_geometry != previousGeometry) {
|
||||
QRectF physicalGeometry;
|
||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_IOS_8_0) {
|
||||
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::IOS, 8)) {
|
||||
// We can't use the primaryOrientation of screen(), as we haven't reported the new geometry yet
|
||||
Qt::ScreenOrientation primaryOrientation = m_geometry.width() >= m_geometry.height() ?
|
||||
Qt::LandscapeOrientation : Qt::PortraitOrientation;
|
||||
|
@ -404,7 +405,7 @@ Qt::ScreenOrientation QIOSScreen::nativeOrientation() const
|
|||
{
|
||||
CGRect nativeBounds =
|
||||
#if !defined(Q_OS_TVOS) && QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0)
|
||||
QSysInfo::MacintoshVersion >= QSysInfo::MV_IOS_8_0 ? m_uiScreen.nativeBounds :
|
||||
QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::IOS, 8) ? m_uiScreen.nativeBounds :
|
||||
#endif
|
||||
m_uiScreen.bounds;
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ static void executeBlockWithoutAnimation(Block block)
|
|||
borderLayer.borderColor = [[UIColor lightGrayColor] CGColor];
|
||||
[self addSublayer:borderLayer];
|
||||
|
||||
if (QSysInfo::MacintoshVersion < QSysInfo::MV_IOS_7_0) {
|
||||
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;
|
||||
|
@ -267,7 +267,7 @@ static void executeBlockWithoutAnimation(Block block)
|
|||
|
||||
- (void)display
|
||||
{
|
||||
if (QSysInfo::MacintoshVersion < QSysInfo::MV_IOS_7_0)
|
||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion(QOperatingSystemVersion::IOS, 7))
|
||||
return;
|
||||
|
||||
// Take a snapshow of the target view, magnify the area around the focal
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include "qiosmenu.h"
|
||||
#endif
|
||||
|
||||
#include <QtCore/qoperatingsystemversion.h>
|
||||
#include <QtGui/private/qguiapplication_p.h>
|
||||
#include <QtGui/private/qwindow_p.h>
|
||||
#include <qpa/qwindowsysteminterface_p.h>
|
||||
|
@ -298,7 +299,7 @@
|
|||
QTouchDevice *touchDevice = QIOSIntegration::instance()->touchDevice();
|
||||
QTouchDevice::Capabilities touchCapabilities = touchDevice->capabilities();
|
||||
|
||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_IOS_9_0) {
|
||||
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::IOS, 9)) {
|
||||
if (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)
|
||||
touchCapabilities |= QTouchDevice::Pressure;
|
||||
else
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
#include <QtCore/QHash>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QOperatingSystemVersion>
|
||||
#include <QtCore/QSysInfo>
|
||||
#include <QtCore/QScopedArrayPointer>
|
||||
#include <QtCore/private/qsystemlibrary_p.h>
|
||||
|
@ -186,7 +187,7 @@ QWindowsShcoreDLL::QWindowsShcoreDLL()
|
|||
|
||||
void QWindowsShcoreDLL::init()
|
||||
{
|
||||
if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS8_1)
|
||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8_1)
|
||||
return;
|
||||
QSystemLibrary library(QStringLiteral("SHCore"));
|
||||
getProcessDpiAwareness = (GetProcessDpiAwareness)library.resolve("GetProcessDpiAwareness");
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "qwizard.h"
|
||||
#include "qpaintengine.h"
|
||||
#include "qapplication.h"
|
||||
#include <QtCore/QOperatingSystemVersion>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtGui/QMouseEvent>
|
||||
|
@ -715,7 +716,7 @@ int QVistaHelper::topOffset()
|
|||
if (vistaState() != VistaAero)
|
||||
return titleBarSize() + 3;
|
||||
static const int aeroOffset =
|
||||
QSysInfo::WindowsVersion == QSysInfo::WV_WINDOWS7 ?
|
||||
QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8 ?
|
||||
QStyleHelper::dpiScaled(4) : QStyleHelper::dpiScaled(13);
|
||||
return aeroOffset + titleBarSize();
|
||||
}
|
||||
|
|
|
@ -91,12 +91,6 @@ extern Q_GUI_EXPORT bool qt_is_gui_used;
|
|||
extern QClipboard *qt_clipboard;
|
||||
#endif
|
||||
|
||||
#if defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN)
|
||||
extern QSysInfo::WinVersion qt_winver;
|
||||
#elif defined (Q_OS_MAC)
|
||||
extern QSysInfo::MacVersion qt_macver;
|
||||
#endif
|
||||
|
||||
typedef QHash<QByteArray, QFont> FontHash;
|
||||
FontHash *qt_app_fonts_hash();
|
||||
|
||||
|
|
|
@ -84,6 +84,7 @@
|
|||
#include <qtoolbutton.h>
|
||||
#include <qtreeview.h>
|
||||
#include <qtableview.h>
|
||||
#include <qoperatingsystemversion.h>
|
||||
#include <qwizard.h>
|
||||
#include <qdebug.h>
|
||||
#include <qlibrary.h>
|
||||
|
@ -1431,7 +1432,7 @@ void QMacStylePrivate::initComboboxBdi(const QStyleOptionComboBox *combo, HIThem
|
|||
bdi->adornment = kThemeAdornmentFocus;
|
||||
if (combo->activeSubControls & QStyle::SC_ComboBoxArrow)
|
||||
bdi->state = kThemeStatePressed;
|
||||
else if (tds == kThemeStateInactive && QSysInfo::MacintoshVersion < QSysInfo::MV_10_10)
|
||||
else if (tds == kThemeStateInactive && QOperatingSystemVersion::current() < QOperatingSystemVersion::OSXYosemite)
|
||||
bdi->state = kThemeStateActive;
|
||||
else
|
||||
bdi->state = tds;
|
||||
|
@ -1753,7 +1754,7 @@ void QMacStylePrivate::getSliderInfo(QStyle::ComplexControl cc, const QStyleOpti
|
|||
|| slider->tickPosition == QSlider::TicksBothSides;
|
||||
|
||||
tdi->bounds = qt_hirectForQRect(slider->rect);
|
||||
if (isScrollbar || QSysInfo::MacintoshVersion < QSysInfo::MV_10_10) {
|
||||
if (isScrollbar || QOperatingSystemVersion::current() < QOperatingSystemVersion::OSXYosemite) {
|
||||
tdi->min = slider->minimum;
|
||||
tdi->max = slider->maximum;
|
||||
tdi->value = slider->sliderPosition;
|
||||
|
@ -2065,7 +2066,7 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
|
|||
const bool button = opt->type == QStyleOption::SO_Button;
|
||||
const bool viewItem = opt->type == QStyleOption::SO_ViewItem;
|
||||
const bool pressed = bdi->state == kThemeStatePressed;
|
||||
const bool usingYosemiteOrLater = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_10;
|
||||
const bool usingYosemiteOrLater = QOperatingSystemVersion::current() >= QOperatingSystemVersion::OSXYosemite;
|
||||
|
||||
if (button && pressed) {
|
||||
if (bdi->kind == kThemePushButton) {
|
||||
|
@ -3700,7 +3701,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
|
|||
QWindow *window = w && w->window() ? w->window()->windowHandle() :
|
||||
QStyleHelper::styleObjectWindow(opt->styleObject);
|
||||
const_cast<QMacStylePrivate *>(d)->resolveCurrentNSView(window);
|
||||
const bool usingYosemiteOrLater = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_10;
|
||||
const bool usingYosemiteOrLater = QOperatingSystemVersion::current() >= QOperatingSystemVersion::OSXYosemite;
|
||||
switch (ce) {
|
||||
case CE_HeaderSection:
|
||||
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
|
||||
|
@ -4092,7 +4093,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
|
|||
bool hasIcon = !btn.icon.isNull();
|
||||
bool hasText = !btn.text.isEmpty();
|
||||
|
||||
if (!hasMenu && QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_10) {
|
||||
if (!hasMenu && QOperatingSystemVersion::current() >= QOperatingSystemVersion::OSXYosemite) {
|
||||
if (tds == kThemeStatePressed
|
||||
|| (tds == kThemeStateActive
|
||||
&& ((btn.features & QStyleOptionButton::DefaultButton && !d->autoDefaultButton)
|
||||
|
@ -4197,8 +4198,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
|
|||
QStyleOptionComboBox comboCopy = *cb;
|
||||
comboCopy.direction = Qt::LeftToRight;
|
||||
if (opt->state & QStyle::State_Small)
|
||||
comboCopy.rect.translate(0, w ? 0 : (QSysInfo::macVersion() >= QSysInfo::MV_10_10 ? 0 : -2)); // Supports Qt Quick Controls
|
||||
else if (QSysInfo::macVersion() == QSysInfo::MV_10_9)
|
||||
comboCopy.rect.translate(0, w ? 0 : (QOperatingSystemVersion::current() >= QOperatingSystemVersion::OSXYosemite ? 0 : -2)); // Supports Qt Quick Controls
|
||||
else if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::OSXMavericks
|
||||
&& QOperatingSystemVersion::current() < QOperatingSystemVersion::OSXYosemite)
|
||||
comboCopy.rect.translate(0, 1);
|
||||
QCommonStyle::drawControl(CE_ComboBoxLabel, &comboCopy, p, w);
|
||||
}
|
||||
|
@ -5410,7 +5412,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
|
|||
QWindow *window = widget && widget->window() ? widget->window()->windowHandle() :
|
||||
QStyleHelper::styleObjectWindow(opt->styleObject);
|
||||
const_cast<QMacStylePrivate *>(d)->resolveCurrentNSView(window);
|
||||
const bool usingYosemiteOrLater = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_10;
|
||||
const bool usingYosemiteOrLater = QOperatingSystemVersion::current() >= QOperatingSystemVersion::OSXYosemite;
|
||||
switch (cc) {
|
||||
case CC_Slider:
|
||||
case CC_ScrollBar:
|
||||
|
@ -6054,7 +6056,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
|
|||
drawToolbarButtonArrow(tb->rect, tds, cg);
|
||||
}
|
||||
if (tb->state & State_On) {
|
||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_10) {
|
||||
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::OSXYosemite) {
|
||||
QWindow *window = 0;
|
||||
if (widget && widget->window())
|
||||
window = widget->window()->windowHandle();
|
||||
|
@ -6418,7 +6420,7 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
|
|||
switch (sc) {
|
||||
case SC_ComboBoxEditField:{
|
||||
ret = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi);
|
||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_10)
|
||||
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::OSXYosemite)
|
||||
ret.setHeight(ret.height() - 1);
|
||||
break; }
|
||||
case SC_ComboBoxArrow:{
|
||||
|
@ -6877,7 +6879,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
|
|||
case CT_ComboBox: {
|
||||
sz.rwidth() += 50;
|
||||
const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt);
|
||||
if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_10 || (cb && !cb->editable))
|
||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::OSXYosemite || (cb && !cb->editable))
|
||||
sz.rheight() += 2;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
#include "qwindowsvistastyle_p.h"
|
||||
#include "qwindowsvistastyle_p_p.h"
|
||||
#include <qoperatingsystemversion.h>
|
||||
#include <qscreen.h>
|
||||
#include <qwindow.h>
|
||||
#include <private/qstyleanimation_p.h>
|
||||
|
@ -1752,7 +1753,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
|
|||
theme.stateId = stateId;
|
||||
d->drawBackground(theme);
|
||||
|
||||
if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8) {
|
||||
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8) {
|
||||
const QRect gripperBounds = QWindowsXPStylePrivate::scrollBarGripperBounds(flags, widget, &theme);
|
||||
// Draw gripper if there is enough space
|
||||
if (!gripperBounds.isEmpty() && flags & State_Enabled) {
|
||||
|
|
|
@ -372,7 +372,7 @@ void tst_qstandardpaths::testFindExecutable_data()
|
|||
QTest::newRow("win-cmd-nosuffix")
|
||||
<< QString() << QString::fromLatin1("cmd") << cmdPath;
|
||||
|
||||
if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS8) {
|
||||
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows8) {
|
||||
// The logo executable on Windows 8 is perfectly suited for testing that the
|
||||
// suffix mechanism is not thrown off by dots in the name.
|
||||
const QString logo = QLatin1String("microsoft.windows.softwarelogo.showdesktop");
|
||||
|
|
|
@ -90,19 +90,14 @@ PlatformInfo PlatformInfo::localHostInfo()
|
|||
#endif
|
||||
#if defined(Q_OS_LINUX)
|
||||
pi.insert(PI_OSName, QLS("Linux"));
|
||||
QProcess uname;
|
||||
uname.start(QLS("uname"), QStringList() << QLS("-r"));
|
||||
if (uname.waitForFinished(3000))
|
||||
pi.insert(PI_OSVersion, QString::fromLocal8Bit(uname.readAllStandardOutput().constData()).simplified());
|
||||
#elif defined(Q_OS_WIN)
|
||||
pi.insert(PI_OSName, QLS("Windows"));
|
||||
pi.insert(PI_OSVersion, QString::number(QSysInfo::windowsVersion()));
|
||||
#elif defined(Q_OS_MAC)
|
||||
pi.insert(PI_OSName, QLS("MacOS"));
|
||||
pi.insert(PI_OSVersion, QString::number(QSysInfo::macVersion()));
|
||||
#elif defined(Q_OS_DARWIN)
|
||||
pi.insert(PI_OSName, QLS("Darwin"));
|
||||
#else
|
||||
pi.insert(PI_OSName, QLS("Other"));
|
||||
#endif
|
||||
pi.insert(PI_OSVersion, QSysInfo::kernelVersion());
|
||||
|
||||
#ifndef QT_NO_PROCESS
|
||||
QProcess git;
|
||||
|
|
Loading…
Reference in New Issue