Interesting issue with KAboutData and icons

David Faure faure at kde.org
Sun Sep 7 09:20:47 UTC 2014


On Monday 18 August 2014 10:08:53 Harald Sitter wrote:
> On Mon, Aug 18, 2014 at 9:41 AM, David Faure <faure at kde.org> wrote:
> > On Monday 04 August 2014 22:01:15 Michael Pyne wrote:
> >> Hi all,
> >> 
> >> I received a bug (https://bugs.kde.org/show_bug.cgi?id=337938) reported
> >> against KAboutData in KCoreAddons, that setting the window icon doesn't
> >> actually set the window icon.
> >> 
> >> In fact, KAboutData doesn't even try to, except for setting a property to
> >> the string name of the icon in question.
> > 
> > Well, that dynamic property call is supposed to catch this static property
> > 
> > from QGuiApplication, provided that qApp is not just a QCoreApplication:
> >   Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon)
> > 
> > I made this stuff work in qtbase f42bd772f8110dba13d209d81d8eed0077772185,
> > which is in Qt 5.3.0.
> > 
> > So it's known that it won't work with older versions of Qt.
> > 
> > I didn't test it via KAboutData though.
> 
> The code in KAboutData expects 'applicationIconName' as property name,
> which does not exist. Furthermore in kcoreaddons we couldn't construct
> a QIcon so the 'windowIcon' property couldn't be used either.

Indeed, my reply was nonsense.

This is fixed now: ignore KAboutData when it comes to the icon, and call 
QGuiApplication::setWincow(QIcon::fromTheme("...")).

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list