[Qt-interest] Qt 4.6's QWebSettings::iconForUrl() only returns null icons

R. Reucher rene.reucher at batcom-it.net
Tue Dec 1 20:52:19 CET 2009


Hi,

while I'm really happy with the new new Qt 4.6.0 release in general, I'm
currently seeing one issue that I don't seem to find a solution or work
around for.

(I've had a few more QPixmapCache-related issues, but I was able to manage
them myself - btw, there may be reasons for this change, but Qt 4.6's
QPixmapCache isn't source code compatible with Qt 4.5's QPixmapCache - just
a fair warning for those struggling with the same issues... the "fun" thing
is, that it may even compile flawlessly, but the result isn't as expected.)

Back to my current problem...

My application uses webkit for some web lookups, and I need to (not only)
display the web pages' favicons whenever possible (= when a favicon is
provided). But for some reason, this simple snippet of code always returns
null icons (whereas with Qt 4.5.3 this works beautifully):

  ...
  QIcon pageIcon = QWebSettings::iconForUrl(webView->url());
  if ( pageIcon.isNull() )
    // use fallback icon
    pageIcon = QIcon(QString::fromUtf8(":/data/img/browser.png"));
  ...

Unfortunately, there is no current Qt example that uses
QWebSettings::iconForUrl() (also not in Qt 4.5.3). So I have no simple
reference to offer.

Do others see similar problems? What could be causing this?

There probably have been many changes to the webkit, and I'm not
complaining... I just want to make sure that there's no bug; or if there
is, to get it fixed in one of the next releases.

Thanks, René
-- 
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/



More information about the Qt-interest-old mailing list