From d86192e5ba7911407881f5079c4486c1fb084dc6 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Sat, 26 Oct 2019 13:57:05 +0200 Subject: QFontDatabase: improve logging output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Log the style name, add more descriptions of what's being logged. Before: Adding font "Lucida Grande" 50 QFont::StyleNormal 0 aa true fixed false After: Adding font family "Lucida Grande" stylename "Regular" weight 50 style QFont::StyleNormal pixelSize 0 antialiased true fixed false Change-Id: I138f1b9f41dc41c528c830d81f8018fc16561631 Reviewed-by: Tor Arne Vestbø --- src/gui/text/qfontdatabase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index fe7dd80e44..67783e5b42 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -733,7 +733,8 @@ void qt_registerFont(const QString &familyName, const QString &stylename, const QSupportedWritingSystems &writingSystems, void *handle) { QFontDatabasePrivate *d = privateDb(); - qCDebug(lcFontDb) << "Adding font" << familyName << weight << style << pixelSize << "aa" << antialiased << "fixed" << fixedPitch; + qCDebug(lcFontDb) << "Adding font: familyName" << familyName << "stylename" << stylename << "weight" << weight + << "style" << style << "pixelSize" << pixelSize << "antialiased" << antialiased << "fixed" << fixedPitch; QtFontStyle::Key styleKey; styleKey.style = style; styleKey.weight = weight; -- cgit v1.2.3 From 0fb995492d377fde96b453680f3604f5991171c0 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 27 Oct 2019 09:33:54 +0100 Subject: QImageIOHandler: remove #if around virtual method name() It makes -DQT_DISABLE_DEPRECATED_BEFORE=0x050d00 (in an application) trigger a binary incompatible change and crash. Change-Id: I9b9783d134821697180dc3fd8f2f69a51ddb7ac6 Reviewed-by: Christian Ehrlicher Reviewed-by: Edward Welbourne --- src/gui/image/qimageiohandler.cpp | 4 +--- src/gui/image/qimageiohandler.h | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'src/gui') diff --git a/src/gui/image/qimageiohandler.cpp b/src/gui/image/qimageiohandler.cpp index 0e7b541cf2..a4f927a462 100644 --- a/src/gui/image/qimageiohandler.cpp +++ b/src/gui/image/qimageiohandler.cpp @@ -416,18 +416,16 @@ QByteArray QImageIOHandler::format() const \sa read(), QIODevice::peek() */ -#if QT_DEPRECATED_SINCE(5, 13) /*! \obsolete Use format() instead. */ -QByteArray QImageIOHandler::name() const +QByteArray QImageIOHandler::name() const // ### Qt6: remove { return format(); } -#endif /*! Writes the image \a image to the assigned device. Returns \c true on diff --git a/src/gui/image/qimageiohandler.h b/src/gui/image/qimageiohandler.h index c20b84afbb..a4acf9dfe0 100644 --- a/src/gui/image/qimageiohandler.h +++ b/src/gui/image/qimageiohandler.h @@ -69,10 +69,8 @@ public: void setFormat(const QByteArray &format) const; QByteArray format() const; -#if QT_DEPRECATED_SINCE(5, 13) QT_DEPRECATED_X("Use QImageIOHandler::format() instead") virtual QByteArray name() const; -#endif virtual bool canRead() const = 0; virtual bool read(QImage *image) = 0; -- cgit v1.2.3 From b1004c7d0a5d7abbacd687fd41a5b2683e62b27d Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 29 Oct 2019 09:44:50 +0100 Subject: If only family is set, prefer that in the families list after resolving If a font with only a family set is resolved with one that has been setup with setFamilies() then the family needs to be prepended to the families list after resolving. This is so that the font still prefers the one set as just a family with no famillies set. This also amends the QFontDialog test to account for this too. [ChangeLog][QtGui][Text] Resolving a font that just has a family set with families set will prepend the family to the families so that it is still the first preference for the font. Task-number: QTBUG-46322 Change-Id: Icc4005732f95b2b4c684e592b06b31e133270e44 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfont.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 84c5be60b1..f5dbec3a3e 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -271,8 +271,13 @@ void QFontPrivate::resolve(uint mask, const QFontPrivate *other) if (! (mask & QFont::FamilyResolved)) request.family = other->request.family; - if (!(mask & QFont::FamiliesResolved)) + if (!(mask & QFont::FamiliesResolved)) { request.families = other->request.families; + // Prepend the family explicitly set so it will be given + // preference in this case + if (mask & QFont::FamilyResolved) + request.families.prepend(request.family); + } if (! (mask & QFont::StyleNameResolved)) request.styleName = other->request.styleName; -- cgit v1.2.3