summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-02-03 13:30:03 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-03 15:09:03 +0100
commit5117f55063af0df665c5eeabba26f4312bf5381b (patch)
treed7e4a33a0013f29fb6d241202567692ccc98c113
parent5bab4744bad247f3b93792f9ed4b578b0f780296 (diff)
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 <miikka.heikkinen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
-rw-r--r--src/corelib/global/qt_windows.h4
-rw-r--r--src/plugins/platforms/windows/qtwindows_additional.h1
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp28
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp1
4 files changed, 15 insertions, 19 deletions
diff --git a/src/corelib/global/qt_windows.h b/src/corelib/global/qt_windows.h
index f9d2cf8413..e4af46d939 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 <windows.h>
#ifdef _WIN32_WCE
diff --git a/src/plugins/platforms/windows/qtwindows_additional.h b/src/plugins/platforms/windows/qtwindows_additional.h
index 57935f2636..864107e392 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 52ff9fbb52..f397e9cb92 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<QString, QStringList> 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<FontKey> 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 d46a8a6fba..2771ec7e8a 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);