Qt Utilities  5.8.2
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
Dialogs::EnterPasswordDialog Class Reference

The EnterPasswordDialog class provides a simple dialog to ask the user for a password. More...

#include <enterpassworddialog.h>

Inheritance diagram for Dialogs::EnterPasswordDialog:
[legend]
Collaboration diagram for Dialogs::EnterPasswordDialog:
[legend]

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...
 

Detailed Description

The EnterPasswordDialog class provides a simple dialog to ask the user for a password.

Definition at line 16 of file enterpassworddialog.h.

Constructor & Destructor Documentation

◆ EnterPasswordDialog()

Dialogs::EnterPasswordDialog::EnterPasswordDialog ( QWidget *  parent = nullptr)
explicit

Constructs a password dialog.

Parameters
parentSpecifies the parent widget.

Definition at line 36 of file enterpassworddialog.cpp.

◆ ~EnterPasswordDialog()

Dialogs::EnterPasswordDialog::~EnterPasswordDialog ( )

Destroys the password dialog.

Definition at line 77 of file enterpassworddialog.cpp.

Member Function Documentation

◆ description()

QString Dialogs::EnterPasswordDialog::description ( ) const

◆ event()

bool Dialogs::EnterPasswordDialog::event ( QEvent *  event)
protected

Definition at line 209 of file enterpassworddialog.cpp.

◆ eventFilter()

bool Dialogs::EnterPasswordDialog::eventFilter ( QObject *  sender,
QEvent *  event 
)
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.

◆ instruction()

const QString& Dialogs::EnterPasswordDialog::instruction ( ) const

◆ isCapslockPressed()

static bool Dialogs::EnterPasswordDialog::isCapslockPressed ( )
static

◆ isPasswordRequired()

bool Dialogs::EnterPasswordDialog::isPasswordRequired ( ) const

◆ isVerificationRequired()

bool Dialogs::EnterPasswordDialog::isVerificationRequired ( ) const

◆ password()

const QString& Dialogs::EnterPasswordDialog::password ( ) const

◆ promtForUserName()

bool Dialogs::EnterPasswordDialog::promtForUserName ( ) const

◆ setDescription()

void Dialogs::EnterPasswordDialog::setDescription ( const QString &  description = QString())

Sets the description.

See also
description()

Definition at line 95 of file enterpassworddialog.cpp.

◆ setInstruction()

void Dialogs::EnterPasswordDialog::setInstruction ( const QString &  value)

Sets the instruction text.

See also
EnterPasswordDialog::instruction()

Definition at line 198 of file enterpassworddialog.cpp.

◆ setPasswordRequired()

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.

See also
EnterPasswordDialog::isPasswordRequired()

Definition at line 158 of file enterpassworddialog.cpp.

◆ setPromptForUserName()

void Dialogs::EnterPasswordDialog::setPromptForUserName ( bool  prompt)

Sets whethere the dialog prompts for a user name as well.

See also
promptForUserName()

Definition at line 118 of file enterpassworddialog.cpp.

◆ setVerificationRequired()

void Dialogs::EnterPasswordDialog::setVerificationRequired ( bool  value)

Sets whether a verification (password has to be entered twice) is required.

See also
EnterPasswordDialog::isVerificationRequired()

Definition at line 184 of file enterpassworddialog.cpp.

◆ userName()

const QString& Dialogs::EnterPasswordDialog::userName ( ) const

Property Documentation

◆ description

QString Dialogs::EnterPasswordDialog::description
readwrite

Returns the description.

The description is shown under the instruction text.

See also
setDescription()

Definition at line 20 of file enterpassworddialog.h.

◆ instruction

const QString & Dialogs::EnterPasswordDialog::instruction
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.

See also
EnterPasswordDialog::setInstruction()

Definition at line 24 of file enterpassworddialog.h.

◆ isCapslockPressed

bool Dialogs::EnterPasswordDialog::isCapslockPressed
read

Returns an indication whether the capslock key is pressed using platform specific functions.

Remarks
  • Returns always false for unsupported platforms.
  • This method always returns false when the detection is not supported. It is supported under X11 and Windows.
  • The function requires the application to be linked against X11 on Linux/Unix.
  • This static function will be used internally to detect whether the capslock key is pressed when initializing the dialog.

Definition at line 25 of file enterpassworddialog.h.

◆ isPasswordRequired

bool Dialogs::EnterPasswordDialog::isPasswordRequired
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.

See also
EnterPasswordDialog::setPasswordRequired()

Definition at line 23 of file enterpassworddialog.h.

◆ isVerificationRequired

bool Dialogs::EnterPasswordDialog::isVerificationRequired
readwrite

Returns an indication whether a verification (password has to be entered twice) is required.

See also
EnterPasswordDialog::setVerificationRequired()

Definition at line 22 of file enterpassworddialog.h.

◆ password

const QString & Dialogs::EnterPasswordDialog::password
inlineread

Returns the entered password.

Definition at line 19 of file enterpassworddialog.h.

◆ promtForUserName

bool Dialogs::EnterPasswordDialog::promtForUserName
readwrite

Returns whether the dialogs prompts for a user name as well.

The dialog does not prompt for a user name by default.

See also
setPromptForUserName()

Definition at line 21 of file enterpassworddialog.h.

◆ userName

const QString & Dialogs::EnterPasswordDialog::userName
inlineread

Returns the entered user name.

Definition at line 18 of file enterpassworddialog.h.


The documentation for this class was generated from the following files: