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) WColorPicker::WColorPicker(QWidget *parent)
: 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; return mColor;
} }

View File

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