class KControlApplication

Common base for setup applications. More...

Definition#include <kcontrol.h>
InheritsKApplication (kdecore)
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Slots

Protected Members


Detailed Description

KControlApplication is the common base for setup applications.

It provides a tab dialog and functionality common to most setup programs.

 KControlApplication (int &argc, char **argv, const char *name=0)

Creates the setup application.

The constructor scans the command line arguments. If there is a single argument, "-init", the function init() is called and the application terminates. Otherwise the setup dialog is created and inkoved.

Parameters:
argcnumber of commandline arguments
argvcommandline arguments
namename of the application

void  setTitle (const char *title)

Sets the title of the dialog.

It's not possible to set the title within the constructor, because we need the application to get the translator and it would mean a lot of effort to do it without the one in kapp.

Parameters:
titletext to be shown in the dialogs titlebar

bool  runGUI ()

Determines if the setup dialog has to be run.

The setup dialog has to be run if the application has not been invoked with a single commandline argument containing "-init".

Due to the fact the QApplication::exec() is not virtual, this construction has to be used to execute a KControlApplication:

KControlApplication app(argc, argv, "name", "title"); app.createPages();

if (app.runGUI()) return app.exec(); else return 0;

Just running app.exec() will fail if "-init" has been requested.

void  init ()

[virtual slot]

This function is called at startup to initialize the settings.

This function must be overriden by all setup application that want to have persistent settings.

void  apply ()

[virtual slot]

This function is called to apply the settings currently selected in the dialog.

This function must be overriden by all setup applications.

void  help ()

[virtual slot]

This function is called when the help button is pressed.

The default behaviour is to call

kapp->invokeHTMLHelp("kcontrol/$(appname)/$(help_name).html","");

void  defaultValues ()

[virtual slot]

This function is called when the user presses the default button.

This function must be overriden by all setup application.