(Difference between revisions)
|
|
| Line 19: |
Line 19: |
| | ;''bool'' active | | ;''bool'' active |
| | :Stores if the button is clickable. | | :Stores if the button is clickable. |
| - |
| |
| - | =Private properties=
| |
| | ;''bool'' pressed | | ;''bool'' pressed |
| - | :Stores if the button is currently pressed. | + | :Stores if the button is currently pressed. Intended as read-only. |
| | | | |
| | =Signals= | | =Signals= |
Latest revision as of 12:13, 28 April 2011
Description
This is a button with released and pressed state images. Additionally icons for the pressed and released state can be set and which are show centered on the button.
API properties
- string icon
- Sets the default icon displayed on the button.
- string iconDown
- Sets the icon displayed on the button in pressed state.
- bool iconFill
- Determines wheather the icon should fill the button automatically
- alias iconFillMode
- The fillMode of the icon, default is Image.PreserveAspectFit
- bool hasBackground
- If true the properties bgSourceUp and bgSourceDown are used to render the background of the Iconbutton.
- string bgSourceUp
- Path to an image file used for released state.
- string bgSourceDn
- Path to an image file used for pressed state.
- bool active
- Stores if the button is clickable.
- bool pressed
- Stores if the button is currently pressed. Intended as read-only.
Signals
- clicked
- Emitted if the button is active and clicked.
- Parameter:
- variant mouse, contains mouse event data.
Functions
-
Example
IconButton {
id: myButton
icon: "myImage.png"
iconDown: "myImagePressed.png"
}