diff options
author | miniak <milan.burda@gmail.com> | 2011-10-06 10:42:17 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2011-10-06 10:42:17 (GMT) |
commit | 1ef309e964753105e14a8c223a1b59c0cbd9369b (patch) | |
tree | d5167c327bbb4c05b4a5e9023f4e4caf60e663ea /src/gui/kernel | |
parent | d1fa89e1cce4dcc6bf15fc59196be6764fda51d1 (diff) | |
download | Qt-1ef309e964753105e14a8c223a1b59c0cbd9369b.zip Qt-1ef309e964753105e14a8c223a1b59c0cbd9369b.tar.gz Qt-1ef309e964753105e14a8c223a1b59c0cbd9369b.tar.bz2 |
Fix QSysInfo::WindowsVersion checking (QSysInfo::WV_NT_based is a mask)
Merge-request: 1272
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_win.cpp | 13 | ||||
-rw-r--r-- | src/gui/kernel/qguiplatformplugin.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qwhatsthis.cpp | 4 |
3 files changed, 11 insertions, 10 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 756cb56..c472738 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -682,7 +682,7 @@ void QApplicationPrivate::initializeWidgetPaletteHash() QColor menuText(qt_colorref2qrgb(GetSysColor(COLOR_MENUTEXT))); BOOL isFlat = false; if ((QSysInfo::WindowsVersion >= QSysInfo::WV_XP - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) SystemParametersInfo(SPI_GETFLATMENU, 0, &isFlat, 0); QPalette menu(pal); // we might need a special color group for the menu. @@ -697,7 +697,7 @@ void QApplicationPrivate::initializeWidgetPaletteHash() menu.setColor(QPalette::Disabled, QPalette::Highlight, QColor(qt_colorref2qrgb(GetSysColor( (QSysInfo::WindowsVersion >= QSysInfo::WV_XP - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based) + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) && isFlat ? COLOR_MENUHILIGHT : COLOR_HIGHLIGHT)))); menu.setColor(QPalette::Disabled, QPalette::HighlightedText, disabled); menu.setColor(QPalette::Disabled, QPalette::Button, @@ -719,7 +719,7 @@ void QApplicationPrivate::initializeWidgetPaletteHash() QApplication::setPalette(menu, "QMenu"); if ((QSysInfo::WindowsVersion >= QSysInfo::WV_XP - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based) && isFlat) { + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) && isFlat) { QColor menubar(qt_colorref2qrgb(GetSysColor(COLOR_MENUBAR))); menu.setColor(QPalette::Active, QPalette::Button, menubar); menu.setColor(QPalette::Disabled, QPalette::Button, menubar); @@ -999,7 +999,7 @@ const QString qt_reg_winclass(QWidget *w) // register window class style = CS_DBLCLKS; if (w->inherits("QTipLabel") || w->inherits("QAlphaWidget")) { if ((QSysInfo::WindowsVersion >= QSysInfo::WV_XP - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) { + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) { style |= CS_DROPSHADOW; } cname = QLatin1String("QToolTip"); @@ -1017,7 +1017,7 @@ const QString qt_reg_winclass(QWidget *w) // register window class style |= CS_SAVEBITS; #endif if ((QSysInfo::WindowsVersion >= QSysInfo::WV_XP - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) style |= CS_DROPSHADOW; icon = false; } else { @@ -4161,7 +4161,8 @@ PtrCloseTouchInputHandle QApplicationPrivate::CloseTouchInputHandle = 0; void QApplicationPrivate::initializeMultitouch_sys() { - if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7) { + if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7 + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) { static const int QT_SM_DIGITIZER = 94; int value = GetSystemMetrics(QT_SM_DIGITIZER); static const int QT_NID_INTEGRATED_TOUCH = 0x01; diff --git a/src/gui/kernel/qguiplatformplugin.cpp b/src/gui/kernel/qguiplatformplugin.cpp index 708859d..04fd111 100644 --- a/src/gui/kernel/qguiplatformplugin.cpp +++ b/src/gui/kernel/qguiplatformplugin.cpp @@ -137,10 +137,10 @@ QString QGuiPlatformPlugin::styleName() return QLatin1String("WindowsCE"); #elif defined(Q_WS_WIN) if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) return QLatin1String("WindowsVista"); else if ((QSysInfo::WindowsVersion >= QSysInfo::WV_XP - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) return QLatin1String("WindowsXP"); else return QLatin1String("Windows"); // default styles for Windows diff --git a/src/gui/kernel/qwhatsthis.cpp b/src/gui/kernel/qwhatsthis.cpp index 5328cb1..da79250 100644 --- a/src/gui/kernel/qwhatsthis.cpp +++ b/src/gui/kernel/qwhatsthis.cpp @@ -227,7 +227,7 @@ QWhatsThat::QWhatsThat(const QString& txt, QWidget* parent, QWidget *showTextFor } #if defined(Q_WS_WIN) if ((QSysInfo::WindowsVersion >= QSysInfo::WV_XP - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) { BOOL shadow; SystemParametersInfo(SPI_GETDROPSHADOW, 0, &shadow, 0); @@ -305,7 +305,7 @@ void QWhatsThat::paintEvent(QPaintEvent*) bool drawShadow = true; #if defined(Q_WS_WIN) if ((QSysInfo::WindowsVersion >= QSysInfo::WV_XP - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) { BOOL shadow; SystemParametersInfo(SPI_GETDROPSHADOW, 0, &shadow, 0); |