QtPass  1.3.2
Multi-platform GUI for pass, the standard unix password manager.
qpushbuttonasqrcode.cpp
Go to the documentation of this file.
1 #include "qpushbuttonasqrcode.h"
2 #include <QTimer>
3 
12 QPushButtonAsQRCode::QPushButtonAsQRCode(const QString &textToCopy,
13  QWidget *parent)
14  : QPushButton(parent), textToCopy(textToCopy),
15  iconEdit(QIcon::fromTheme("qrcode", QIcon(":/icons/qrcode.svg"))) {
16  setIcon(iconEdit);
17  connect(this, SIGNAL(clicked(bool)), this, SLOT(buttonClicked(bool)));
18 }
19 
25 QString QPushButtonAsQRCode::getTextToCopy() const { return textToCopy; }
26 
32 void QPushButtonAsQRCode::setTextToCopy(const QString &value) {
33  textToCopy = value;
34 }
35 
40 void QPushButtonAsQRCode::buttonClicked(bool) { emit clicked(textToCopy); }
41 
46 void QPushButtonAsQRCode::changeIconDefault() { this->setIcon(iconEdit); }
QPushButtonAsQRCode::QPushButtonAsQRCode
QPushButtonAsQRCode(const QString &textToCopy="", QWidget *parent=nullptr)
QPushButtonAsQRCode::QPushButtonAsQRCode basic constructor.
Definition: qpushbuttonasqrcode.cpp:12
QPushButtonAsQRCode::clicked
void clicked(QString)
qpushbuttonasqrcode.h
QPushButtonAsQRCode::getTextToCopy
QString getTextToCopy() const
QPushButtonAsQRCode::getTextToCopy returns the text of associated text field.
Definition: qpushbuttonasqrcode.cpp:25
QPushButtonAsQRCode::setTextToCopy
void setTextToCopy(const QString &value)
QPushButtonAsQRCode::setTextToCopy sets text from associated text field.
Definition: qpushbuttonasqrcode.cpp:32