QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
qpushbuttonshowpassword.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2020 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
8#ifndef SRC_QPUSHBUTTONSHOWPASSWORD_H_
9#define SRC_QPUSHBUTTONSHOWPASSWORD_H_
10
11#include <QLineEdit>
12#include <QPushButton>
13
14class QWidget;
28class QPushButtonShowPassword : public QPushButton {
29 Q_OBJECT
30
31public:
37 explicit QPushButtonShowPassword(QLineEdit *line, QWidget *parent = nullptr);
38
39signals:
44 void clicked(const QString &text);
45
46private slots:
52 void buttonClicked(bool checked);
53
54private:
56 QIcon iconEdit;
61 QLineEdit *line;
62};
63
64#endif // SRC_QPUSHBUTTONSHOWPASSWORD_H_
QPushButtonShowPassword(QLineEdit *line, QWidget *parent=nullptr)
Construct a show-password button linked to the given QLineEdit.
QIcon iconEditPushed
view-hidden icon shown while the password is revealed.
QIcon iconEdit
view-visible icon shown while the password is hidden.
void buttonClicked(bool checked)
Connected to QPushButton::clicked(bool); flips the echo mode of line and updates icon,...
QLineEdit * line
The line edit being toggled; owned by the caller, must outlive this button.
void clicked(const QString &text)
Emitted on button activation with the current text of the line edit.