From acbfb9a006a2fa654a030cf35a0f6d9e42f36b4f Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sun, 3 May 2020 14:02:54 +0200 Subject: [PATCH] more C++11 specifier --- src/graphic/QskColorFilter.cpp | 14 -------------- src/graphic/QskColorFilter.h | 26 ++++++++++++++++---------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/graphic/QskColorFilter.cpp b/src/graphic/QskColorFilter.cpp index 54ec22b1..ac1db0b1 100644 --- a/src/graphic/QskColorFilter.cpp +++ b/src/graphic/QskColorFilter.cpp @@ -143,14 +143,6 @@ static inline QskColorFilter qskInterpolatedFilter( return interpolated; } -QskColorFilter::QskColorFilter() -{ -} - -QskColorFilter::~QskColorFilter() -{ -} - void QskColorFilter::addColorSubstitution( QRgb from, QRgb to ) { for ( auto& substitution : m_substitutions ) @@ -203,12 +195,6 @@ QRgb QskColorFilter::substituted( const QRgb& rgb ) const return qskSubstitutedRgb( m_substitutions, rgb ); } -bool QskColorFilter::operator==( const QskColorFilter& other ) const -{ - // what about having the same substitutions, but in different order ??? - return ( m_substitutions == other.m_substitutions ); -} - QskColorFilter QskColorFilter::interpolated( const QskColorFilter& other, qreal progress ) const { diff --git a/src/graphic/QskColorFilter.h b/src/graphic/QskColorFilter.h index caed1a8b..92bb9999 100644 --- a/src/graphic/QskColorFilter.h +++ b/src/graphic/QskColorFilter.h @@ -16,13 +16,11 @@ class QPen; class QBrush; class QVariant; -class QDebug; class QSK_EXPORT QskColorFilter { public: - QskColorFilter(); - ~QskColorFilter(); + QskColorFilter() noexcept = default; void addColorSubstitution( QRgb from, QRgb to ); void addColorSubstitution( Qt::GlobalColor, QRgb ); @@ -37,12 +35,12 @@ class QSK_EXPORT QskColorFilter QColor substituted( const QColor& ) const; QRgb substituted( const QRgb& ) const; - bool isIdentity() const; + bool isIdentity() const noexcept; - bool operator==( const QskColorFilter& other ) const; - bool operator!=( const QskColorFilter& other ) const; + bool operator==( const QskColorFilter& other ) const noexcept; + bool operator!=( const QskColorFilter& other ) const noexcept; - const QVector< QPair< QRgb, QRgb > >& substitutions() const; + const QVector< QPair< QRgb, QRgb > >& substitutions() const noexcept; QskColorFilter interpolated( const QskColorFilter&, qreal value ) const; @@ -55,19 +53,26 @@ class QSK_EXPORT QskColorFilter QVector< QPair< QRgb, QRgb > > m_substitutions; }; -inline bool QskColorFilter::isIdentity() const +inline bool QskColorFilter::isIdentity() const noexcept { return m_substitutions.isEmpty(); } +inline bool QskColorFilter::operator==( + const QskColorFilter& other ) const noexcept +{ + // what about having the same substitutions, but in different order ??? + return ( m_substitutions == other.m_substitutions ); +} + inline bool QskColorFilter::operator!=( - const QskColorFilter& other ) const + const QskColorFilter& other ) const noexcept { return ( !( *this == other ) ); } inline const QVector< QPair< QRgb, QRgb > >& -QskColorFilter::substitutions() const +QskColorFilter::substitutions() const noexcept { return m_substitutions; } @@ -91,6 +96,7 @@ inline void QskColorFilter::addColorSubstitution( Q_DECLARE_METATYPE( QskColorFilter ) #ifndef QT_NO_DEBUG_STREAM +class QDebug; QSK_EXPORT QDebug operator<<( QDebug, const QskColorFilter& ); #endif