ImageButton Class Reference
A simple class for icon button.
More...
#include <imagebutton.h>
List of all members.
Public Member Functions |
| ImageButton (QWidget *parent=0, QString normalIconPictureFileName="", QString selectedIconPictureFileName="") |
| Constructor.
|
void | setButtonIcon (const QPixmap &image) |
| Set button icon.
|
void | setMode (QIcon::Mode mode) |
| Sets the button icon mode.
|
QIcon::Mode | mode () |
| Returns the current button icon mode.
|
Protected Member Functions |
void | mousePressEvent (QMouseEvent *event) |
| Event handler for mouse press events.
|
void | mouseReleaseEvent (QMouseEvent *event) |
| Event handler for mouse release events.
|
void | paintEvent (QPaintEvent *event) |
| Event handler for paint events.
|
Protected Attributes |
QIcon::Mode | m_buttonMode |
| Button mode (Normal, Selected etc...).
|
Private Member Functions |
void | initButton (const QSize &size, const QIcon &icon) |
| Initializes the button by setting graphics and alpha mask.
|
Detailed Description
A simple class for icon button.
- Author:
- Pekka Nissinen - pekka.nissinen (at) ixonos.com
Constructor & Destructor Documentation
ImageButton::ImageButton |
( |
QWidget * |
parent = 0 , |
|
|
QString |
normalIconPictureFileName = "" , |
|
|
QString |
selectedIconPictureFileName = "" | |
|
) |
| | |
Constructor.
- Parameters:
-
| parent | Parent |
| normalIconPictureFileName | Normal state icon image file name |
| selectedIconPictureFileName | Selected state icon image file name (optional) |
Member Function Documentation
void ImageButton::initButton |
( |
const QSize & |
size, |
|
|
const QIcon & |
icon | |
|
) |
| | [private] |
Initializes the button by setting graphics and alpha mask.
- Parameters:
-
| size | Size of the button icon |
| icon | Image icon |
QIcon::Mode ImageButton::mode |
( |
|
) |
|
Returns the current button icon mode.
- Returns:
- Button icon mode
void ImageButton::mousePressEvent |
( |
QMouseEvent * |
event |
) |
[protected] |
Event handler for mouse press events.
- Parameters:
-
Reimplemented in ZoomButton.
void ImageButton::mouseReleaseEvent |
( |
QMouseEvent * |
event |
) |
[protected] |
Event handler for mouse release events.
- Parameters:
-
void ImageButton::paintEvent |
( |
QPaintEvent * |
event |
) |
[protected] |
Event handler for paint events.
Paints the button and its icon
- Parameters:
-
void ImageButton::setButtonIcon |
( |
const QPixmap & |
image |
) |
|
Set button icon.
- Parameters:
-
void ImageButton::setMode |
( |
QIcon::Mode |
mode |
) |
|
Sets the button icon mode.
- Parameters:
-
The documentation for this class was generated from the following files: