QtPass  1.3.3
Multi-platform GUI for pass, the standard unix password manager.
qpushbuttonshowpassword.cpp
Go to the documentation of this file.
2 #include <QTimer>
3 
13  QWidget *parent)
14  : QPushButton(parent),
15  iconEdit(QIcon::fromTheme("show", QIcon(":/icons/view.svg"))),
16  iconEditPushed(QIcon::fromTheme("hide-new", QIcon(":/icons/hide.svg"))) {
17  setIcon(iconEdit);
18  connect(this, SIGNAL(clicked(bool)), this, SLOT(buttonClicked(bool)));
19  this->line = line;
20 }
21 
26 void QPushButtonShowPassword::buttonClicked(bool) {
27  if (this->line->echoMode() == QLineEdit::Password) {
28  this->line->setEchoMode(QLineEdit::Normal);
29  setIcon(iconEditPushed);
30  } else {
31  this->line->setEchoMode(QLineEdit::Password);
32  setIcon(iconEdit);
33  }
34 }
QPushButtonShowPassword::QPushButtonShowPassword
QPushButtonShowPassword(QLineEdit *line, QWidget *parent=nullptr)
QPushButtonAsQRCode::QPushButtonAsQRCode basic constructor.
Definition: qpushbuttonshowpassword.cpp:12
QPushButtonShowPassword::clicked
void clicked(QString)
qpushbuttonshowpassword.h