kdeui Library API Documentation

KAboutDialog Class Reference

A KDialogBase with predefined main widget. More...

#include <kaboutdialog.h>

Inheritance diagram for KAboutDialog:

Inheritance graph
[legend]
Collaboration diagram for KAboutDialog:

Collaboration graph
[legend]
List of all members.

Public Types

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
}

Signals

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

Public Member Functions

 KAboutDialog (QWidget *parent=0, const char *name=0, bool modal=true)
 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)
void adjust ()
virtual void show (void)
virtual void show (QWidget *centerParent)
void setTitle (const QString &title)
void setImage (const QString &fileName)
void setIcon (const QString &fileName) KDE_DEPRECATED
void setProgramLogo (const QString &fileName)
void setProgramLogo (const QPixmap &pixmap)
void setImageBackgroundColor (const QColor &color)
void setImageFrame (bool state)
void setProduct (const QString &appName, const QString &version, const QString &author, const QString &year)
QFrameaddTextPage (const QString &title, const QString &text, bool richText=false, int numLines=10)
QFrameaddLicensePage (const QString &title, const QString &text, int numLines=10)
KAboutContaineraddContainerPage (const QString &title, int childAlignment=AlignCenter, int innerAlignment=AlignCenter)
KAboutContaineraddScrolledContainerPage (const QString &title, int childAlignment=AlignCenter, int innerAlignment=AlignCenter)
KAboutContaineraddContainer (int childAlignment, int innerAlignment)
QFrameaddPage (const QString &title)
void setLogo (const QPixmap &)
void setAuthor (const QString &name, const QString &email, const QString &url, const QString &work)
void setMaintainer (const QString &name, const QString &email, const QString &url, const QString &work)
void addContributor (const QString &name, const QString &email, const QString &url, const QString &work)
void setVersion (const QString &name)

Static Public Member Functions

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

Protected Slots

void sendEmailSlot (const QString &name, const QString &email)
void openURLSlot (const QString &url)
virtual void mouseTrackSlot (int mode, const QMouseEvent *e)

Protected Member Functions

virtual void virtual_hook (int id, void *data)

Protected Attributes

KAboutWidgetabout
KAboutContainerBasemContainerBase

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.

Author:
Mirko Boehm (mirko@kde.org) and Espen Sand (espensa@online.no)
See also:
KDialogBase

Definition at line 283 of file kaboutdialog.h.


Member Enumeration Documentation

enum KAboutDialog::LayoutType
 

Layout formats.

Definition at line 291 of file kaboutdialog.h.


Constructor & Destructor Documentation

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

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.

Definition at line 1511 of file kaboutdialog.cpp.

References about, kdDebug(), openURL(), openURLSlot(), sendEmail(), sendEmailSlot(), and KDialogBase::setMainWidget().

KAboutDialog::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
 

The extended constructor.

(Constructor II).

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

Parameters:
dialogLayout Use a mask of LayoutType flags.
caption The dialog caption. The text you specify is prepended by i18n("About").
buttonMask Specifies what buttons will be visible.
defaultButton Specifies what button will be marked as the default.
parent Parent of the dialog.
name Dialog name (for internal use only)
modal Sets dialog modality. If false, the rest of the program interface (other dialogs, for example) is accessible while the dialog is open.
separator If true, a separator line is drawn between the action buttons an the main widget.
user1 User button1 text.
user2 User button2 text.
user3 User button3 text.

Definition at line 1531 of file kaboutdialog.cpp.

References mContainerBase, mouseTrackSlot(), openURLSlot(), sendEmailSlot(), KDialogBase::setMainWidget(), and KDialog::setPlainCaption().


Member Function Documentation

void KAboutDialog::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.

Definition at line 1570 of file kaboutdialog.cpp.

References about, and KAboutWidget::adjust().

Referenced by show().

void KAboutDialog::show void   )  [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.

Definition at line 1554 of file kaboutdialog.cpp.

References adjust(), mContainerBase, and KAboutContainerBase::show().

Referenced by KHelpMenu::aboutKDE().

void KAboutDialog::show QWidget centerParent  )  [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:
centerParent Center the dialog with respect to this widget.

Definition at line 1562 of file kaboutdialog.cpp.

References adjust(), mContainerBase, and KAboutContainerBase::show().

void KAboutDialog::setTitle const QString title  ) 
 

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

Parameters:
title Title string.

Definition at line 1696 of file kaboutdialog.cpp.

References mContainerBase, and KAboutContainerBase::setTitle().

Referenced by KAboutKDE::KAboutKDE().

void KAboutDialog::setImage const QString fileName  ) 
 

(Constructor II only) Define an image to be shown in the dialog.

The position is dependent on the dialogLayout in the constructor

Parameters:
fileName Path to image file.

Definition at line 1703 of file kaboutdialog.cpp.

References mContainerBase, and KAboutContainerBase::setImage().

Referenced by imageURL(), and KAboutKDE::KAboutKDE().

void KAboutDialog::setIcon const QString fileName  ) 
 

(Constructor II only) Define the program logo to be shown in the dialog.

Use this to override the default program logo. For example, use this function if the KAboutDialog is for a panel applet and you want to override the appletproxy logo with your own pixmap.

Parameters:
fileName Path to file containing logo data in a format that can be loaded by QPixmap.
Since:
3.3

Definition at line 1710 of file kaboutdialog.cpp.

References mContainerBase, and KAboutContainerBase::setProgramLogo().

void KAboutDialog::setProgramLogo const QString fileName  ) 
 

Overloaded version of setProgramLogo(const QPixmap& pixmap).

Since:
3.4

Definition at line 1716 of file kaboutdialog.cpp.

References mContainerBase, and KAboutContainerBase::setProgramLogo().

void KAboutDialog::setProgramLogo const QPixmap pixmap  ) 
 

(Constructor II only) Define the program logo to be shown in the dialog.

Use this to override the default program logo. For example, use this function if the KAboutDialog is for a panel applet and you want to override the appletproxy logo with your own pixmap.

Parameters:
pixmap The logo pixmap.
Since:
3.4

Definition at line 1722 of file kaboutdialog.cpp.

References mContainerBase, and KAboutContainerBase::setProgramLogo().

void KAboutDialog::setImageBackgroundColor const QColor color  ) 
 

(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:
color Background color.

Definition at line 1728 of file kaboutdialog.cpp.

References mContainerBase, and KAboutContainerBase::setImageBackgroundColor().

Referenced by imageURL(), and KAboutKDE::KAboutKDE().

void KAboutDialog::setImageFrame bool  state  ) 
 

(Constructor II only) Enables or disables a frame around the image.

The frame is, by default, enabled in the constructor

Parameters:
state A value of true enables the frame

Definition at line 1735 of file kaboutdialog.cpp.

References mContainerBase, and KAboutContainerBase::setImageFrame().

void KAboutDialog::setProduct const QString appName,
const QString version,
const QString author,
const QString year
 

(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:
appName The application name.
version Application version.
author One or more authors.
year A string telling when the application was made.

Definition at line 1742 of file kaboutdialog.cpp.

References mContainerBase, and KAboutContainerBase::setProduct().

QFrame * KAboutDialog::addTextPage const QString title,
const QString text,
bool  richText = false,
int  numLines = 10
 

(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:
title Tab name.
text The text to display.
richText Set this to true if 'text' is rich text.
numLines The 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.

Definition at line 1647 of file kaboutdialog.cpp.

References KAboutContainerBase::addTextPage(), and mContainerBase.

Referenced by KAboutKDE::KAboutKDE().

QFrame * KAboutDialog::addLicensePage const QString title,
const QString text,
int  numLines = 10
 

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

Parameters:
title Tab name.
text The text to display.
numLines The 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.

Definition at line 1654 of file kaboutdialog.cpp.

References KAboutContainerBase::addLicensePage(), and mContainerBase.

KAboutContainer * KAboutDialog::addContainerPage const QString title,
int  childAlignment = AlignCenter,
int  innerAlignment = AlignCenter
 

(Constructor II only) Adds a container to a tab box.

You can add text and images to a container.

Parameters:
title Tab name.
childAlignment Specifies how the children of the container are aligned with respect to the container.
innerAlignment Specifies how the children are aligned with respect to each other.
Returns:
The new container.

Definition at line 1662 of file kaboutdialog.cpp.

References KAboutContainerBase::addContainerPage(), and mContainerBase.

KAboutContainer * KAboutDialog::addScrolledContainerPage const QString title,
int  childAlignment = AlignCenter,
int  innerAlignment = AlignCenter
 

(Constructor II only) Adds a container inside a QScrollView to a tab box.

You can add text and images to a container.

Parameters:
title Tab name.
childAlignment Specifies how the children of the container are aligned with respect to the container.
innerAlignment Specifies how the children are aligned with respect to each other.
Returns:
The new container.

Definition at line 1671 of file kaboutdialog.cpp.

References KAboutContainerBase::addScrolledContainerPage(), and mContainerBase.

KAboutContainer * KAboutDialog::addContainer int  childAlignment,
int  innerAlignment
 

(Constructor II only) Adds a container.

You can add text and images to a container.

Parameters:
childAlignment Specifies how the children of the container are aligned with respect to the container.
innerAlignment Specifies how the children are aligned with respect to each other.
Returns:
The new container.

Definition at line 1688 of file kaboutdialog.cpp.

References KAboutContainerBase::addContainer(), and mContainerBase.

Referenced by imageURL().

QFrame * KAboutDialog::addPage const QString title  ) 
 

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

Parameters:
title Tab name
Returns:
The new page.

Definition at line 1681 of file kaboutdialog.cpp.

References KAboutContainerBase::addEmptyPage(), and mContainerBase.

void KAboutDialog::setLogo const QPixmap  ) 
 

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

Definition at line 1579 of file kaboutdialog.cpp.

References about, and KAboutWidget::setLogo().

void KAboutDialog::setAuthor const QString name,
const QString email,
const QString url,
const QString work
 

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

Definition at line 1595 of file kaboutdialog.cpp.

References about, and KAboutWidget::setAuthor().

void KAboutDialog::setMaintainer const QString name,
const QString email,
const QString url,
const QString work
 

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

Definition at line 1586 of file kaboutdialog.cpp.

References about, and KAboutWidget::setMaintainer().

void KAboutDialog::addContributor const QString name,
const QString email,
const QString url,
const QString work
 

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

Definition at line 1604 of file kaboutdialog.cpp.

References about, and KAboutWidget::addContributor().

void KAboutDialog::setVersion const QString name  ) 
 

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

Definition at line 1613 of file kaboutdialog.cpp.

References about, and KAboutWidget::setVersion().

void KAboutDialog::imageURL QWidget parent,
const QString caption,
const QString path,
const QColor imageColor,
const QString url
[static]
 

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

Definition at line 1751 of file kaboutdialog.cpp.

References addContainer(), KAboutContainer::addPerson(), setImage(), setImageBackgroundColor(), and KDialog::setPlainCaption().

void KAboutDialog::sendEmail const QString name,
const QString email
[signal]
 

Send an email to this person.

The application must provide the functionality.

Referenced by KAboutDialog().

void KAboutDialog::openURL const QString url  )  [signal]
 

Open the selected URL.

Referenced by KAboutDialog().

void KAboutDialog::sendEmailSlot const QString name,
const QString email
[protected, slot]
 

Connected to widget->sendEmail.

Definition at line 1621 of file kaboutdialog.cpp.

Referenced by KAboutDialog().

void KAboutDialog::openURLSlot const QString url  )  [protected, slot]
 

Open this URL.

Definition at line 1632 of file kaboutdialog.cpp.

Referenced by KAboutDialog().

void KAboutDialog::mouseTrackSlot int  mode,
const QMouseEvent e
[protected, virtual, slot]
 

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

Definition at line 1641 of file kaboutdialog.cpp.

Referenced by KAboutDialog().


Member Data Documentation

KAboutWidget* KAboutDialog::about [protected]
 

The main widget (Constructor I).

Definition at line 599 of file kaboutdialog.h.

Referenced by addContributor(), adjust(), KAboutDialog(), setAuthor(), setLogo(), setMaintainer(), and setVersion().

KAboutContainerBase* KAboutDialog::mContainerBase [protected]
 

The main widget (Constructor II).

Definition at line 604 of file kaboutdialog.h.

Referenced by addContainer(), addContainerPage(), addLicensePage(), addPage(), addScrolledContainerPage(), addTextPage(), KAboutDialog(), setIcon(), setImage(), setImageBackgroundColor(), setImageFrame(), setProduct(), setProgramLogo(), setTitle(), and show().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdeui Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Apr 22 16:01:47 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003