From 9a5896fab1b1a2d86f13b7da15fe9227724d7055 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Sat, 8 Jul 2023 14:44:25 +0200 Subject: [PATCH] Remove several Qt properties --- include/FloatModelEditorBase.h | 57 ------------ src/gui/widgets/FloatModelEditorBase.cpp | 110 +---------------------- 2 files changed, 1 insertion(+), 166 deletions(-) diff --git a/include/FloatModelEditorBase.h b/include/FloatModelEditorBase.h index 07e16bcde..38ab1b51b 100644 --- a/include/FloatModelEditorBase.h +++ b/include/FloatModelEditorBase.h @@ -48,30 +48,10 @@ void convertPixmapToGrayScaleTemp(QPixmap &pixMap); class LMMS_EXPORT FloatModelEditorBase : public QWidget, public FloatModelView { Q_OBJECT - Q_ENUMS( knobTypesTemp ) - - Q_PROPERTY(float innerRadius READ innerRadius WRITE setInnerRadius) - Q_PROPERTY(float outerRadius READ outerRadius WRITE setOuterRadius) - - Q_PROPERTY(float centerPointX READ centerPointX WRITE setCenterPointX) - Q_PROPERTY(float centerPointY READ centerPointY WRITE setCenterPointY) - - Q_PROPERTY(float lineWidth READ lineWidth WRITE setLineWidth) - - // Unfortunately, the gradient syntax doesn't create our gradient - // correctly so we need to do this: - Q_PROPERTY(QColor outerColor READ outerColor WRITE setOuterColor) - - Q_PROPERTY(QColor lineActiveColor MEMBER m_lineActiveColor) - Q_PROPERTY(QColor lineInactiveColor MEMBER m_lineInactiveColor) - Q_PROPERTY(QColor arcActiveColor MEMBER m_arcActiveColor) - Q_PROPERTY(QColor arcInactiveColor MEMBER m_arcInactiveColor) mapPropertyFromModel(bool,isVolumeKnob,setVolumeKnob,m_volumeKnob); mapPropertyFromModel(float,volumeRatio,setVolumeRatio,m_volumeRatio); - Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor) - void initUi( const QString & _name ); //!< to be called by ctors public: @@ -88,29 +68,6 @@ public: void setTotalAngle( float angle ); - // Begin styled knob accessors - float innerRadius() const; - void setInnerRadius( float r ); - - float outerRadius() const; - void setOuterRadius( float r ); - - QPointF centerPoint() const; - float centerPointX() const; - void setCenterPointX( float c ); - float centerPointY() const; - void setCenterPointY( float c ); - - float lineWidth() const; - void setLineWidth( float w ); - - QColor outerColor() const; - void setOuterColor( const QColor & c ); - - QColor textColor() const; - void setTextColor( const QColor & c ); - - signals: void sliderPressed(); void sliderReleased(); @@ -173,20 +130,6 @@ private: float m_totalAngle; int m_angle; QImage m_cache; - - // Styled knob stuff, could break out - QPointF m_centerPoint; - float m_innerRadius; - float m_outerRadius; - float m_lineWidth; - QColor m_outerColor; - - QColor m_lineActiveColor; - QColor m_lineInactiveColor; - QColor m_arcActiveColor; - QColor m_arcInactiveColor; - - QColor m_textColor; }; diff --git a/src/gui/widgets/FloatModelEditorBase.cpp b/src/gui/widgets/FloatModelEditorBase.cpp index 55e5bdb70..73a91a393 100644 --- a/src/gui/widgets/FloatModelEditorBase.cpp +++ b/src/gui/widgets/FloatModelEditorBase.cpp @@ -66,9 +66,7 @@ FloatModelEditorBase::FloatModelEditorBase(QWidget * _parent, const QString & _n m_volumeKnob( false ), m_volumeRatio( 100.0, 0.0, 1000000.0 ), m_buttonPressed( false ), - m_angle( -10 ), - m_lineWidth( 0 ), - m_textColor( 255, 255, 255 ) + m_angle( -10 ) { initUi( _name ); } @@ -107,112 +105,6 @@ void FloatModelEditorBase::setTotalAngle( float angle ) -float FloatModelEditorBase::innerRadius() const -{ - return m_innerRadius; -} - - - -void FloatModelEditorBase::setInnerRadius( float r ) -{ - m_innerRadius = r; -} - - - -float FloatModelEditorBase::outerRadius() const -{ - return m_outerRadius; -} - - - -void FloatModelEditorBase::setOuterRadius( float r ) -{ - m_outerRadius = r; -} - - - - -QPointF FloatModelEditorBase::centerPoint() const -{ - return m_centerPoint; -} - - - -float FloatModelEditorBase::centerPointX() const -{ - return m_centerPoint.x(); -} - - - -void FloatModelEditorBase::setCenterPointX( float c ) -{ - m_centerPoint.setX( c ); -} - - - -float FloatModelEditorBase::centerPointY() const -{ - return m_centerPoint.y(); -} - - - -void FloatModelEditorBase::setCenterPointY( float c ) -{ - m_centerPoint.setY( c ); -} - - - -float FloatModelEditorBase::lineWidth() const -{ - return m_lineWidth; -} - - - -void FloatModelEditorBase::setLineWidth( float w ) -{ - m_lineWidth = w; -} - - - -QColor FloatModelEditorBase::outerColor() const -{ - return m_outerColor; -} - - - -void FloatModelEditorBase::setOuterColor( const QColor & c ) -{ - m_outerColor = c; -} - - - -QColor FloatModelEditorBase::textColor() const -{ - return m_textColor; -} - - - -void FloatModelEditorBase::setTextColor( const QColor & c ) -{ - m_textColor = c; -} - - - QLineF FloatModelEditorBase::calculateLine( const QPointF & _mid, float _radius, float _innerRadius ) const { const float rarc = m_angle * F_PI / 180.0;