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 virtual const QWidget* getQWidget(void) const override { return this; };
34
35 void setMaintainAspectRatio(bool _maintain) { m_maintainAspectRatio = _maintain; };
36 bool isMaintainAspectRatio(void) const { return m_maintainAspectRatio; };
37
38 private Q_SLOTS:
39 void slotGlobalStyleChanged(const ColorStyle& _style);
40
41 private:
42 bool m_maintainAspectRatio;
43 QBrush m_brush;
44 };
45
46}
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:35
bool isMaintainAspectRatio(void) const
Definition Painter2DPreview.h:36
virtual const QWidget * getQWidget(void) const override
Definition Painter2DPreview.h:33
Definition QWidgetInterface.h:18
Definition Connector.h:8