KControlApplication Class Reference

[kdeui Index] [kdeui Hierarchy] [Headers]


Common base for setup applications. More...

#include <kcontrol.h>

Inherits: KApplication (kdecore)

Public Members

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) [public]

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:
argv commandline arguments
name name of the application
argc number of commandline arguments

~KControlApplication() [public]

Destructor. Cleans up.

void setTitle(const char *title) [public]

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:
title text to be shown in the dialogs titlebar

bool runGUI() [public]

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.

QTabDialog* getDialog() [public]

Returns the tabbed dialog object.

QStrList* getPageList() [public]

Returns the list of pages to show.

void addPage(QWidget *page, const QString &name, const QString &help_name) [public]

Adds a new page to the dialog.

void init() [public slot virtual]

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() [public slot virtual]

This function is called to apply the settings currently selected in the dialog. This function must be overriden by all setup applications.

void help() [public slot virtual]

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() [public slot virtual]

This function is called when the user presses the default button. This function must be overriden by all setup application.


  • Author: Matthias H"olzer (hoelzer@physik.uni-wuerzburg.de)
  • Documentation generated by tasin@cd1 on Die Nov 30 17:31:44 CET 1999
Kdoc