qpushbuttonwithclipboard.h 731 Bytes
Newer Older
Philip Rinn's avatar
Philip Rinn committed
1 2 3 4 5 6 7 8 9
#ifndef QPUSHBUTTONWITHCLIPBOARD_H_
#define QPUSHBUTTONWITHCLIPBOARD_H_

#include <QPushButton>

/*!
    \class QPushButtonWithClipboard
    \brief Stylish widget to allow copying of password and account details
*/
Philip Rinn's avatar
Philip Rinn committed
10
class QWidget;
Philip Rinn's avatar
Philip Rinn committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
class QPushButtonWithClipboard : public QPushButton {
  Q_OBJECT

public:
  explicit QPushButtonWithClipboard(const QString &textToCopy = "",
                                    QWidget *parent = 0);

  QString getTextToCopy() const;
  void setTextToCopy(const QString &value);

signals:
  void clicked(QString);

private slots:
  void changeIconDefault();
  void buttonClicked(bool);

private:
  QString textToCopy;
  QIcon iconEdit;
  QIcon iconEditPushed;
};

#endif // QPUSHBUTTONWITHCLIPBOARD_H_