You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, May 25th 2005, 5:28am

KAboutApplication: what's wrong

void app::showAbout()
{
KAboutApplication * about = new KAboutApplication::KAboutApplication( this, "about", TRUE );
KIconLoader * loader = new KIconLoader();
QPixmap app_ico;
app_ico.load( loader->iconPath( QString( "app" ), -32 ) );
about->setLogo( app_ico );
about->exec();
delete loader;
}

I see the wrong (empty) icon in my about; why?

If i set the icon with about->setIcon("/usr/share/icons/hicolor/32x32/apps/app.png" ); it works.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

2

Wednesday, May 25th 2005, 1:14pm

Maybe you should use the configured icon loader of your application instead of creating a new one.

Cheers,
_
Qt/KDE Developer
Debian User

3

Thursday, May 26th 2005, 2:21am

Thanks,
i've seen that KApplication inherits KIstance that has KIconLoader *
iconLoader () const but.... i'm a newbie... how can i access this iconloader?

4

Thursday, May 26th 2005, 2:24am

I mean: to access QApplication i can use qApp but i don't know how to access my KApplication from the code of my KMainWindow.

5

Thursday, May 26th 2005, 2:35am

S O L V E D ! ! !

I searched and found kapp.

The documentation say:
This instance is always accessible via the 'kapp' global variable.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

6

Thursday, May 26th 2005, 10:20am

You can also use KApplication::kApplication() that's a static method.

Another way is to use KGlobal::instance()

Cheers,
_
Qt/KDE Developer
Debian User