13#include <dtkwidget_global.h>
16#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
18DWIDGET_BEGIN_NAMESPACE
19class DImageButtonPrivate;
20class LIBDTKWIDGETSHARED_EXPORT D_DECL_DEPRECATED_X(
"Use DIconButton") DImageButton :
public QLabel,
public DTK_CORE_NAMESPACE::DObject
23 Q_PROPERTY(QString normalPic READ getNormalPic WRITE setNormalPic DESIGNABLE
true)
24 Q_PROPERTY(QString hoverPic READ getHoverPic WRITE setHoverPic DESIGNABLE
true)
25 Q_PROPERTY(QString pressPic READ getPressPic WRITE setPressPic DESIGNABLE
true)
26 Q_PROPERTY(QString checkedPic READ getCheckedPic WRITE setCheckedPic DESIGNABLE
true)
27 Q_PROPERTY(QString disabledPic READ getDisabledPic WRITE setDisabledPic DESIGNABLE
true)
28 Q_PROPERTY(
bool checked READ isChecked WRITE setChecked NOTIFY checkedChanged)
29 Q_PROPERTY(
bool checkable READ isCheckable WRITE setCheckable)
32 DImageButton(QWidget *parent = 0);
34 DImageButton(
const QString &normalPic,
const QString &hoverPic,
35 const QString &pressPic, QWidget *parent = 0);
37 DImageButton(
const QString &normalPic,
const QString &hoverPic,
38 const QString &pressPic,
const QString &checkedPic, QWidget *parent = 0);
42 void setEnabled(
bool enabled);
43 void setDisabled(
bool disabled);
45 void setChecked(
bool flag);
46 void setCheckable(
bool flag);
47 bool isChecked()
const;
48 bool isCheckable()
const;
50 void setNormalPic(
const QString &normalPic);
51 void setHoverPic(
const QString &hoverPic);
52 void setPressPic(
const QString &pressPic);
53 void setCheckedPic(
const QString &checkedPic);
54 void setDisabledPic(
const QString &disabledPic);
56 const QString getNormalPic()
const;
57 const QString getHoverPic()
const;
58 const QString getPressPic()
const;
59 const QString getCheckedPic()
const;
60 const QString getDisabledPic()
const;
70 void setState(State state);
71 State getState()
const;
75 void checkedChanged(
bool checked);
79 DImageButton(DImageButtonPrivate &q, QWidget *parent);
80#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
81 void enterEvent(QEvent *event) Q_DECL_OVERRIDE;
83 void enterEvent(QEnterEvent *event) Q_DECL_OVERRIDE;
85 void leaveEvent(QEvent *event) Q_DECL_OVERRIDE;
86 void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
87 void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
88 void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
91 Q_DISABLE_COPY(DImageButton)
92 D_DECLARE_PRIVATE(DImageButton)