Rename file imageswitch.h & imageswitch.cpp to ImageSwitch.h & ImageSwitch.cpp, and refactor.
This commit is contained in:
28
src/components/ImageSwitch.h
Normal file
28
src/components/ImageSwitch.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef IMAGESWITCH_H
|
||||
#define IMAGESWITCH_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class ImageSwitch : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ImageSwitch(QWidget *parent = nullptr);
|
||||
~ImageSwitch() override = default;
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *) override;
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
private:
|
||||
bool mIsChecked;
|
||||
QString mImgOffFile;
|
||||
QString mImgOnFile;
|
||||
|
||||
public:
|
||||
bool getChecked() const;
|
||||
signals:
|
||||
void clicked();
|
||||
public Q_SLOTS:
|
||||
void setChecked(bool isChecked);
|
||||
};
|
||||
|
||||
#endif // IMAGESWITCH_H
|
||||
Reference in New Issue
Block a user