QtSvgButton Class Reference

The QtSvgButton class provides a Button, that can change the display style. More...

#include <qtsvgbutton.h>

List of all members.

Public Member Functions

 QtSvgButton (QWidget *parent=0)
 ~QtSvgButton ()
void setSkin (const QString &skin)
QString skin () const
virtual QSize sizeHint () const

Protected Member Functions

virtual void paintEvent (QPaintEvent *event)

Properties

QString skin

Detailed Description

The QtSvgButton class provides a Button, that can change the display style.

The description of the QtSvgButton.

The QtSvgButton is an example to show the capabilities of the Qt Framework related to customized controls.

Here is a possible implementation shown

        // Create a QtSvgButton
        QWidget * widget = new QWidget(this)
        QtSvgButton * button = new QtSvgButton(widget);
        butten->setSkin("Beryl");
        widget->addWidget(button);
        widget->show();

It is important to call the function setSkin() to load a skin. If setSkin() is not called the Button will not have any visible content. The parameter skin has the skin name. The skins are in the resource file defined in the project file. The name scheme in the resource file is "Skin Name"/"unique picture name.svg".

The setSkin() function loads the diffrent skins over the "Skin name". The needed realised graphics for this control are "normal.svg", "hovered.svg" and "pressed.svg". If you want to add new skins, they have to follow the name scheme to work.

The actual skin can be read over the skin() function.

See also:
skin(), setSkin()

No Signals are defined.

No Slots are defined.


Constructor & Destructor Documentation

QtSvgButton::QtSvgButton ( QWidget *  parent = 0  )  [explicit]

Constructor of the QtSvgButton. The parent object holds the Parent of the Widget.

QtSvgButton::~QtSvgButton (  ) 

Destructor


Member Function Documentation

void QtSvgButton::paintEvent ( QPaintEvent *  event  )  [protected, virtual]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Overloaded paint event. In this function is the set skin painted.

See also:
setSkin(), skin()
void QtSvgButton::setSkin ( const QString &  skin  ) 

With this function you can set the skin that will be displayed in the widget.

        QtSvgButton * button = new QtSvgButton(this);
        button->setSkin("Beryl");

This function has to be called before using the QSvgButton.

See also:
skin()
QSize QtSvgButton::sizeHint (  )  const [virtual]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Return size hint provided by the SVG graphics. Can be changed during runtime.


Property Documentation

QString QtSvgButton::skin [read, write]

This function returns the actual skin name. If no skin has been set the return value is "".

        QtSvgButton * button = new QtSvgButton(this);
        button->setSkin("Beryl");
        qDebug() << button->skin();
See also:
setSkin()

The documentation for this class was generated from the following files:

Generated on Wed Nov 25 17:57:34 2009 for Embedded Widgets by  doxygen 1.6.1