From: Friedemann Kleint Date: Fri, 3 Feb 2012 12:30:03 +0000 (+0100) Subject: Fix compilation on MinGW. X-Git-Tag: qt-v5.0.0-alpha1~1335 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5117f55063af0df665c5eeabba26f4312bf5381b;p=profile%2Fivi%2Fqtbase.git Fix compilation on MinGW. - Add missing constant. - Make FontKey a pair instead of a function-local type which cannot be used as template parameter for gcc. - Fix warnings about redefinition of NOMINMAX and enumeration. Change-Id: Ie3eb6e5b8dd9cd81210d6e10270ada0158aaf809 Reviewed-by: Miikka Heikkinen Reviewed-by: Friedemann Kleint --- diff --git a/src/corelib/global/qt_windows.h b/src/corelib/global/qt_windows.h index f9d2cf8..e4af46d 100644 --- a/src/corelib/global/qt_windows.h +++ b/src/corelib/global/qt_windows.h @@ -60,7 +60,9 @@ #endif #endif -#define NOMINMAX +#ifndef NOMINMAX +# define NOMINMAX +#endif #include #ifdef _WIN32_WCE diff --git a/src/plugins/platforms/windows/qtwindows_additional.h b/src/plugins/platforms/windows/qtwindows_additional.h index 57935f2..864107e 100644 --- a/src/plugins/platforms/windows/qtwindows_additional.h +++ b/src/plugins/platforms/windows/qtwindows_additional.h @@ -56,6 +56,7 @@ # define SPI_GETFONTSMOOTHINGTYPE 0x200A # define FE_FONTSMOOTHINGCLEARTYPE 0x0002 # define CLEARTYPE_QUALITY 5 +# define SPI_GETDROPSHADOW 0x1024 # define CF_DIBV5 17 diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp index 52ff9fb..f397e9c 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp @@ -105,6 +105,8 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName, const FONTSIGNATURE *signature, int type) { + typedef QPair FontKey; + // the "@family" fonts are just the same as "family". Ignore them. if (familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QStringLiteral("WST_"))) return false; @@ -172,29 +174,19 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName, const QSettings fontRegistry(QStringLiteral("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"), QSettings::NativeFormat); - struct FontKey - { - FontKey() {} - FontKey(const QString &k) : key(k) {} - - QString key; - QStringList fonts; - }; static QVector allFonts; if (allFonts.isEmpty()) { const QStringList allKeys = fontRegistry.allKeys(); allFonts.reserve(allKeys.size()); const QString trueType = QStringLiteral("(TrueType)"); foreach (const QString &key, allKeys) { - FontKey fontKey(key); - QString realKey = key; realKey.remove(trueType); - const QStringList fonts = realKey.trimmed().split(QLatin1Char('&')); - foreach (const QString &font, fonts) - fontKey.fonts.push_back(font.trimmed()); - - allFonts.push_back(fontKey); + QStringList fonts; + const QStringList fontNames = realKey.trimmed().split(QLatin1Char('&')); + foreach (const QString &fontName, fontNames) + fonts.push_back(fontName.trimmed()); + allFonts.push_back(FontKey(key, fonts)); } } @@ -202,10 +194,10 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName, int index = 0; for (int k = 0; k < allFonts.size(); ++k) { const FontKey &fontKey = allFonts.at(k); - for (int i = 0; i < fontKey.fonts.length(); ++i) { - const QString font = fontKey.fonts[i]; + for (int i = 0; i < fontKey.second.length(); ++i) { + const QString &font = fontKey.second.at(i); if (font == faceName || (faceName != fullName && fullName == font)) { - value = fontRegistry.value(fontKey.key).toString(); + value = fontRegistry.value(fontKey.first).toString(); index = i; break; } diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index d46a8a6..2771ec7 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -293,6 +293,7 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co case QPlatformIntegration::StartDragDistance: case QPlatformIntegration::MouseDoubleClickInterval: case QPlatformIntegration::KeyboardInputInterval: + case QPlatformIntegration::ShowIsFullScreen: break; // Not implemented } return QPlatformIntegration::styleHint(hint);