summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2016-10-03 19:34:21 +0200
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2016-10-06 08:02:59 +0000
commit669add92d9adc15ecfa0b2d62dd90ea9066d401e (patch)
tree49ad8ef5a042c1f0cf9aa305bb8836b63e1d282f /src/platformsupport
parent1b567854e4787ac591f8039c88e8cd8a44edaef7 (diff)
Replace QCFString::to(CF/NS/Q)String usage with QString methods
Slims down QCFString and leaves only one implementation of converting back and forth between CF/NS strings and QStrings. Change-Id: I068568ffa25e6f4f6d6c99dcf47078b7a8e70e10 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm8
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index 16d65caf86..78a0c4d0c9 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -206,7 +206,7 @@ void QCoreTextFontDatabase::populateFontDatabase()
const int numberOfFamilies = CFArrayGetCount(familyNames);
for (int i = 0; i < numberOfFamilies; ++i) {
CFStringRef familyNameRef = (CFStringRef) CFArrayGetValueAtIndex(familyNames, i);
- QString familyName = QCFString::toQString(familyNameRef);
+ QString familyName = QString::fromCFString(familyNameRef);
// Don't populate internal fonts
if (familyName.startsWith(QLatin1Char('.')) || familyName == QLatin1String("LastResort"))
@@ -505,9 +505,9 @@ static QString familyNameFromPostScriptName(NSString *psName)
{
QCFType<CTFontDescriptorRef> fontDescriptor = (CTFontDescriptorRef) CTFontDescriptorCreateWithNameAndSize((CFStringRef)psName, 12.0);
QCFString familyName = (CFStringRef) CTFontDescriptorCopyAttribute(fontDescriptor, kCTFontFamilyNameAttribute);
- QString name = QCFString::toQString(familyName);
+ QString name = QString::fromCFString(familyName);
if (name.isEmpty())
- qWarning() << "QCoreTextFontDatabase: Failed to resolve family name for PostScript name " << QCFString::toQString((CFStringRef)psName);
+ qWarning() << "QCoreTextFontDatabase: Failed to resolve family name for PostScript name " << QString::fromCFString((CFStringRef)psName);
return name;
}
@@ -537,7 +537,7 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo
for (int i = 0; i < numCascades; ++i) {
CTFontDescriptorRef fontFallback = (CTFontDescriptorRef) CFArrayGetValueAtIndex(cascadeList, i);
QCFString fallbackFamilyName = (CFStringRef) CTFontDescriptorCopyAttribute(fontFallback, kCTFontFamilyNameAttribute);
- fallbackList.append(QCFString::toQString(fallbackFamilyName));
+ fallbackList.append(QString::fromCFString(fallbackFamilyName));
}
#if defined(Q_OS_OSX)
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 0bc0416eec..7a06d5f1c9 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -213,7 +213,7 @@ void QCoreTextFontEngine::init()
face_id.index = 0;
QCFString name = CTFontCopyName(ctfont, kCTFontUniqueNameKey);
- face_id.filename = QCFString::toQString(name).toUtf8();
+ face_id.filename = QString::fromCFString(name).toUtf8();
QCFString family = CTFontCopyFamilyName(ctfont);
fontDef.family = family;
@@ -826,8 +826,8 @@ QFontEngine::Properties QCoreTextFontEngine::properties() const
QCFString psName, copyright;
psName = CTFontCopyPostScriptName(ctfont);
copyright = CTFontCopyName(ctfont, kCTFontCopyrightNameKey);
- result.postscriptName = QCFString::toQString(psName).toUtf8();
- result.copyright = QCFString::toQString(copyright).toUtf8();
+ result.postscriptName = QString::fromCFString(psName).toUtf8();
+ result.copyright = QString::fromCFString(copyright).toUtf8();
qreal emSquare = CTFontGetUnitsPerEm(ctfont);
qreal scale = emSquare / CTFontGetSize(ctfont);