summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/text
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/text')
-rw-r--r--tests/auto/gui/text/qfontdatabase/testdata.qrc1
-rw-r--r--tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp29
-rw-r--r--tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro2
-rw-r--r--tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp6
-rw-r--r--tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro2
-rw-r--r--tests/auto/gui/text/qtexttable/tst_qtexttable.cpp2
6 files changed, 39 insertions, 3 deletions
diff --git a/tests/auto/gui/text/qfontdatabase/testdata.qrc b/tests/auto/gui/text/qfontdatabase/testdata.qrc
index 224e845601..a590099b20 100644
--- a/tests/auto/gui/text/qfontdatabase/testdata.qrc
+++ b/tests/auto/gui/text/qfontdatabase/testdata.qrc
@@ -4,5 +4,6 @@
<file alias="testfont.ttf">../../../shared/resources/testfont.ttf</file>
<file alias="testfont_condensed.ttf">../../../shared/resources/testfont_condensed.ttf</file>
<file alias="testfont_italic.ttf">../../../shared/resources/testfont_italic.ttf</file>
+ <file alias="testfont_open.otf">../../../shared/resources/testfont_open.otf</file>
</qresource>
</RCC>
diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
index 2b69801b59..12e8083622 100644
--- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
@@ -76,6 +76,9 @@ private slots:
void rasterFonts();
void smoothFonts();
+ void registerOpenTypePreferredNamesSystem();
+ void registerOpenTypePreferredNamesApplication();
+
private:
QString m_ledFont;
QString m_testFont;
@@ -440,5 +443,31 @@ void tst_QFontDatabase::smoothFonts()
QVERIFY(!QFontDatabase().isBitmapScalable(font.family()));
}
+void tst_QFontDatabase::registerOpenTypePreferredNamesSystem()
+{
+ QFontDatabase db;
+ // This font family was picked because it was the only one I had installed which showcased the
+ // problem
+ if (!db.hasFamily(QString::fromLatin1("Source Code Pro ExtraLight")))
+ QSKIP("Source Code Pro ExtraLight is not installed");
+
+ QStringList styles = db.styles(QString::fromLatin1("Source Code Pro"));
+ QVERIFY(styles.contains(QLatin1String("ExtraLight")));
+}
+
+void tst_QFontDatabase::registerOpenTypePreferredNamesApplication()
+{
+ QFontDatabase db;
+
+ int id = QFontDatabase::addApplicationFont(QString::fromLatin1(":/testfont_open.otf"));
+ if (id == -1)
+ QSKIP("Skip the test since app fonts are not supported on this system");
+
+ QStringList styles = db.styles(QString::fromLatin1("QtBidiTestFont"));
+ QVERIFY(styles.contains(QLatin1String("Open")));
+
+ QFontDatabase::removeApplicationFont(id);
+}
+
QTEST_MAIN(tst_QFontDatabase)
#include "tst_qfontdatabase.moc"
diff --git a/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro b/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro
index a78c429433..c91eaad944 100644
--- a/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro
+++ b/tests/auto/gui/text/qsyntaxhighlighter/qsyntaxhighlighter.pro
@@ -2,4 +2,4 @@ CONFIG += testcase
TARGET = tst_qsyntaxhighlighter
SOURCES += tst_qsyntaxhighlighter.cpp
QT += testlib
-qtHaveModule(widgets) QT += widgets
+qtHaveModule(widgets): QT += widgets
diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
index 2944e88d70..10a627bb82 100644
--- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
@@ -1796,6 +1796,12 @@ void tst_QTextDocument::toHtml()
QCOMPARE(output, expectedOutput);
QDomDocument document;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QEXPECT_FAIL("charfmt-for-list-item",
+ "The attribute \"style\" is redefined in the generated HTML, which is not valid "
+ "according to XML standard. The new QDomDocument implementation follows the XML "
+ "standard.", Continue);
+#endif
QVERIFY2(document.setContent(output), "Output was not valid XML");
}
diff --git a/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro b/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro
index 5d31ee3930..322690e4cc 100644
--- a/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro
+++ b/tests/auto/gui/text/qtextdocumentlayout/qtextdocumentlayout.pro
@@ -1,7 +1,7 @@
CONFIG += testcase
TARGET = tst_qtextdocumentlayout
QT += testlib
-qtHaveModule(widgets) QT += widgets
+qtHaveModule(widgets): QT += widgets
SOURCES += tst_qtextdocumentlayout.cpp
diff --git a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
index 7b2ff4cc10..474079037b 100644
--- a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
@@ -1041,7 +1041,7 @@ public:
QList<QRectF> rects;
PaintEngine()
- : QPaintEngine(0)
+ : QPaintEngine(QPaintEngine::PaintEngineFeatures{ })
{}
virtual Type type() const
{