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.
kapplication.h uh?
I want to put a shutdown button in my application, but I can't get it to work. Could someone help me with that? I'm new to c++ so maybe may hole problem is how to get a KApplication objet.
Thanks.
RE: kapplication.h uh?
Use the qApp pointer. It has a quit() slot.
RE: kapplication.h uh?
The shutdown button is for the hole system not only for that app.
Well, the KApplication instance is created in your main() function.
After that you can always access it by using the static KApplication method
|
Source code
|
1
|
KApplication::kApplication()
|
Cheers,
_
Qt/KDE Developer
Debian User
still lost
I have seen the k_mnu.cpp code to see how they get it done. Here is the relative code... my question is... where did they get kapp from?
if (kapp->authorize("logout"))
insertItem(SmallIconSet("exit"), i18n("Logout \"%1\"...").arg(username), this, SLOT(slotLogout()));
void PanelKMenu::slotLogout()
{
QApplication::syncX();
kapp->requestShutDown();
}
RE: still lost
kapp is a global macro defined in <kapplication.h>
David Faure, KDE developer, Klaralvdalens-Datakonsult AB.