From 240efee49a8e4402f2048a05c596605b2feadbd3 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Tue, 12 Apr 2016 17:35:19 +0200 Subject: Combine candidate icons for a page into a single icon For the Widget API the QIcon returned by QWebEnginePage::icon() function contains all the candidate icons for the current page. For the Quick API the QQuickWebEngineFaviconProvider provides the best quality icon for the requested size from the candidates. Task-number: QTBUG-51179 Change-Id: I42b8427f957e2f2fc745dd0111bedcc71b577216 Reviewed-by: Allan Sandfeld Jensen --- src/webengine/api/qquickwebenginefaviconprovider.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/webengine/api/qquickwebenginefaviconprovider.cpp') diff --git a/src/webengine/api/qquickwebenginefaviconprovider.cpp b/src/webengine/api/qquickwebenginefaviconprovider.cpp index c41ec5a07..fe8436d6c 100644 --- a/src/webengine/api/qquickwebenginefaviconprovider.cpp +++ b/src/webengine/api/qquickwebenginefaviconprovider.cpp @@ -121,12 +121,13 @@ QPixmap QQuickWebEngineFaviconProvider::requestPixmap(const QString &id, QSize * return QPixmap(); FaviconManager *faviconManager = view->d_ptr->adapter->faviconManager(); - Q_ASSERT(faviconManager); - const QIcon &icon = faviconManager->getIcon(iconUrl); + Q_ASSERT(faviconManager); + const FaviconInfo &faviconInfo = faviconManager->getFaviconInfo(iconUrl); + const QIcon &icon = faviconManager->getIcon(faviconInfo.candidate ? QUrl() : iconUrl); Q_ASSERT(!icon.isNull()); - const QSize &bestSize = faviconManager->getFaviconInfo(iconUrl).size; + const QSize &bestSize = faviconInfo.size; // If source size is not specified, use the best quality if (!requestedSize.isValid()) { -- cgit v1.2.3