OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
Painter2DPreview.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
13
14// Qt header
15#include <QtWidgets/qframe.h>
16
17namespace ot {
18
19 class Painter2D;
20
22 Q_OBJECT
24 public:
25 Painter2DPreview(const Painter2D* _painter = (Painter2D*) nullptr);
26 virtual ~Painter2DPreview();
27
28 void setFromPainter(const ot::Painter2D* _painter);
29
30 virtual void paintEvent(QPaintEvent* _event) override;
31
32 virtual QWidget* getQWidget(void) override { return this; };
33
34 void setMaintainAspectRatio(bool _maintain) { m_maintainAspectRatio = _maintain; };
35 bool isMaintainAspectRatio(void) const { return m_maintainAspectRatio; };
36
37 private Q_SLOTS:
38 void slotGlobalStyleChanged(const ColorStyle& _style);
39
40 private:
41 bool m_maintainAspectRatio;
42 QBrush m_brush;
43 };
44
45}
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
#define OT_WIDGETS_API_EXPORT
Definition OTWidgetsAPIExport.h:12
Definition ColorStyle.h:24
Definition Painter2D.h:17
Definition Painter2DPreview.h:21
virtual QWidget * getQWidget(void) override
Returns a pointer to the root widget of this object.
Definition Painter2DPreview.h:32
void setMaintainAspectRatio(bool _maintain)
Definition Painter2DPreview.h:34
bool isMaintainAspectRatio(void) const
Definition Painter2DPreview.h:35
Definition QWidgetInterface.h:18
Definition Connector.h:8