more methods for tools that rely on meta object data

This commit is contained in:
Uwe Rathmann 2021-02-19 12:42:05 +01:00
parent 5a19669f26
commit cea3828e3d
2 changed files with 6 additions and 0 deletions

View File

@ -344,6 +344,11 @@ QVector< QskGradientStop > QskGradient::stops() const
return m_stops; return m_stops;
} }
int QskGradient::stopCount() const
{
return m_stops.count();
}
void QskGradient::setStopAt( int index, qreal stop ) void QskGradient::setStopAt( int index, qreal stop )
{ {
if ( stop < 0.0 || stop > 1.0 ) if ( stop < 0.0 || stop > 1.0 )

View File

@ -125,6 +125,7 @@ class QSK_EXPORT QskGradient
Q_INVOKABLE qreal stopAt( int index ) const; Q_INVOKABLE qreal stopAt( int index ) const;
Q_INVOKABLE QColor colorAt( int index ) const; Q_INVOKABLE QColor colorAt( int index ) const;
Q_INVOKABLE int stopCount() const;
private: private:
void setStopAt( int index, qreal stop ); void setStopAt( int index, qreal stop );