2017-04-27 18:30:36 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2015-07-17 16:09:42 +00:00
|
|
|
#ifndef QMLPROFILE_H
|
|
|
|
#define QMLPROFILE_H
|
|
|
|
|
|
|
|
#include <QQuickPaintedItem>
|
|
|
|
|
|
|
|
class ProfileWidget2;
|
|
|
|
|
|
|
|
class QMLProfile : public QQuickPaintedItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QString diveId READ diveId WRITE setDiveId NOTIFY diveIdChanged)
|
2016-01-13 02:05:06 +00:00
|
|
|
Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio WRITE setDevicePixelRatio NOTIFY devicePixelRatioChanged)
|
|
|
|
|
2015-07-17 16:09:42 +00:00
|
|
|
public:
|
|
|
|
explicit QMLProfile(QQuickItem *parent = 0);
|
2015-11-12 00:43:13 +00:00
|
|
|
virtual ~QMLProfile();
|
|
|
|
|
2015-07-17 16:09:42 +00:00
|
|
|
void paint(QPainter *painter);
|
|
|
|
|
|
|
|
QString diveId() const;
|
|
|
|
void setDiveId(const QString &diveId);
|
2016-01-13 02:05:06 +00:00
|
|
|
qreal devicePixelRatio() const;
|
|
|
|
void setDevicePixelRatio(qreal dpr);
|
|
|
|
|
2015-12-29 17:50:47 +00:00
|
|
|
public slots:
|
|
|
|
void setMargin(int margin);
|
2016-03-09 03:33:19 +00:00
|
|
|
void screenChanged(QScreen *screen);
|
2015-07-17 16:09:42 +00:00
|
|
|
private:
|
|
|
|
QString m_diveId;
|
2016-01-13 02:05:06 +00:00
|
|
|
qreal m_devicePixelRatio;
|
2015-12-29 17:50:47 +00:00
|
|
|
int m_margin;
|
2015-11-12 00:43:13 +00:00
|
|
|
ProfileWidget2 *m_profileWidget;
|
2016-03-09 03:33:19 +00:00
|
|
|
|
2015-07-17 16:09:42 +00:00
|
|
|
signals:
|
|
|
|
void rightAlignedChanged();
|
|
|
|
void diveIdChanged();
|
2016-01-13 02:05:06 +00:00
|
|
|
void devicePixelRatioChanged();
|
2015-07-17 16:09:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QMLPROFILE_H
|