Qt Utilities
5.8.1
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. More... | |
~EnterPasswordDialog () | |
Destroys the password dialog. More... | |
const QString & | userName () const |
const QString & | password () const |
QString | description () const |
void | setDescription (const QString &description=QString()) |
Sets the description. More... | |
bool | promtForUserName () const |
void | setPromptForUserName (bool prompt) |
Sets whethere the dialog prompts for a user name as well. More... | |
bool | isVerificationRequired () const |
void | setVerificationRequired (bool value) |
Sets whether a verification (password has to be entered twice) is required. More... | |
bool | isPasswordRequired () const |
void | setPasswordRequired (bool value) |
Sets whether the user is force to enter a password. More... | |
const QString & | instruction () const |
void | setInstruction (const QString &value) |
Sets the instruction text. More... | |
Static Public Member Functions | |
static bool | isCapslockPressed () |
Protected Member Functions | |
bool | event (QEvent *event) |
bool | eventFilter (QObject *sender, QEvent *event) |
Internal method to notice when the capslock key is pressed by the user. More... | |
Properties | |
QString | userName |
Returns the entered user name. More... | |
QString | password |
Returns the entered password. More... | |
QString | description |
Returns the description. More... | |
bool | promtForUserName |
Returns whether the dialogs prompts for a user name as well. More... | |
bool | isVerificationRequired |
Returns an indication whether a verification (password has to be entered twice) is required. More... | |
bool | isPasswordRequired |
Returns an indication whether the user is force to enter a password. More... | |
QString | instruction |
Returns the instruction text. More... | |
bool | isCapslockPressed |
Returns an indication whether the capslock key is pressed using platform specific functions. More... | |
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 36 of file enterpassworddialog.cpp.
Dialogs::EnterPasswordDialog::~EnterPasswordDialog | ( | ) |
Destroys the password dialog.
Definition at line 77 of file enterpassworddialog.cpp.
QString Dialogs::EnterPasswordDialog::description | ( | ) | const |
|
protected |
Definition at line 209 of file enterpassworddialog.cpp.
|
protected |
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 232 of file enterpassworddialog.cpp.
const QString& Dialogs::EnterPasswordDialog::instruction | ( | ) | const |
|
static |
bool Dialogs::EnterPasswordDialog::isPasswordRequired | ( | ) | const |
bool Dialogs::EnterPasswordDialog::isVerificationRequired | ( | ) | const |
const QString& Dialogs::EnterPasswordDialog::password | ( | ) | const |
bool Dialogs::EnterPasswordDialog::promtForUserName | ( | ) | const |
void Dialogs::EnterPasswordDialog::setDescription | ( | const QString & | description = QString() | ) |
void Dialogs::EnterPasswordDialog::setInstruction | ( | const QString & | value | ) |
Sets the instruction text.
Definition at line 198 of file enterpassworddialog.cpp.
void Dialogs::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 158 of file enterpassworddialog.cpp.
void Dialogs::EnterPasswordDialog::setPromptForUserName | ( | bool | prompt | ) |
Sets whethere the dialog prompts for a user name as well.
Definition at line 118 of file enterpassworddialog.cpp.
void Dialogs::EnterPasswordDialog::setVerificationRequired | ( | bool | value | ) |
Sets whether a verification (password has to be entered twice) is required.
Definition at line 184 of file enterpassworddialog.cpp.
const QString& Dialogs::EnterPasswordDialog::userName | ( | ) | const |
|
readwrite |
Returns the description.
The description is shown under the instruction text.
Definition at line 20 of file enterpassworddialog.h.
|
inlinereadwrite |
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 requried or not) displayed.
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 |
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 23 of file enterpassworddialog.h.
|
readwrite |
Returns an indication whether a verification (password has to be entered twice) is required.
Definition at line 22 of file enterpassworddialog.h.
|
inlineread |
Returns the entered password.
Definition at line 19 of file enterpassworddialog.h.
|
readwrite |
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 21 of file enterpassworddialog.h.
|
inlineread |
Returns the entered user name.
Definition at line 18 of file enterpassworddialog.h.