ORE Studio 0.0.4
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
PasswordMatchIndicator Struct Reference

Helper for password confirmation match indicators. More...

#include <PasswordMatchIndicator.hpp>

Collaboration diagram for PasswordMatchIndicator:
Collaboration graph

Static Public Member Functions

static void updateFieldBorder (QLineEdit *field, const QString &password, const QString &confirm, const QString &defaultStyle={})
 Update the border colour of the confirm password field.
 
static void connectFields (QLineEdit *passwordField, QLineEdit *confirmField, const QString &defaultStyle={})
 Connect two password fields so the confirm field's border updates automatically on every keystroke.
 

Static Public Attributes

static const QString match_border_style
 
static const QString mismatch_border_style
 

Detailed Description

Helper for password confirmation match indicators.

Changes the confirm field's border colour to green when passwords match or red when they don't. Use connectFields to wire up the indicator automatically, or call updateFieldBorder manually.

Member Function Documentation

◆ updateFieldBorder()

static void updateFieldBorder ( QLineEdit *  field,
const QString &  password,
const QString &  confirm,
const QString &  defaultStyle = {} 
)
static

Update the border colour of the confirm password field.

Resets to the default style when confirm is empty, green border when passwords match, and red border when they don't.

Member Data Documentation

◆ match_border_style

const QString match_border_style
static
Initial value:
=
QStringLiteral("QLineEdit { border: 2px solid #4CAF50; }")

◆ mismatch_border_style

const QString mismatch_border_style
static
Initial value:
=
QStringLiteral("QLineEdit { border: 2px solid #cc0000; }")