Button Class Reference
from PyKDE4.solid import *
Inherits: Solid.DeviceInterface → QObject
Namespace: Solid
Detailed Description
This device interface is available on button devices.
A button is a device, like power button or lid switch, that can be pressed by user. Some buttons can have two states (Enabled/Disabled, On/Off ...), other buttons haven't state.
Enumerations | |
ButtonType | { LidButton, PowerButton, SleepButton, UnknownButtonType } |
Signals | |
pressed (Solid.Button.ButtonType type, QString udi) | |
Methods | |
__init__ (self, QObject backendObject) | |
bool | hasState (self) |
pressed (self, Solid.Button.ButtonType type, QString udi) | |
bool | stateValue (self) |
Solid.Button.ButtonType | type (self) |
Static Methods | |
Solid.DeviceInterface.Type | deviceInterfaceType () |
Method Documentation
__init__ | ( | self, | ||
QObject | backendObject | |||
) |
Creates a new Button object. You generally won't need this. It's created when necessary using Device.as().
- Parameters:
-
backendObject the device interface object provided by the backend
- See also:
- Solid.Device.as()
Solid.DeviceInterface.Type deviceInterfaceType | ( | ) |
Get the Solid.DeviceInterface.Type of the Button device interface.
- Returns:
- the Button device interface type
- See also:
- Solid.DeviceInterface.Type
bool hasState | ( | self ) |
Indicates if the button mantains state (Can toggled on/off).
- Returns:
- true if the button maintains state, false otherwise.
- See also:
- stateValue()
pressed | ( | self, | ||
Solid.Button.ButtonType | type, | |||
QString | udi | |||
) |
This signal is emitted when the button is pressed.
- Parameters:
-
type the type of button device, it's one of the type Solid.Button.ButtonType
- See also:
- Solid.Button.ButtonType
- Parameters:
-
udi the UDI of the button
- Signal syntax:
QObject.connect(source, SIGNAL("pressed(ButtonType, const QString&)"), target_slot)
bool stateValue | ( | self ) |
Retrieves the state of the button. A button can have two states (Enabled/Disabled, On/Off ...). Available only if hasState is true.
- Returns:
- true if the button is enabled, false otherwise.
- See also:
- hasState()
Solid.Button.ButtonType type | ( | self ) |
Retrieves the type of button device.
- Returns:
- the type of button device.
- See also:
- Solid.Button.ButtonType
Enumeration Documentation
ButtonType |
This enum type defines the type of button.
- LidButton : The switch on a laptop that senses whether the lid is open or closed. - PowerButton : The main power button on the computer. - SleepButton : The sleep button on a computer capable of putting the computer into a suspend state. - UnknownButtonType : The type of the button is unknow.
- Enumerator:
-
LidButton PowerButton SleepButton UnknownButtonType