QtPass 1.4.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
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
26void 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(QLineEdit *line, QWidget *parent=nullptr)
QPushButtonAsQRCode::QPushButtonAsQRCode basic constructor.