QPushButton that toggles visibility of an associated QLineEdit.
More...
#include <qpushbuttonshowpassword.h>
|
| void | clicked (const QString &text) |
| | Emitted on button activation with the current text of the line edit.
|
|
| | QPushButtonShowPassword (QLineEdit *line, QWidget *parent=nullptr) |
| | Construct a show-password button linked to the given QLineEdit.
|
|
| void | buttonClicked (bool checked) |
| | Connected to QPushButton::clicked(bool); flips the echo mode of line and updates icon, tooltip and accessible name accordingly.
|
|
| 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.
◆ QPushButtonShowPassword()
| QPushButtonShowPassword::QPushButtonShowPassword |
( |
QLineEdit * | line, |
|
|
QWidget * | parent = nullptr ) |
|
explicit |
Construct a show-password button linked to the given QLineEdit.
- Parameters
-
| line | QLineEdit whose contents are shown or hidden by this button. |
| parent | Optional parent widget. |
Definition at line 11 of file qpushbuttonshowpassword.cpp.
◆ buttonClicked
| void QPushButtonShowPassword::buttonClicked |
( |
bool | checked | ) |
|
|
privateslot |
Connected to QPushButton::clicked(bool); flips the echo mode of line and updates icon, tooltip and accessible name accordingly.
- Parameters
-
| checked | Unused; the state is read from the line edit. |
Definition at line 27 of file qpushbuttonshowpassword.cpp.
◆ clicked
| void QPushButtonShowPassword::clicked |
( |
const QString & | text | ) |
|
|
signal |
Emitted on button activation with the current text of the line edit.
- Parameters
-
| text | Current text of the associated QLineEdit. |
◆ iconEdit
| QIcon QPushButtonShowPassword::iconEdit |
|
private |
◆ iconEditPushed
| QIcon QPushButtonShowPassword::iconEditPushed |
|
private |
◆ line
| QLineEdit* QPushButtonShowPassword::line |
|
private |
The documentation for this class was generated from the following files: