Windows QPA: Compile with QT_NO_CAST_FROM_ASCII, warnings.

Change-Id: I75d6a102a6a1fa0b5f8add049442f23d6fd57725
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Friedemann Kleint 2012-02-02 14:40:02 +01:00 committed by Qt by Nokia
parent ddf21c384f
commit 920795e99a
4 changed files with 13 additions and 9 deletions

View File

@ -267,7 +267,7 @@ private:
virtual void unlockAlphaMapForGlyph();
virtual void removeGlyphFromCache(glyph_t glyph);
virtual int glyphMargin(QFontEngineGlyphCache::Type type) { return 0; }
virtual int glyphMargin(QFontEngineGlyphCache::Type /* type */) { return 0; }
virtual int glyphCount() const;

View File

@ -346,7 +346,7 @@ QString QWindowsContext::registerWindowClass(const QWindow *w, bool isGL)
uint style = 0;
bool icon = false;
QString cname = "Qt5";
QString cname = QStringLiteral("Qt5");
if (w && isGL) {
cname += QStringLiteral("QGLWindow");
style = CS_DBLCLKS|CS_OWNDC;

View File

@ -109,7 +109,7 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName,
if (familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QStringLiteral("WST_")))
return false;
const int separatorPos = familyName.indexOf("::");
const int separatorPos = familyName.indexOf(QStringLiteral("::"));
const QString faceName =
separatorPos != -1 ? familyName.left(separatorPos) : familyName;
const QString fullName =
@ -169,7 +169,7 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName,
writingSystems.setSupported(ws);
}
const QSettings fontRegistry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts",
const QSettings fontRegistry(QStringLiteral("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"),
QSettings::NativeFormat);
struct FontKey
@ -189,7 +189,7 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName,
FontKey fontKey(key);
QString realKey = key;
realKey = realKey.remove(trueType);
realKey.remove(trueType);
const QStringList fonts = realKey.trimmed().split(QLatin1Char('&'));
foreach (const QString &font, fonts)
fontKey.fonts.push_back(font.trimmed());
@ -198,14 +198,14 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName,
}
}
QByteArray value;
QString value;
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];
if (font == faceName || (faceName != fullName && fullName == font)) {
value = fontRegistry.value(fontKey.key).toByteArray();
value = fontRegistry.value(fontKey.key).toString();
index = i;
break;
}
@ -218,7 +218,7 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName,
return false;
if (!QDir::isAbsolutePath(value))
value = qgetenv("windir") + "\\Fonts\\" + value;
value.prepend(QString::fromLocal8Bit(qgetenv("windir") + "\\Fonts\\"));
// Pointer is deleted in QBasicFontDatabase::releaseHandle(void *handle)
FontFile *fontFile = new FontFile;
@ -244,7 +244,9 @@ static int CALLBACK storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetric,
int type, LPARAM namesSetIn)
{
typedef QSet<QString> StringSet;
const QString familyName = QString::fromWCharArray(f->elfLogFont.lfFaceName) + "::" + QString::fromWCharArray(f->elfFullName);
const QString familyName = QString::fromWCharArray(f->elfLogFont.lfFaceName)
+ QStringLiteral("::")
+ QString::fromWCharArray(f->elfFullName);
const QString script = QString::fromWCharArray(f->elfScript);
const FONTSIGNATURE signature = textmetric->ntmFontSig;

View File

@ -14,6 +14,8 @@ win32-g++: LIBS *= -luuid
# For the dialog helpers:
LIBS *= -lshlwapi -lShell32
DEFINES *= QT_NO_CAST_FROM_ASCII
contains(QT_CONFIG, directwrite) {
LIBS *= -ldwrite
SOURCES += qwindowsfontenginedirectwrite.cpp