24#include <QtCore/qrect.h>
25#include <QtCore/qsize.h>
26#include <QtCore/qpoint.h>
27#include <QtCore/qmargins.h>
28#include <QtCore/qstringlist.h>
29#include <QtGui/qpen.h>
30#include <QtGui/qfont.h>
31#include <QtGui/qcolor.h>
32#include <QtGui/qbrush.h>
33#include <QtGui/qevent.h>
34#include <QtGui/qtransform.h>
35#include <QtGui/qpainterpath.h>
36#include <QtWidgets/qtablewidget.h>
48 static inline QColor
toQColor(
const ot::Color& _color)
noexcept {
return QColor(_color.r(), _color.g(), _color.b(), _color.a()); };
49 static inline QColor
toQColor(
const ot::ColorF& _color)
noexcept {
return QColor((
int)(_color.r() * 255.f), (
int)(_color.g() * 255.f), (
int)(_color.b() * 255.f), (
int)(_color.a() * 255.f)); };
51 static inline ot::Color toColor(
const QColor& _color) {
return ot::Color(_color.red(), _color.green(), _color.blue(), _color.alpha()); };
54 static inline QPoint
toQPoint(
const Point2D& _pt)
noexcept {
return QPoint(_pt.x(), _pt.y()); };
55 static inline QPointF
toQPoint(
const Point2DF& _pt)
noexcept {
return QPointF((qreal)_pt.x(), (qreal)_pt.y()); };
56 static inline QPointF
toQPoint(
const Point2DD& _pt)
noexcept {
return QPointF((qreal)_pt.x(), (qreal)_pt.y()); };
61 static inline QSize
toQSize(
const Size2D& _s)
noexcept {
return QSize(_s.width(), _s.height()); };
62 static inline QSizeF
toQSize(
const Size2DF& _s)
noexcept {
return QSizeF((qreal)_s.width(), (qreal)_s.height()); };
63 static inline QSizeF
toQSize(
const Size2DD& _s)
noexcept {
return QSizeF((qreal)_s.width(), (qreal)_s.height()); };
68 static inline QRect
toQRect(
const Rect& _r)
noexcept {
return QRect(toQPoint(_r.getTopLeft()), toQPoint(_r.getBottomRight())); };
69 static inline QRectF
toQRect(
const RectF& _r)
noexcept {
return QRectF(toQPoint(_r.getTopLeft()), toQPoint(_r.getBottomRight())); };
70 static inline QRectF
toQRect(
const RectD& _r)
noexcept {
return QRectF(toQPoint(_r.getTopLeft()), toQPoint(_r.getBottomRight())); };
72 static inline Rect toRect(
const QRect& _r) {
return Rect(toPoint2D(_r.topLeft()), toPoint2D(_r.bottomRight())); };
73 static inline RectD toRect(
const QRectF& _r) {
return RectD(toPoint2D(_r.topLeft()), toPoint2D(_r.bottomRight())); };
75 static inline QMargins
toQMargins(
const Margins& _m)
noexcept {
return QMargins(_m.left(), _m.top(), _m.right(), _m.bottom()); };
76 static inline QMarginsF
toQMargins(
const MarginsF& _m)
noexcept {
return QMarginsF(_m.left(), _m.top(), _m.right(), _m.bottom()); };
77 static inline QMarginsF
toQMargins(
const MarginsD& _m)
noexcept {
return QMarginsF(_m.left(), _m.top(), _m.right(), _m.bottom()); };
82 static QFont toQFont(
const Font& _f);
83 static Font toFont(
const QFont& _font);
85 static QPen toQPen(
const Outline& _outline);
86 static QPen toQPen(
const OutlineF& _outline);
88 static Qt::Alignment toQAlignment(
Alignment _alignment);
96 static Qt::PenStyle toQPenStyle(
LineStyle _style);
97 static Qt::PenCapStyle toQPenCapStyle(
LineCapStyle _style);
98 static Qt::PenJoinStyle toQPenJoinStyle(
LineJoinStyle _style);
100 static QPainterPath toQPainterPath(
const Path2DF& _path);
102 static QTransform toQTransform(
const ot::Transform& _transform);
103 static QTransform toQTransformOnCenter(
const ot::Transform& _transform,
const QPointF& _centerPos);
105 static ot::TableRange toTableRange(
const QTableWidgetSelectionRange& _range);
106 static QTableWidgetSelectionRange toQTableRange(
const ot::TableRange& _range);
108 static QString toQString(QEvent::Type _type);
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
The ColorF class is used to represent RGBA colors with float values.
Definition Color.h:157
The Color class is used to represent RGBA colors with integer values.
Definition Color.h:72
ColorF toColorF(void) const
Definition Color.cpp:344
The OutlineF class is used to describe how a outline should look like.
Definition Outline.h:161
The Outline class is used to describe how a outline should look like.
Definition Outline.h:54
Definition Painter2D.h:17
The Path2DF class describes a path consisting of different types of lines.
Definition Path2D.h:116
2D Point with double values
Definition Point2D.h:144
2D Point with float values
Definition Point2D.h:82
2D Point with integer values
Definition Point2D.h:20
The QtFactory is used to convert OpenTwin configuration objects to Qt objects.
Definition QtFactory.h:44
static QRectF toQRect(const RectD &_r) noexcept
Definition QtFactory.h:70
static MarginsD toMargins(const QMarginsF &_m)
Definition QtFactory.h:80
static QSizeF toQSize(const Size2DF &_s) noexcept
Definition QtFactory.h:62
static Size2D toSize2D(const QSize &_s)
Definition QtFactory.h:65
static QMargins toQMargins(const Margins &_m) noexcept
Definition QtFactory.h:75
static QPointF toQPoint(const Point2DD &_pt) noexcept
Definition QtFactory.h:56
static QSize toQSize(const Size2D &_s) noexcept
Definition QtFactory.h:61
static QColor toQColor(const ot::ColorF &_color) noexcept
Definition QtFactory.h:49
static Size2DD toSize2D(const QSizeF &_s)
Definition QtFactory.h:66
static QMarginsF toQMargins(const MarginsF &_m) noexcept
Definition QtFactory.h:76
static QMarginsF toQMargins(const MarginsD &_m) noexcept
Definition QtFactory.h:77
static RectD toRect(const QRectF &_r)
Definition QtFactory.h:73
static Rect toRect(const QRect &_r)
Definition QtFactory.h:72
static QRectF toQRect(const RectF &_r) noexcept
Definition QtFactory.h:69
static QSizeF toQSize(const Size2DD &_s) noexcept
Definition QtFactory.h:63
static ot::ColorF toColorF(const QColor &_color)
Definition QtFactory.h:52
static QPointF toQPoint(const Point2DF &_pt) noexcept
Definition QtFactory.h:55
static ot::Point2DD toPoint2D(const QPointF &_pt)
Definition QtFactory.h:59
static ot::Color toColor(const QColor &_color)
Definition QtFactory.h:51
static ot::Point2D toPoint2D(const QPoint &_pt)
Definition QtFactory.h:58
static Margins toMargins(const QMargins &_m)
Definition QtFactory.h:79
static QRect toQRect(const Rect &_r) noexcept
Definition QtFactory.h:68
static QPoint toQPoint(const Point2D &_pt) noexcept
Definition QtFactory.h:54
static QColor toQColor(const ot::Color &_color) noexcept
Convert OpenTwin Color to Qt Color.
Definition QtFactory.h:48
Rectangle that holds the top left and bottom right corner in double values.
Definition Rect.h:234
Rectangle that holds the top left and bottom right corner in int values.
Definition Rect.h:20
2D Size with double values
Definition Size2D.h:115
2D Size with float values
Definition Size2D.h:65
2D Size with integer values
Definition Size2D.h:15
Definition TableRange.h:16
Alignment
Alignment.
Definition GuiTypes.h:21
GradientSpread
Describes how the painter will behave when painting outsite the gradient area.
Definition GuiTypes.h:76
LineCapStyle
Line cap style.
Definition Outline.h:29
LineJoinStyle
Line join style.
Definition Outline.h:36
LineStyle
Line style.
Definition Outline.h:19