summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/text/qfont_s60.cpp10
-rw-r--r--src/s60installs/bwins/QtGuiu.def1
-rw-r--r--src/s60installs/eabi/QtGuiu.def1
-rw-r--r--tests/auto/qfont/tst_qfont.cpp7
4 files changed, 19 insertions, 0 deletions
diff --git a/src/gui/text/qfont_s60.cpp b/src/gui/text/qfont_s60.cpp
index d39f30a..80a3bb2 100644
--- a/src/gui/text/qfont_s60.cpp
+++ b/src/gui/text/qfont_s60.cpp
@@ -57,6 +57,16 @@ Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, fontFamiliesOnFontServer, {
});
#endif // QT_NO_FREETYPE
+QString QFont::lastResortFont() const
+{
+ // Symbian's font Api does not distinguish between font and family.
+ // Therefore we try to get a "Family" first, then fall back to "Sans".
+ static QString font = lastResortFamily();
+ if (font.isEmpty())
+ font = QLatin1String("Sans");
+ return font;
+}
+
QString QFont::lastResortFamily() const
{
#ifdef QT_NO_FREETYPE
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 7805dae..9a61523 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -12892,4 +12892,5 @@ EXPORTS
?setTimeout@QTapAndHoldGesture@@SAXH@Z @ 12891 NONAME ; void QTapAndHoldGesture::setTimeout(int)
?qmljsDebugArguments@QApplicationPrivate@@2VQString@@A @ 12892 NONAME ; class QString QApplicationPrivate::qmljsDebugArguments
?effectiveBoundingRect@QGraphicsItemPrivate@@QBE?AVQRectF@@PAVQGraphicsItem@@@Z @ 12893 NONAME ; class QRectF QGraphicsItemPrivate::effectiveBoundingRect(class QGraphicsItem *) const
+ ?lastResortFont@QFont@@QBE?AVQString@@XZ @ 12894 NONAME ; class QString QFont::lastResortFont(void) const
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 4442d33..634b7af 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12097,4 +12097,5 @@ EXPORTS
_ZN19QApplicationPrivate19qmljsDebugArgumentsE @ 12096 NONAME DATA 4
_ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFP13QGraphicsItem @ 12097 NONAME
_ZNK20QGraphicsItemPrivate21effectiveBoundingRectEP13QGraphicsItem @ 12098 NONAME
+ _ZNK5QFont14lastResortFontEv @ 12099 NONAME
diff --git a/tests/auto/qfont/tst_qfont.cpp b/tests/auto/qfont/tst_qfont.cpp
index 7bda665..296ed68 100644
--- a/tests/auto/qfont/tst_qfont.cpp
+++ b/tests/auto/qfont/tst_qfont.cpp
@@ -76,6 +76,7 @@ private slots:
void italicOblique();
void insertAndRemoveSubstitutions();
void serializeSpacing();
+ void lastResortFont();
};
// Testing get/set functions
@@ -593,5 +594,11 @@ void tst_QFont::serializeSpacing()
QCOMPARE(font3.wordSpacing(), 50.);
}
+void tst_QFont::lastResortFont()
+{
+ QFont font;
+ QVERIFY(!font.lastResortFont().isEmpty());
+}
+
QTEST_MAIN(tst_QFont)
#include "tst_qfont.moc"