![]() |
Banking_System_Client
1.0.0
Qt-based banking app for user/admin account management, transactions, secure server communication via PostgreSQL/Supabase.
|
The BaseDialog class provides a base class for creating dialogs with validation support. More...
#include <BaseDialog.h>
Public Member Functions | |
BaseDialog (QWidget *parent=nullptr) | |
Constructor for BaseDialog. More... | |
virtual QVariantMap | getData () const =0 |
Pure virtual function to get the data from the dialog. More... | |
Protected Member Functions | |
virtual void | setupUI ()=0 |
Pure virtual function to set up the user interface. | |
virtual void | connectSignals () |
Connects signals for the dialog. | |
QtMaterialTextField * | createInputField (QVBoxLayout *layout, const QString &labelText, IValidationStrategy *validationStrategy, bool isPassword=false) |
Creates an input field with validation. More... | |
void | validateInput (QtMaterialTextField *field) |
Validates the input of a specified field. More... | |
void | updateConfirmButtonState () |
Updates the state of the confirm button based on the validity of the form. | |
void | setFieldValidityStyle (QtMaterialTextField *field, QLabel *errorLabel, const QString &errorMessage, bool isValid) |
Sets the validity style of an input field. More... | |
Protected Attributes | |
QMap< QtMaterialTextField *, IValidationStrategy * > | validationStrategies_ |
Stores validation strategies for input fields. | |
QMap< QtMaterialTextField *, QLabel * > | errorLabels_ |
Stores error labels for input fields. | |
QtMaterialFlatButton * | confirmButton |
The confirm button. | |
QtMaterialFlatButton * | cancelButton |
The cancel button. | |
The BaseDialog class provides a base class for creating dialogs with validation support.
This class is responsible for setting up the user interface, connecting signals, and validating input fields.
BaseDialog::BaseDialog | ( | QWidget * | parent = nullptr | ) |
Constructor for BaseDialog.
parent | The parent widget. |
|
protected |
Creates an input field with validation.
layout | The layout to add the input field to. |
labelText | The text for the label associated with the input field. |
validationStrategy | The validation strategy for the input field. |
isPassword | Boolean flag to indicate if the input field is for password input. |
Referenced by UpdateEmailDialog::setupUI(), and UpdatePasswordDialog::setupUI().
|
pure virtual |
Pure virtual function to get the data from the dialog.
Implemented in UpdateUserDialog, UpdatePasswordDialog, UpdateEmailDialog, and CreateUserDialog.
|
protected |
Sets the validity style of an input field.
field | The input field to update. |
errorLabel | The label to display error messages. |
errorMessage | The error message to display. |
isValid | Boolean flag to indicate if the input is valid. |
Referenced by validateInput().
|
protected |
Validates the input of a specified field.
field | The input field to validate. |
Referenced by connectSignals().