Q_PROPERTY(bool autoHide READ hasAutoHide WRITE setAutoHide)
Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
public:
Q_PROPERTY(bool autoHide READ hasAutoHide WRITE setAutoHide)
Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
public:
- explicit IconButton(QWidget *parent = 0);
- void paintEvent(QPaintEvent *event);
- void setPixmap(const QPixmap &pixmap) { m_pixmap = pixmap; update(); }
- QPixmap pixmap() const { return m_pixmap; }
- float iconOpacity() { return m_iconOpacity; }
- void setIconOpacity(float value) { m_iconOpacity = value; update(); }
- void animateShow(bool visible);
-
- void setAutoHide(bool hide) { m_autoHide = hide; }
- bool hasAutoHide() const { return m_autoHide; }
+ explicit IconButton(QWidget *parent = 0);
+ void paintEvent(QPaintEvent *event);
+ void setPixmap(const QPixmap &pixmap) { m_pixmap = pixmap; update(); }
+ QPixmap pixmap() const { return m_pixmap; }
+ float iconOpacity() { return m_iconOpacity; }
+ void setIconOpacity(float value) { m_iconOpacity = value; update(); }
+ void animateShow(bool visible);
+
+ void setAutoHide(bool hide) { m_autoHide = hide; }
+ bool hasAutoHide() const { return m_autoHide; }
/* A line edit with an embedded pixmap on one side that is connected to
* a menu. Additionally, it can display a grayed hintText (like "Type Here to")
* when not focused and empty. When connecting to the changed signals and
/* A line edit with an embedded pixmap on one side that is connected to
* a menu. Additionally, it can display a grayed hintText (like "Type Here to")
* when not focused and empty. When connecting to the changed signals and
- QMenu *buttonMenu(Side side) const;
- void setButtonMenu(Side side, QMenu *menu);
+ QPixmap buttonPixmap(Side side) const;
+ void setButtonPixmap(Side side, const QPixmap &pixmap);
- void setButtonVisible(Side side, bool visible);
- bool isButtonVisible(Side side) const;
+ QMenu *buttonMenu(Side side) const;
+ void setButtonMenu(Side side, QMenu *menu);
- void setButtonToolTip(Side side, const QString &);
- void setButtonFocusPolicy(Side side, Qt::FocusPolicy policy);
+ void setButtonVisible(Side side, bool visible);
+ bool isButtonVisible(Side side) const;
- // Set whether tabbing in will trigger the menu.
- void setMenuTabFocusTrigger(Side side, bool v);
- bool hasMenuTabFocusTrigger(Side side) const;
+ void setButtonToolTip(Side side, const QString &);
+ void setButtonFocusPolicy(Side side, Qt::FocusPolicy policy);
- // Set if icon should be hidden when text is empty
- void setAutoHideButton(Side side, bool h);
- bool hasAutoHideButton(Side side) const;
+ // Set whether tabbing in will trigger the menu.
+ void setMenuTabFocusTrigger(Side side, bool v);
+ bool hasMenuTabFocusTrigger(Side side) const;
-Q_SIGNALS:
- void buttonClicked(Side side);
- void leftButtonClicked();
- void rightButtonClicked();
+ // Set if icon should be hidden when text is empty
+ void setAutoHideButton(Side side, bool h);
+ bool hasAutoHideButton(Side side) const;