mirror-chatterino2/settingsdialogtab.h

46 lines
874 B
C
Raw Normal View History

2017-01-01 18:43:52 +01:00
#ifndef SETTINGSNOTEBOOKTAB_H
#define SETTINGSNOTEBOOKTAB_H
#include <QWidget>
#include "QPaintEvent"
2017-01-02 03:02:32 +01:00
class SettingsDialog;
2017-01-01 18:43:52 +01:00
class SettingsDialogTab : public QWidget
{
Q_OBJECT
2017-01-02 03:02:32 +01:00
Q_PROPERTY(bool selected READ selected WRITE setSelected NOTIFY selectedChanged)
2017-01-01 18:43:52 +01:00
public:
2017-01-02 03:02:32 +01:00
SettingsDialogTab(SettingsDialog* dialog, QString label, QString imageRes);
void setSelected(bool selected)
{
if (selected == m_selected) return;
m_selected = selected;
emit selectedChanged(selected);
}
bool selected() const
{ return m_selected; }
QWidget* widget;
signals:
void selectedChanged(bool);
2017-01-01 18:43:52 +01:00
private:
void paintEvent(QPaintEvent *);
2017-01-02 03:02:32 +01:00
void mouseReleaseEvent(QMouseEvent *event);
2017-01-01 18:43:52 +01:00
QString label;
2017-01-02 03:02:32 +01:00
QImage image;
SettingsDialog* dialog = NULL;
bool m_selected = false;
2017-01-01 18:43:52 +01:00
};
#endif // SETTINGSNOTEBOOKTAB_H