making QskGraphic a Q_GADGET

This commit is contained in:
Uwe Rathmann 2022-03-24 10:26:33 +01:00
parent 28907c75d8
commit 6455c26f86
4 changed files with 16 additions and 3 deletions

View File

@ -1,5 +1,7 @@
TEMPLATE = subdirs TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS = \ SUBDIRS = \
src \ src \
skins \ skins \
@ -21,6 +23,7 @@ OTHER_FILES = \
qmlexport.depends = src qmlexport.depends = src
inputcontext.depends = src inputcontext.depends = src
skins.depends = src skins.depends = src
tools.depends = src
support.depends = src skins support.depends = src skins
examples.depends = tools support skins qmlexport examples.depends = tools support skins qmlexport
playground.depends = tools support skins qmlexport playground.depends = tools support skins qmlexport

View File

@ -1203,3 +1203,5 @@ QDebug operator<<( QDebug debug, const QskGraphic& graphic )
} }
#endif #endif
#include "moc_QskGraphic.cpp"

View File

@ -26,6 +26,14 @@ class QDebug;
class QSK_EXPORT QskGraphic : public QPaintDevice class QSK_EXPORT QskGraphic : public QPaintDevice
{ {
Q_GADGET
Q_PROPERTY( qreal aspectRatio READ aspectRatio )
Q_PROPERTY( QRectF boundingRect READ boundingRect )
Q_PROPERTY( QRectF controlPointRect READ controlPointRect )
Q_PROPERTY( QSizeF defaultSize READ defaultSize )
Q_PROPERTY( quint64 modificationId READ modificationId )
public: public:
enum RenderHint enum RenderHint
{ {
@ -122,8 +130,6 @@ class QSK_EXPORT QskGraphic : public QPaintDevice
uint hash( uint seed ) const; uint hash( uint seed ) const;
protected: protected:
friend class QskGraphicPaintEngine;
virtual QSize sizeMetrics() const; virtual QSize sizeMetrics() const;
virtual void drawPath( const QPainterPath& ); virtual void drawPath( const QPainterPath& );
@ -142,6 +148,8 @@ class QSK_EXPORT QskGraphic : public QPaintDevice
class PrivateData; class PrivateData;
QSharedDataPointer< PrivateData > m_data; QSharedDataPointer< PrivateData > m_data;
friend class QskGraphicPaintEngine;
mutable QskGraphicPaintEngine* m_paintEngine; mutable QskGraphicPaintEngine* m_paintEngine;
}; };

View File

@ -18,7 +18,7 @@ standalone {
$${QSK_ROOT}/src/common \ $${QSK_ROOT}/src/common \
$${QSK_ROOT}/src/graphic $${QSK_ROOT}/src/graphic
INCLUDEPATH *= $${QSK_DIRS} INCLUDEPATH *= $${QSK_DIRS} $${QSK_OUT_ROOT}/src/$${MOC_DIR}
DEPENDPATH += $${QSK_DIRS} DEPENDPATH += $${QSK_DIRS}
DEFINES += QSK_STANDALONE DEFINES += QSK_STANDALONE