BluezQt

declarativebattery.cpp
1/*
2 * BluezQt - Asynchronous BlueZ wrapper library
3 *
4 * SPDX-FileCopyrightText: 2019 Kai Uwe Broulik <kde@broulik.de>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#include "declarativebattery.h"
10
11DeclarativeBattery::DeclarativeBattery(const BluezQt::BatteryPtr &battery, QObject *parent)
12 : QObject(parent)
13 , m_battery(battery)
14{
15 connect(m_battery.data(), &BluezQt::Battery::percentageChanged, this, &DeclarativeBattery::percentageChanged);
16}
17
18int DeclarativeBattery::percentage() const
19{
20 return m_battery->percentage();
21}
22
23#include "moc_declarativebattery.cpp"
void percentageChanged(int percentage)
Indicates that battery's percentage has changed.
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.