qskinny/src/controls/QskLevelingSensor.h

45 lines
1.4 KiB
C
Raw Normal View History

2023-07-10 13:54:53 +00:00
#pragma once
#include <QskControl.h>
2023-07-24 08:56:26 +00:00
#include <memory>
2023-07-10 13:54:53 +00:00
2023-07-24 08:56:26 +00:00
class QskScaleTickmarks;
2023-07-20 10:01:16 +00:00
2023-07-17 09:14:43 +00:00
class QSK_EXPORT QskLevelingSensor : public QskControl
2023-07-10 13:54:53 +00:00
{
Q_OBJECT
2023-07-24 08:56:26 +00:00
using Inherited = QskControl;
public:
QSK_SUBCONTROLS( OuterDisk, Horizon, TickmarksX, TickmarksXLabels, TickmarksY, TickmarksYLabels,
TickmarksZ, TickmarksZLabels )
using Tickmarks = QskScaleTickmarks;
using TickmarksLabels = QVector< QPair< qreal, QString > >;
2023-07-20 10:01:16 +00:00
2023-07-24 08:56:26 +00:00
explicit QskLevelingSensor( QQuickItem* parent = nullptr );
~QskLevelingSensor();
2023-07-20 10:01:16 +00:00
2023-07-24 08:56:26 +00:00
public Q_SLOTS:
void setTickmarks( Qt::Axis axis, Tickmarks tickmarks );
void setTickmarksLabels( Qt::Axis axis, TickmarksLabels labels );
void setAngle( const QVector3D& degree );
void setAngle( Qt::Axis axis, float degree );
2023-07-20 10:01:16 +00:00
2023-07-24 08:56:26 +00:00
void setSubControlRotation( QskAspect::Subcontrol subControl, const QVector3D& degree );
Q_SIGNALS:
void anglesChanged( const QVector3D& degree );
void subControlRotationChanged( QskAspect::Subcontrol subControl, const QVector3D& degree );
public:
Q_REQUIRED_RESULT const Tickmarks& tickmarks( Qt::Axis axis ) const;
Q_REQUIRED_RESULT const TickmarksLabels& tickmarkLabels( Qt::Axis axis ) const;
Q_REQUIRED_RESULT const QVector3D& angle() const noexcept;
Q_REQUIRED_RESULT const QVector3D& subControlRotation(
QskAspect::Subcontrol subControl ) const noexcept;
2023-07-20 10:01:16 +00:00
2023-07-24 08:56:26 +00:00
private:
class PrivateData;
std::unique_ptr< PrivateData > m_data;
2023-07-10 13:54:53 +00:00
};