A button with an icon as visual representation. More...
Import Statement: | import Felgo 4.0 |
Since: | Felgo 2.7.0 |
Inherits: |
The IconButton is a special button type that shows an AppIcon as visual representation. It can be used with a default button behavior or as a toggle button (setting the toggle property to true
).
You can use the IconButton as a toggle like this:
IconButton { // Icon in default state iconType: IconType.hearto // Icon in selected state selectedIconType: IconType.heart toggle: true onToggled: { console.debug("Button toggled") } }
[since Felgo 4.2.0] activeColor : color |
The color to use in the active state when toggle is set to true
. Matches the selectedColor by
default.
This property was introduced in Felgo 4.2.0.
[since Felgo 4.2.0] activeIconType : string |
The icon from IconType to use in the active state when toggle is set to true
. Matches the selectedIconType be default.
This property was introduced in Felgo 4.2.0.
color : color |
The color to use for this button in default state. The default value is Theme::tintColor.
[since Felgo 2.12.0] disabledColor : color |
The color to use for this button when the button is disabled. The default value is Theme::disabledColor.
This property was introduced in Felgo 2.12.0.
iconType : string |
The icon from IconType to use for this button in default state.
Note: This property was renamed from icon
in Felgo 4.0.0. This is because many types already inherit a property AbstractButton::icon from Qt Quick Controls 2.
selected : bool |
The current toggle state of the button if toggle property is set to true
.
You can set this property from your own logic to set the initial state of the button.
selectedColor : color |
The color to use when the button is pressed. The default value is Theme::tintLightColor.
selectedIconType : string |
size : alias |
The size of the button's icon.
toggle : bool |
Whether the button acts as a toggle button or uses a default behavior. If set to true
the button has an explicit selected state.
By default this property is false
.
clicked() |
This signal is emitted when the button is clicked.
Note: The corresponding handler is onClicked
.
pressed() |
This signal is emitted when the button is pressed.
Note: The corresponding handler is onPressed
.
released() |
This signal is emitted when the button is released.
Note: The corresponding handler is onReleased
.
toggled() |
This signal is emitted when the button was toggled by user interaction if the toggle property is set to true
.
Note: The corresponding handler is onToggled
.