KPenButton Class Reference

[libkorigin Index] [libkorigin Heirarchy]


QPen selection button. More...

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

Inherits: QPushButton

Public Members

Protected Members

Protected Slots

Signals


Detailed Description

KDE (Q)Pen Selector Button.

This is a convenience class for the KDE Pen Selector Dialog, class KPenDialog. It shows a push button displaying the preselected pen. When clicked, executes the KPenDialog to let the user modify the pen.

Simplest use:

QPushButton* pen = new KPenButton(my_pen,this,"button_pen");

//...

my_pen = pen->pen();


KPenButton(QWidget* parent, const char* name = 0)

Construct a Button which triggers a KPenDialog. The default pen is a solid line, black, 1pt.

If you want to offer a preselected pen, use the other variant of the constructor, or use setPen().

Parameters:
name just like in QPushButton
parent just like in QPushButton

KPenButton(const QPen& deflt, QWidget* parent, const char* name = 0)

Construct a Button which triggers a KPenDialog. Use the specified pen as a preselection.

Parameters:
name just like in QPushButton
parent just like in QPushButton
deflt preselected pen

~KPenButton()

Destructor.

void setPen(const QPen& p)

Preselect a pen. This selects the specified pen as the current pen. The button is updated, the newly set pen shown. A changed() signal is emitted.

QPen pen()

Returns the currently selected pen.

void drawButtonLabel(QPainter* p)

Re-implemented draw function for the buttonīs content. This function draws the penImage() of the current pen into the painter and thus into the button.

void slotClicked()

Connected to the QPushButtons signal. This function actually invokes the KPenDialog.

void changed(const QPen&)

Emitted when the pen is changed (via setPen() or dialog).


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