diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-08-19 11:52:07 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-08-25 17:59:10 +0200 |
commit | b77a3f47c9d6f4fd68a687e3bdb38e550d2810ad (patch) | |
tree | 0849ece35646b7847218a54005ff512ae25eda5d /tests/auto/gui/text | |
parent | c0d0949448c5a75d50ca189974d4d9f48133aea8 (diff) |
Rename confusingly named QFont/QPalette::resolve overloads
Having three methods with the same name doing different things is
unnecessarily confusing, so follow the standard naming convention in
Qt and call the getter of the resolve mask resolveMask, and the setter
setResolveMask. These methods were all documented as internal.
The publicly documented resolve() method that merges two fonts and
palettes based on the respective masks remains as it is, even though
'merge' would perhaps be a better name.
Change-Id: If90b1ad800834baccd1dbc38fc6b861540d6df6e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/gui/text')
-rw-r--r-- | tests/auto/gui/text/qfont/tst_qfont.cpp | 10 | ||||
-rw-r--r-- | tests/auto/gui/text/qtextformat/tst_qtextformat.cpp | 16 |
2 files changed, 13 insertions, 13 deletions
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 83d8d01062..5e4fdfcdc9 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -322,22 +322,22 @@ void tst_QFont::resetFont() QWidget secondChild(&parent); secondChild.setFont(childFont); - QVERIFY(parentFont.resolve() != 0); - QVERIFY(childFont.resolve() != 0); + QVERIFY(parentFont.resolveMask() != 0); + QVERIFY(childFont.resolveMask() != 0); QVERIFY(childFont != parentFont); // reset font on both children firstChild.setFont(QFont()); secondChild.setFont(QFont()); - QCOMPARE(firstChild.font().resolve(), QFont::SizeResolved); - QCOMPARE(secondChild.font().resolve(), QFont::SizeResolved); + QCOMPARE(firstChild.font().resolveMask(), QFont::SizeResolved); + QCOMPARE(secondChild.font().resolveMask(), QFont::SizeResolved); #ifdef Q_OS_ANDROID QEXPECT_FAIL("", "QTBUG-69214", Continue); #endif QCOMPARE(firstChild.font().pointSize(), parent.font().pointSize()); QCOMPARE(secondChild.font().pointSize(), parent.font().pointSize()); - QVERIFY(parent.font().resolve() != 0); + QVERIFY(parent.font().resolveMask() != 0); } #endif diff --git a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp index 7548dbb8e4..ef5e3a0e0b 100644 --- a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp +++ b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp @@ -535,19 +535,19 @@ void tst_QTextFormat::setFont() QCOMPARE((int)f.font().capitalization(), (int)f.fontCapitalization()); QCOMPARE(f.font().kerning(), f.fontKerning()); - if (overrideAll || (font2.resolve() & QFont::StyleHintResolved)) + if (overrideAll || (font2.resolveMask() & QFont::StyleHintResolved)) QCOMPARE((int)f.font().styleHint(), (int)font2.styleHint()); else QCOMPARE((int)f.font().styleHint(), (int)font1.styleHint()); - if (overrideAll || (font2.resolve() & QFont::StyleStrategyResolved)) + if (overrideAll || (font2.resolveMask() & QFont::StyleStrategyResolved)) QCOMPARE((int)f.font().styleStrategy(), (int)font2.styleStrategy()); else QCOMPARE((int)f.font().styleStrategy(), (int)font1.styleStrategy()); - if (overrideAll || (font2.resolve() & QFont::CapitalizationResolved)) + if (overrideAll || (font2.resolveMask() & QFont::CapitalizationResolved)) QCOMPARE((int)f.font().capitalization(), (int)font2.capitalization()); else QCOMPARE((int)f.font().capitalization(), (int)font1.capitalization()); - if (overrideAll || (font2.resolve() & QFont::KerningResolved)) + if (overrideAll || (font2.resolveMask() & QFont::KerningResolved)) QCOMPARE(f.font().kerning(), font2.kerning()); else QCOMPARE(f.font().kerning(), font1.kerning()); @@ -639,19 +639,19 @@ void tst_QTextFormat::setFont_collection() int formatIndex = collection.indexForFormat(tmp); QTextCharFormat f = collection.charFormat(formatIndex); - if (overrideAll || (font2.resolve() & QFont::StyleHintResolved)) + if (overrideAll || (font2.resolveMask() & QFont::StyleHintResolved)) QCOMPARE((int)f.font().styleHint(), (int)font2.styleHint()); else QCOMPARE((int)f.font().styleHint(), (int)font1.styleHint()); - if (overrideAll || (font2.resolve() & QFont::StyleStrategyResolved)) + if (overrideAll || (font2.resolveMask() & QFont::StyleStrategyResolved)) QCOMPARE((int)f.font().styleStrategy(), (int)font2.styleStrategy()); else QCOMPARE((int)f.font().styleStrategy(), (int)font1.styleStrategy()); - if (overrideAll || (font2.resolve() & QFont::CapitalizationResolved)) + if (overrideAll || (font2.resolveMask() & QFont::CapitalizationResolved)) QCOMPARE((int)f.font().capitalization(), (int)font2.capitalization()); else QCOMPARE((int)f.font().capitalization(), (int)font1.capitalization()); - if (overrideAll || (font2.resolve() & QFont::KerningResolved)) + if (overrideAll || (font2.resolveMask() & QFont::KerningResolved)) QCOMPARE(f.font().kerning(), font2.kerning()); else QCOMPARE(f.font().kerning(), font1.kerning()); |