WColorPicker: Make use of in-class initializers where applicable

This commit is contained in:
Lioncash 2020-06-28 06:52:06 -04:00
parent 5212b73229
commit 37ada5110d
2 changed files with 9 additions and 9 deletions

View File

@ -6,7 +6,6 @@
WColorPicker::WColorPicker(QWidget *parent)
: QWidget(parent)
, mColor(Qt::transparent)
{
}
@ -79,7 +78,7 @@ void WColorPicker::mouseReleaseEvent(QMouseEvent *pEvent)
}
}
QColor WColorPicker::Color()
QColor WColorPicker::Color() const
{
return mColor;
}

View File

@ -7,16 +7,17 @@
class WColorPicker : public QWidget
{
Q_OBJECT
QColor mColor;
QColor mColor{Qt::transparent};
QColor mOldColor;
public:
explicit WColorPicker(QWidget *pParent = 0);
void paintEvent(QPaintEvent *);
void keyPressEvent(QKeyEvent *pEvent);
void mousePressEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *pEvent);
QColor Color();
explicit WColorPicker(QWidget* pParent = nullptr);
void paintEvent(QPaintEvent*) override;
void keyPressEvent(QKeyEvent* pEvent) override;
void mousePressEvent(QMouseEvent*) override;
void mouseReleaseEvent(QMouseEvent* pEvent) override;
QColor Color() const;
void SetColor(QColor Color);
signals: