From 4744d85725f5ebf404e0cc0682e46f560df84cd0 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Mon, 25 Oct 2021 08:31:32 +0200 Subject: [PATCH] more constructors to avoid losing alpha values --- src/common/QskGradientStop.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/common/QskGradientStop.h b/src/common/QskGradientStop.h index 2371ba77..26ebcdf9 100644 --- a/src/common/QskGradientStop.h +++ b/src/common/QskGradientStop.h @@ -28,6 +28,8 @@ class QSK_EXPORT QskGradientStop public: QskGradientStop() noexcept; QskGradientStop( qreal position, const QColor& ) noexcept; + QskGradientStop( qreal position, Qt::GlobalColor ) noexcept; + QskGradientStop( qreal position, QRgb ) noexcept; bool operator==( const QskGradientStop& ) const noexcept; bool operator!=( const QskGradientStop& ) const noexcept; @@ -67,6 +69,18 @@ inline QskGradientStop::QskGradientStop( { } +inline QskGradientStop::QskGradientStop( + qreal position, const Qt::GlobalColor color ) noexcept + : QskGradientStop( position, QColor( color ) ) +{ +} + +inline QskGradientStop::QskGradientStop( + qreal position, QRgb rgb ) noexcept + : QskGradientStop( position, QColor::fromRgba( rgb ) ) +{ +} + inline qreal QskGradientStop::position() const noexcept { return m_position;