class KAboutDialog

A KDialogBase with predefined main widget. More...

Definition#include <kaboutdialog.h>
InheritsKDialogBase [public ]
Inherited byKAboutApplication, KAboutKDE
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Signals

Public Static Methods

Protected Methods

Protected Slots

Protected Members


Detailed Description

A KDialogBase with predefined main widget.

As a KDialogBase it uses your application wide settings for KDialogBase objects (base frame tiles, main frame tiles etc). To use it, simply create a KAboutDialog object, set all (or some) of its properties and show it. Do not derive it to create your own about dialog until you need some cool features that are unsupported and you have contacted me to add them.

The dialog can be created using two different constructors. The difference between these constructors is the available components that can be used to build the contents of the dialog. The first (Constructor I) provides a number of easy to use methods. Basically it allows you to add the components of choice, and the components are placed in a predefined layout. You do not have to plan the layout. Everything is taken care of.

The second constructor (Constructor II) works in quite the same manner as the first, but you have better control on where the components are postioned in the layout and you have access to an extended number of components you can install such as titles, product information, a tabbed pages (where you can display rich text with url links) and a person (developer) information field. The "About KDE" dialog box is created with Constructor II.

For the derived features, see the basic class KDialogBase.

See also: KDialogBase

enum LayoutType { AbtPlain = 0x0001, AbtTabbed = 0x0002, AbtTitle = 0x0004, AbtImageLeft = 0x0008, AbtImageRight = 0x0010, AbtImageOnly = 0x0020, AbtProduct = 0x0040, AbtKDEStandard = AbtTabbed|AbtTitle|AbtImageLeft, AbtAppStandard = AbtTabbed|AbtTitle|AbtProduct, AbtImageAndTitle = AbtPlain|AbtTitle|AbtImageOnly }

LayoutType

Layout formats.

 KAboutDialog ( QWidget *parent=0, const char *name=0, bool modal=true )

KAboutDialog

The standard Qt constructor (Constructor I).

Add components with the following methods: setLogo(), setAuthor(), setMaintainer(), addContributor(), or setVersion(). The dialog will be laid out automatically.

 KAboutDialog ( int dialogLayout, const QString &caption, int buttonMask, ButtonCode defaultButton, QWidget *parent=0, const char *name=0, bool modal=false, bool separator = false, const QString &user1 = QString::null, const QString &user2 = QString::null, const QString &user3 = QString::null )

KAboutDialog

The extended constructor. (Constructor II).

Add components with the methods: setTitle(), setImage(), setImageBackgroundColor(), setImageFrame(), setProduct(), addTextPage(), addContainerPage(), addContainer(), or addPage().

Parameters:
dialogLayoutUse a mask of LayoutType flags.
captionThe dialog caption. The text you specify is prepended by i18n("About").
buttonMaskSpecifies what buttons will be visible.
defaultButtonSpecifies what button will be marked as the default.
parentParent of the dialog.
nameDialog name (for internal use only)
modalSets dialog modality. If false, the rest of the program interface (other dialogs, for example) is accessible while the dialog is open.
separatorIf true, a separator line is drawn between the action buttons an the main widget.
user1User button1 text.
user2User button2 text.
user3User button3 text.

void  adjust ()

adjust

Adjusts the dialog.

You can call this method after you have set up all the contents but it is not required. It is done automatically when show() is executed.

void  show ( void )

show

[virtual]

Makes a modeless (modal = false in constructor) dialog visible.

If you reimplement this method make sure you run it in the new method (e.g., show()). Reimplemented from KDialogBase.

void  show ( QWidget *centerParent )

show

[virtual]

Makes a modeless (modal = false in constructor) dialog visible.

If you reimplmement this method make sure you run it in the new method (i.e., show( parent )).

Parameters:
centerParentCenter the dialog with respect to this widget.

void  setTitle ( const QString &title )

setTitle

(Constructor II only) Sets a title (not caption) in the uppermost area of the dialog.

Parameters:
titleTitle string.

void  setImage ( const QString &fileName )

setImage

(Constructor II only) Define an image to be shown in the dialog. The position is dependent on the dialogLayout in the constructor

Parameters:
fileNamePath to image file.

void  setImageBackgroundColor ( const QColor &color )

setImageBackgroundColor

(Constructor II only) The image has a minimum size, but is centered within an area if the dialog box is enlarged by the user. You set the background color of the area with this method.

Parameters:
colorBackground color.

void  setImageFrame ( bool state )

setImageFrame

(Constructor II only) Enables or disables a frame around the image. The frame is, by default, enabled in the constructor

Parameters:
stateA value of true enables the frame

void  setProduct ( const QString &appName, const QString &version, const QString &author, const QString &year )

setProduct

(Constructor II only) Prints the application name, KDE version, author, a copyright sign and a year string. To the left of the text the standard application icon is displayed.

Parameters:
appNameThe application name.
versionApplication version.
authorOne or more authors.
yearA string telling when the application was made.

QFrameaddTextPage ( const QString &title, const QString &text, bool richText=false, int numLines=10 )

addTextPage

(Constructor II only) Adds a text page to a tab box. The text can be regular text or rich text. The rich text can contain URLs and mail links.

Parameters:
titleTab name.
textThe text to display.
richTextSet this to true if 'text' is rich text.
numLinesThe text area height will be adjusted so that this is the minimum number of lines of text that are visible.

Returns: The frame that contains the page.

QFrameaddLicensePage ( const QString &title, const QString &text, int numLines=10 )

addLicensePage

(Constructor II only) Adds a license page to a tab box.

Parameters:
titleTab name.
textThe text to display.
numLinesThe text area height will be adjusted so that this is the minimum number of lines of text that are visible.

Returns: The frame that contains the page.

KAboutContaineraddContainerPage ( const QString &title, int childAlignment = AlignCenter, int innerAlignment = AlignCenter )

addContainerPage

(Constructor II only) Adds a container to a tab box. You can add text and images to a container.

Parameters:
titleTab name.
childAlignmentSpecifies how the children of the container are aligned with respect to the container.
innerAlignmentSpecifies how the children are aligned with respect to each other.

Returns: The new container.

KAboutContaineraddScrolledContainerPage ( const QString &title, int childAlignment = AlignCenter, int innerAlignment = AlignCenter )

addScrolledContainerPage

(Constructor II only) Adds a container inside a QScrollView to a tab box. You can add text and images to a container.

Parameters:
titleTab name.
childAlignmentSpecifies how the children of the container are aligned with respect to the container.
innerAlignmentSpecifies how the children are aligned with respect to each other.

Returns: The new container.

KAboutContaineraddContainer ( int childAlignment, int innerAlignment )

addContainer

(Constructor II only) Adds a container. You can add text and images to a container.

Parameters:
childAlignmentSpecifies how the children of the container are aligned with respect to the container.
innerAlignmentSpecifies how the children are aligned with respect to each other.

Returns: The new container.

QFrameaddPage ( const QString &title )

addPage

(Constructor II only) Adds an empty page to a tab box.

Parameters:
titleTab name

Returns: The new page.

Reimplemented from KDialogBase.

void  setLogo (const QPixmap&)

setLogo

(Constructor I only) Sets the image as the application logo.

void  setAuthor (const QString& name, const QString& email, const QString& url, const QString& work)

setAuthor

(Constructor I only) Sets the author's name and email address.

void  setMaintainer (const QString& name, const QString& email, const QString& url, const QString& work)

setMaintainer

(Constructor I only) Sets the maintainer's name and email address.

void  addContributor (const QString& name, const QString& email, const QString& url, const QString& work)

addContributor

(Constructor I only) Show this person as one of the major contributors.

void  setVersion (const QString& name)

setVersion

(Constructor I only) Sets the text describing the version.

void  imageURL ( QWidget *parent, const QString &caption, const QString &path, const QColor &imageColor, const QString &url )

imageURL

[static]

Create a modal dialog with an image in the upper area with a URL link below.

void  sendEmail (const QString& name, const QString& email)

sendEmail

[signal]

Send an email to this person.

The application must provide the functionality.

void  openURL (const QString& url)

openURL

[signal]

Open the selected URL.

KAboutWidget * about

about

[protected]

KAboutContainerBase * mContainerBase

mContainerBase

[protected]

void  sendEmailSlot (const QString& name, const QString& email)

sendEmailSlot

[protected slots slot]

Connected to widget->sendEmail.

void  openURLSlot (const QString& url)

openURLSlot

[protected slots slot]

Open this URL.

void  mouseTrackSlot ( int mode, const QMouseEvent *e )

mouseTrackSlot

[protected slots virtual slot]

(Constructor II only) Tells the position of the mouse cursor when the left mouse button is pressed above an image

void  virtual_hook ( int id, void* data )

virtual_hook

[protected virtual]

Reimplemented from KDialogBase.