KPenDialog Class Reference

[libkorigin Index] [libkorigin Heirarchy]


QPen selection dialog. More...

#include </home/mh/korigin/korigin/doc/tmp/kpen.h>

Inherits: QDialog

Public Members

Signals


Detailed Description

KDE (Q)Pen Selector Dialog.

Features style selection, color selection, width selection, pen preview, least recent pen history.

When the user clicks okay, the then selected pen is appended to the least recent pen list. The least recent pen list will not duplicate pens in the list. Up to eight pens are remembered.

Simplest use:

QPen pen = KPenDialog::selectPen();

See class KPenButton for a button for pen selection.


KPenDialog(QWidget* parent = 0, const char* name = 0, const char* title = "Select Pen")

Construct a KPenDialog. The parameters parent and name resemble a standard QDialog. The third parameter, title, defines the caption of the dialog.

The KPenDialog by default offers a black pen, width zero, no line. If this is inapprotriate, use setPen() to preselect a different pen.

To show and execute the dialog, just call the (inherited) function exec().

~KPenDialog()

Shut down a KPenDialog. Just an ordinary destructor.

QPen pen()

Get current pen.

Returns:
the current pen

void setPen(const QPen& pen)

Preselect a pen. This defines the specified pen to be the default pen.

static QPen selectPen()

Let the user select a pen and return it. This is probably what you´re looking for. It displays the dialog and returns the selected pen. Preselected pen is the least recent pen. If you want a special pen to be preselected, just pass it as an argument.

When the user clicks okay, the then selected pen is appended to the least recent pen list.

static QPen selectPen(const QPen& predef)

Let the user manipulate/select a pen and return it. This is probably what you´re looking for. It displays the dialog and returns the selected pen. Preselected pen is the pen passed as the argument. If the user cancels the dialog, the predefined pen is returned. If you want an "empty" pen (i.e. a Qt default pen), omit the parameter.

When the user clicks okay, the then selected pen is appended to the least recent pen list.

Parameters:
predef the pen to use as default

static QPixmap penImage(int width, int height, const QPen& pen)

Produce an return a QPixmap demonstrating the specified pen. The pixmap is meant to show the user what kind of lines the selected pen will draw.

Parameters:
width the proposed width of the pixmap
height the proposed height of the pixmap
pen the pen to use for the pixmap

void pressedOK()

Emitted when the OK button is pressed.

void pressedCancel()

Emitted when the Cancel button is pressed.

void pressedHelp()

Emitted when the Help button is pressed.


  • Author: Patrick Schemitz
  • Version: build 980206
  • Documentation generated by mh@jeff_clever on Thu Feb 5 14:15:25 MET 1998
Kdoc