| 
									
										
										
										
											2017-04-27 20:30:36 +02:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							| 
									
										
										
										
											2015-07-17 19:09:42 +03:00
										 |  |  | #ifndef QMLPROFILE_H
 | 
					
						
							|  |  |  | #define QMLPROFILE_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-08 12:56:23 +02:00
										 |  |  | #include "profilewidget2.h"
 | 
					
						
							| 
									
										
										
										
											2015-07-17 19:09:42 +03:00
										 |  |  | #include <QQuickPaintedItem>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class QMLProfile : public QQuickPaintedItem | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	Q_OBJECT | 
					
						
							| 
									
										
										
										
											2019-12-23 20:52:41 +01:00
										 |  |  | 	Q_PROPERTY(int diveId MEMBER m_diveId WRITE setDiveId) | 
					
						
							| 
									
										
										
										
											2016-01-13 03:05:06 +01:00
										 |  |  | 	Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio WRITE setDevicePixelRatio NOTIFY devicePixelRatioChanged) | 
					
						
							| 
									
										
										
										
											2020-02-17 10:46:31 -08:00
										 |  |  | 	Q_PROPERTY(qreal xOffset MEMBER m_xOffset WRITE setXOffset NOTIFY xOffsetChanged) | 
					
						
							|  |  |  | 	Q_PROPERTY(qreal yOffset MEMBER m_yOffset WRITE setYOffset NOTIFY yOffsetChanged) | 
					
						
							| 
									
										
										
										
											2016-01-13 03:05:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-17 19:09:42 +03:00
										 |  |  | public: | 
					
						
							|  |  |  | 	explicit QMLProfile(QQuickItem *parent = 0); | 
					
						
							| 
									
										
										
										
											2015-11-12 01:43:13 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-17 19:09:42 +03:00
										 |  |  | 	void paint(QPainter *painter); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-23 20:52:41 +01:00
										 |  |  | 	int diveId() const; | 
					
						
							|  |  |  | 	void setDiveId(int diveId); | 
					
						
							| 
									
										
										
										
											2016-01-13 03:05:06 +01:00
										 |  |  | 	qreal devicePixelRatio() const; | 
					
						
							|  |  |  | 	void setDevicePixelRatio(qreal dpr); | 
					
						
							| 
									
										
										
										
											2020-02-17 10:42:56 -08:00
										 |  |  | 	void setXOffset(qreal value); | 
					
						
							|  |  |  | 	void setYOffset(qreal value); | 
					
						
							| 
									
										
										
										
											2016-01-13 03:05:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-12-29 09:50:47 -08:00
										 |  |  | public slots: | 
					
						
							|  |  |  | 	void setMargin(int margin); | 
					
						
							| 
									
										
										
										
											2016-03-08 19:33:19 -08:00
										 |  |  | 	void screenChanged(QScreen *screen); | 
					
						
							| 
									
										
										
										
											2020-03-24 15:02:17 -07:00
										 |  |  | 	void triggerUpdate(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-17 19:09:42 +03:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2019-12-23 20:52:41 +01:00
										 |  |  | 	int m_diveId; | 
					
						
							| 
									
										
										
										
											2016-01-13 03:05:06 +01:00
										 |  |  | 	qreal m_devicePixelRatio; | 
					
						
							| 
									
										
										
										
											2015-12-29 09:50:47 -08:00
										 |  |  | 	int m_margin; | 
					
						
							| 
									
										
										
										
											2020-02-17 10:46:31 -08:00
										 |  |  | 	qreal m_xOffset, m_yOffset; | 
					
						
							| 
									
										
										
										
											2018-05-25 23:30:10 +02:00
										 |  |  | 	QScopedPointer<ProfileWidget2> m_profileWidget; | 
					
						
							| 
									
										
										
										
											2020-02-17 10:42:56 -08:00
										 |  |  | 	void updateProfile(); | 
					
						
							| 
									
										
										
										
											2016-03-08 19:33:19 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-17 19:09:42 +03:00
										 |  |  | signals: | 
					
						
							|  |  |  | 	void rightAlignedChanged(); | 
					
						
							| 
									
										
										
										
											2016-01-13 03:05:06 +01:00
										 |  |  | 	void devicePixelRatioChanged(); | 
					
						
							| 
									
										
										
										
											2020-02-17 10:46:31 -08:00
										 |  |  | 	void xOffsetChanged(); | 
					
						
							|  |  |  | 	void yOffsetChanged(); | 
					
						
							| 
									
										
										
										
											2015-07-17 19:09:42 +03:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // QMLPROFILE_H
 |