From cea3828e3d6486c6bed23e80459d9a1d43653a61 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Fri, 19 Feb 2021 12:42:05 +0100 Subject: [PATCH] more methods for tools that rely on meta object data --- src/common/QskGradient.cpp | 5 +++++ src/common/QskGradient.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/common/QskGradient.cpp b/src/common/QskGradient.cpp index f477430d..1a74fb03 100644 --- a/src/common/QskGradient.cpp +++ b/src/common/QskGradient.cpp @@ -344,6 +344,11 @@ QVector< QskGradientStop > QskGradient::stops() const return m_stops; } +int QskGradient::stopCount() const +{ + return m_stops.count(); +} + void QskGradient::setStopAt( int index, qreal stop ) { if ( stop < 0.0 || stop > 1.0 ) diff --git a/src/common/QskGradient.h b/src/common/QskGradient.h index cdee174c..178630cc 100644 --- a/src/common/QskGradient.h +++ b/src/common/QskGradient.h @@ -125,6 +125,7 @@ class QSK_EXPORT QskGradient Q_INVOKABLE qreal stopAt( int index ) const; Q_INVOKABLE QColor colorAt( int index ) const; + Q_INVOKABLE int stopCount() const; private: void setStopAt( int index, qreal stop );