|
QtPass 2.0.0
Developer documentation
|
QPushButton that toggles visibility of an associated QLineEdit. More...
#include <qpushbuttonshowpassword.h>
Public Member Functions | |
| QPushButtonShowPassword (QLineEdit *line, QWidget *parent=nullptr) | |
| Construct a show-password button linked to the given QLineEdit. | |
Private Slots | |
| void | buttonClicked (bool checked) |
| Connected to QPushButton::clicked(bool); flips the echo mode of line and updates icon, tooltip and accessible name accordingly. | |
Private Attributes | |
| QIcon | iconEdit |
| view-visible icon shown while the password is hidden. | |
| QIcon | iconEditPushed |
| view-hidden icon shown while the password is revealed. | |
| QLineEdit * | line |
| The line edit being toggled; owned by the caller, must outlive this button. | |
QPushButton that toggles visibility of an associated QLineEdit.
The button is icon-only and bound to one QLineEdit for its lifetime. Each click flips that line edit between QLineEdit::Password and QLineEdit::Normal echo mode and swaps the icon, tooltip and accessible name between "Show password" and "Hide password" to match. It is driven entirely by its own QPushButton::clicked signal; the owner only has to create it next to the line edit (PasswordDisplayPanel does this for the masked password row of a decrypted entry).
Definition at line 28 of file qpushbuttonshowpassword.h.
|
explicit |
Construct a show-password button linked to the given QLineEdit.
| line | QLineEdit whose contents are shown or hidden by this button. |
| parent | Optional parent widget. |
Definition at line 11 of file qpushbuttonshowpassword.cpp.
|
privateslot |
Connected to QPushButton::clicked(bool); flips the echo mode of line and updates icon, tooltip and accessible name accordingly.
| checked | Unused; the state is read from the line edit. |
Definition at line 27 of file qpushbuttonshowpassword.cpp.
|
private |
view-visible icon shown while the password is hidden.
Definition at line 49 of file qpushbuttonshowpassword.h.
|
private |
view-hidden icon shown while the password is revealed.
Definition at line 51 of file qpushbuttonshowpassword.h.
|
private |
The line edit being toggled; owned by the caller, must outlive this button.
Definition at line 54 of file qpushbuttonshowpassword.h.