Qt Utilities 6.14.4
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
|
The EnterPasswordDialog class provides a simple dialog to ask the user for a password. More...
#include <enterpassworddialog.h>
Public Member Functions | |
EnterPasswordDialog (QWidget *parent=nullptr) | |
Constructs a password dialog. | |
~EnterPasswordDialog () override | |
Destroys the password dialog. | |
const QString & | userName () const |
Returns the entered user name. | |
const QString & | password () const |
Returns the entered password. | |
QString | description () const |
Returns the description. | |
void | setDescription (const QString &description=QString()) |
Sets the description. | |
bool | promtForUserName () const |
Returns whether the dialogs prompts for a user name as well. | |
void | setPromptForUserName (bool prompt) |
Sets whethere the dialog prompts for a user name as well. | |
bool | isVerificationRequired () const |
Returns an indication whether a verification (password has to be entered twice) is required. | |
void | setVerificationRequired (bool value) |
Sets whether a verification (password has to be entered twice) is required. | |
bool | isPasswordRequired () const |
Returns an indication whether the user is force to enter a password. | |
void | setPasswordRequired (bool value) |
Sets whether the user is force to enter a password. | |
const QString & | instruction () const |
Returns the instruction text. | |
void | setInstruction (const QString &value) |
Sets the instruction text. | |
Static Public Member Functions | |
static bool | isCapslockPressed () |
Protected Member Functions | |
bool | event (QEvent *event) override |
bool | eventFilter (QObject *sender, QEvent *event) override |
Internal method to notice when the capslock key is pressed by the user. | |
Properties | |
QString | userName |
QString | password |
QString | description |
bool | promtForUserName |
bool | isVerificationRequired |
bool | isPasswordRequired |
QString | instruction |
bool | isCapslockPressed |
Returns an indication whether the capslock key is pressed using platform specific functions. | |
The EnterPasswordDialog class provides a simple dialog to ask the user for a password.
Definition at line 16 of file enterpassworddialog.h.
|
explicit |
Constructs a password dialog.
parent | Specifies the parent widget. |
Definition at line 37 of file enterpassworddialog.cpp.
|
override |
Destroys the password dialog.
Definition at line 73 of file enterpassworddialog.cpp.
QString QtUtilities::EnterPasswordDialog::description | ( | ) | const |
Returns the description.
The description is shown under the instruction text.
Definition at line 82 of file enterpassworddialog.cpp.
|
overrideprotected |
Definition at line 205 of file enterpassworddialog.cpp.
|
overrideprotected |
Internal method to notice when the capslock key is pressed by the user.
Invocation of this method is done by installing the event filter in the constructor.
Definition at line 234 of file enterpassworddialog.cpp.
|
inline |
Returns the instruction text.
The instruction text is displayed at the top of the dialog. If the instruction text is empty the default text "Enter the new password" or "Enter the password" (depending on whether the verification is required or not) displayed.
Definition at line 87 of file enterpassworddialog.h.
|
static |
bool QtUtilities::EnterPasswordDialog::isPasswordRequired | ( | ) | const |
Returns an indication whether the user is force to enter a password.
If no password is required, the user is allowed to skip the dialog without entering a password.
Definition at line 140 of file enterpassworddialog.cpp.
bool QtUtilities::EnterPasswordDialog::isVerificationRequired | ( | ) | const |
Returns an indication whether a verification (password has to be entered twice) is required.
Definition at line 126 of file enterpassworddialog.cpp.
|
inline |
Returns the entered password.
Definition at line 72 of file enterpassworddialog.h.
bool QtUtilities::EnterPasswordDialog::promtForUserName | ( | ) | const |
Returns whether the dialogs prompts for a user name as well.
The dialog does not prompt for a user name by default.
Definition at line 105 of file enterpassworddialog.cpp.
void QtUtilities::EnterPasswordDialog::setDescription | ( | const QString & | description = QString() | ) |
void QtUtilities::EnterPasswordDialog::setInstruction | ( | const QString & | value | ) |
Sets the instruction text.
Definition at line 194 of file enterpassworddialog.cpp.
void QtUtilities::EnterPasswordDialog::setPasswordRequired | ( | bool | value | ) |
Sets whether the user is force to enter a password.
If no password is required, the user is allowed to skip the dialog without entering a password.
Definition at line 154 of file enterpassworddialog.cpp.
void QtUtilities::EnterPasswordDialog::setPromptForUserName | ( | bool | prompt | ) |
Sets whethere the dialog prompts for a user name as well.
Definition at line 114 of file enterpassworddialog.cpp.
void QtUtilities::EnterPasswordDialog::setVerificationRequired | ( | bool | value | ) |
Sets whether a verification (password has to be entered twice) is required.
Definition at line 180 of file enterpassworddialog.cpp.
|
inline |
Returns the entered user name.
Definition at line 64 of file enterpassworddialog.h.
|
readwrite |
Definition at line 20 of file enterpassworddialog.h.
|
readwrite |
Definition at line 24 of file enterpassworddialog.h.
|
read |
Returns an indication whether the capslock key is pressed using platform specific functions.
Definition at line 25 of file enterpassworddialog.h.
|
readwrite |
Definition at line 23 of file enterpassworddialog.h.
|
readwrite |
Definition at line 22 of file enterpassworddialog.h.
|
read |
Definition at line 19 of file enterpassworddialog.h.
|
readwrite |
Definition at line 21 of file enterpassworddialog.h.
|
read |
Definition at line 18 of file enterpassworddialog.h.