Widget used to enter passwords. Contains a line field for input and a button to show/ hide the password. Can be paired with another PasswordField as repetition check.
More...
#include <passwordfield.h>
|
void | passwordEdited (QString new_password) |
| Signals that the current password has been edited by the user.
|
|
void | passwordValidityChanged (bool is_valid) |
| Sent when the is_valid_ status of this field changes.
|
|
|
void | onPasswordEdited (QString new_password) |
| Updates the visual feedback for matching passwords.
|
|
void | onViewButtonPressed () |
| Toggles password visibility.
|
|
|
void | updateValidationStatus () |
| Updates the is_valid_ flag to be false if role_ == repeat and the passwords mismatch.
|
|
|
ValidatingLineEdit * | password_line_edit_ |
| Used for input. Gives visual feedback is this has a repeat role and the passwords dont match.
|
|
QPushButton * | view_button_ |
| Button used to show/ hide the password.
|
|
const QIcon | show_icon = QIcon::fromTheme("view-visible") |
| Icon used to indicate that the password is to be shown.
|
|
const QIcon | hide_icon = QIcon::fromTheme("view-hidden") |
| Icon used to indicate that the password is to be hidden.
|
|
PasswordField * | partner_ = nullptr |
| Partner PasswordField.
|
|
Role | role_ = main |
| Role if this field.
|
|
bool | is_valid_ = true |
| Always true if role_ == main. Else only true if both passwords match.
|
|
Widget used to enter passwords. Contains a line field for input and a button to show/ hide the password. Can be paired with another PasswordField as repetition check.
◆ Role
◆ PasswordField()
PasswordField::PasswordField |
( |
QWidget * | parent = nullptr | ) |
|
|
explicit |
Initializes the UI.
- Parameters
-
parent | Parent for this widget, this is passed to the constructor of QDialog. |
◆ getPassword()
QString PasswordField::getPassword |
( |
| ) |
const |
Returns the password currently in the password field..
- Returns
- The password.
◆ getPasswordLineEdit()
◆ onPartnerFieldChanged
void PasswordField::onPartnerFieldChanged |
( |
QString | new_password | ) |
|
|
slot |
Updates the visual feedback for matching passwords.
- Parameters
-
new_password | The new partner input. |
◆ onPasswordEdited
void PasswordField::onPasswordEdited |
( |
QString | new_password | ) |
|
|
privateslot |
Updates the visual feedback for matching passwords.
- Parameters
-
new_password | The new partner password. |
◆ passwordEdited
void PasswordField::passwordEdited |
( |
QString | new_password | ) |
|
|
signal |
Signals that the current password has been edited by the user.
- Parameters
-
new_password | The new password as entered by the user. |
◆ passwordValidityChanged
void PasswordField::passwordValidityChanged |
( |
bool | is_valid | ) |
|
|
signal |
Sent when the is_valid_ status of this field changes.
- Parameters
-
◆ setPartnerField()
Sets a partner PasswordField for repetition checking.
- Parameters
-
partner | The partner. |
partner_role | Role of the partner. |
The documentation for this class was generated from the following files: