mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2026-02-23 03:33:57 +11:00
all: use fully qualified type names in Q_PROPERTY
Fixes type deduction issues with qmllint/qmlls.
This commit is contained in:
parent
a931adf033
commit
746b0e70d7
14 changed files with 52 additions and 40 deletions
|
|
@ -53,15 +53,17 @@ class UPowerQml: public QObject {
|
|||
Q_OBJECT;
|
||||
QML_NAMED_ELEMENT(UPower);
|
||||
QML_SINGLETON;
|
||||
// clang-format off
|
||||
/// UPower's DisplayDevice for your system. Can be `null`.
|
||||
///
|
||||
/// This is an aggregate device and not a physical one, meaning you will not find it in @@devices.
|
||||
/// It is typically the device that is used for displaying information in desktop environments.
|
||||
Q_PROPERTY(UPowerDevice* displayDevice READ displayDevice NOTIFY displayDeviceChanged);
|
||||
Q_PROPERTY(qs::service::upower::UPowerDevice* displayDevice READ displayDevice NOTIFY displayDeviceChanged);
|
||||
/// All connected UPower devices.
|
||||
Q_PROPERTY(ObjectModel<UPowerDevice>* devices READ devices CONSTANT);
|
||||
Q_PROPERTY(ObjectModel<qs::service::upower::UPowerDevice>* devices READ devices CONSTANT);
|
||||
/// If the system is currently running on battery power, or discharging.
|
||||
Q_PROPERTY(bool onBattery READ onBattery NOTIFY onBatteryChanged);
|
||||
// clang-format on
|
||||
|
||||
public:
|
||||
explicit UPowerQml(QObject* parent = nullptr);
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class UPowerDevice: public QObject {
|
|||
Q_OBJECT;
|
||||
// clang-format off
|
||||
/// The type of device.
|
||||
Q_PROPERTY(UPowerDeviceType::Enum type READ type NOTIFY typeChanged);
|
||||
Q_PROPERTY(qs::service::upower::UPowerDeviceType::Enum type READ type NOTIFY typeChanged);
|
||||
/// If the device is a power supply for your computer and can provide charge.
|
||||
Q_PROPERTY(bool powerSupply READ powerSupply NOTIFY powerSupplyChanged);
|
||||
/// Current energy level of the device in watt-hours.
|
||||
|
|
@ -111,7 +111,7 @@ class UPowerDevice: public QObject {
|
|||
/// If the device `type` is not `Battery`, then the property will be invalid.
|
||||
Q_PROPERTY(bool isPresent READ isPresent NOTIFY isPresentChanged);
|
||||
/// Current state of the device.
|
||||
Q_PROPERTY(UPowerDeviceState::Enum state READ state NOTIFY stateChanged);
|
||||
Q_PROPERTY(qs::service::upower::UPowerDeviceState::Enum state READ state NOTIFY stateChanged);
|
||||
/// Health of the device as a percentage of its original health.
|
||||
Q_PROPERTY(qreal healthPercentage READ healthPercentage NOTIFY healthPercentageChanged);
|
||||
Q_PROPERTY(bool healthSupported READ healthSupported NOTIFY healthSupportedChanged);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue