1 Star 0 Fork 7

kylinsoft-contributor/kylin-status-manager

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
devicerotationmanager.h 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
liling 提交于 2023-05-12 16:15 . Add:增加旋转管理模块
#ifndef _DEVICE_ROTATION_MANAGER_H
#define _DEVICE_ROTATION_MANAGER_H
#include <QObject>
#include <QOrientationSensor>
class QOrientationSensor;
class ConfigurationManager;
class DeviceRotationManager : public QObject {
Q_OBJECT
public:
explicit DeviceRotationManager(QObject *parent = nullptr);
~DeviceRotationManager() override;
bool isOrientationSensorAvailiable() const;
bool isAutoRotateEnabled() const;
QString getDeviceOrientation() const;
public slots:
bool setAutoRotateEnabled(bool autoRotateEnable, bool isPersistence = true);
bool setDeviceOrientation(QString orientation, bool force = false);
signals:
void autoRotateEnabledChange(bool enabled);
void orientationChanged(QString orientation);
private:
void connectAutoRotateSignal();
void initOrientationSensor();
QString enumConvertToString(QOrientationReading::Orientation orientation);
QOrientationReading::Orientation getSensorOrientation() const;
private:
bool m_orientationSensorAvailiable;
bool m_autoRotateEnable;
QString m_orientation;
ConfigurationManager *m_configuration = nullptr;
QOrientationSensor *m_orientationSensor = nullptr;
};
#endif
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kylinsoft-contributor/kylin-status-manager.git
git@gitee.com:kylinsoft-contributor/kylin-status-manager.git
kylinsoft-contributor
kylin-status-manager
kylin-status-manager
openkylin/yangtze

搜索帮助

0d507c66 1850385 C8b1a773 1850385