QML export as QskGadientStops does nor work - we need to stay with
QVector
This commit is contained in:
parent
4c26392d72
commit
0d9dbf4c58
|
@ -12,8 +12,8 @@ GridBox
|
||||||
background
|
background
|
||||||
{
|
{
|
||||||
stops: [
|
stops: [
|
||||||
{ position: 0.0, color: "White" },
|
{ position: 0.0, color: "Red" },
|
||||||
{ position: 1.0, color: "White" },
|
{ position: 1.0, color: "Yellow" },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,10 @@
|
||||||
|
|
||||||
class QVariant;
|
class QVariant;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Don't use QskGradientStops for definitions seen by moc
|
||||||
|
Otherwise exporting these interfaces to QML does not work.
|
||||||
|
*/
|
||||||
typedef QVector< QskGradientStop > QskGradientStops;
|
typedef QVector< QskGradientStop > QskGradientStops;
|
||||||
|
|
||||||
class QSK_EXPORT QskGradient
|
class QSK_EXPORT QskGradient
|
||||||
|
@ -22,7 +26,7 @@ class QSK_EXPORT QskGradient
|
||||||
Q_GADGET
|
Q_GADGET
|
||||||
|
|
||||||
Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation )
|
Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation )
|
||||||
Q_PROPERTY( QskGradientStops stops READ stops WRITE setStops )
|
Q_PROPERTY( QVector< QskGradientStop > stops READ stops WRITE setStops )
|
||||||
|
|
||||||
Q_PROPERTY( bool valid READ isValid )
|
Q_PROPERTY( bool valid READ isValid )
|
||||||
Q_PROPERTY( bool visible READ isVisible )
|
Q_PROPERTY( bool visible READ isVisible )
|
||||||
|
@ -44,10 +48,10 @@ class QSK_EXPORT QskGradient
|
||||||
QskGradient( QRgb );
|
QskGradient( QRgb );
|
||||||
QskGradient( const QColor& );
|
QskGradient( const QColor& );
|
||||||
|
|
||||||
QskGradient( Qt::Orientation, const QskGradientStops& );
|
QskGradient( Qt::Orientation, const QVector< QskGradientStop >& );
|
||||||
QskGradient( Qt::Orientation, const QColor&, const QColor& );
|
QskGradient( Qt::Orientation, const QColor&, const QColor& );
|
||||||
|
|
||||||
QskGradient( Orientation, const QskGradientStops& );
|
QskGradient( Orientation, const QVector< QskGradientStop >& );
|
||||||
QskGradient( Orientation, const QColor&, const QColor& );
|
QskGradient( Orientation, const QColor&, const QColor& );
|
||||||
|
|
||||||
~QskGradient();
|
~QskGradient();
|
||||||
|
@ -68,8 +72,8 @@ class QSK_EXPORT QskGradient
|
||||||
Q_INVOKABLE QColor startColor() const;
|
Q_INVOKABLE QColor startColor() const;
|
||||||
Q_INVOKABLE QColor endColor() const;
|
Q_INVOKABLE QColor endColor() const;
|
||||||
|
|
||||||
Q_INVOKABLE void setStops( const QskGradientStops& );
|
Q_INVOKABLE void setStops( const QVector< QskGradientStop >& );
|
||||||
Q_INVOKABLE QskGradientStops stops() const;
|
Q_INVOKABLE QVector< QskGradientStop > stops() const;
|
||||||
|
|
||||||
Q_INVOKABLE bool hasStopAt( qreal value ) const;
|
Q_INVOKABLE bool hasStopAt( qreal value ) const;
|
||||||
|
|
||||||
|
@ -100,7 +104,7 @@ class QSK_EXPORT QskGradient
|
||||||
void setColorAt( int index, const QColor& color );
|
void setColorAt( int index, const QColor& color );
|
||||||
|
|
||||||
Orientation m_orientation;
|
Orientation m_orientation;
|
||||||
QskGradientStops m_stops;
|
QVector< QskGradientStop > m_stops;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE( QskGradient )
|
Q_DECLARE_METATYPE( QskGradient )
|
||||||
|
|
Loading…
Reference in New Issue