WColorPicker: Make use of in-class initializers where applicable
This commit is contained in:
parent
5212b73229
commit
37ada5110d
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue