A class that provides a QValidator to validate emails
Can be used just like any QValidator.
The package is provided as a qpm package,
co.podzim.qemailvalidator
.
To install:
- Install qpm (See GitHub - Installing, for windows see below)
- In your projects root directory, run
qpm install co.podzim.qemailvalidator
- Include qpm to your project by adding
include(vendor/vendor.pri)
to your.pro
file
import QEmailValidator 1.0
TextField {
id: emailField
placeholderText: qsTr("Email")
validator: QEmailValidator{}
}
Label {
id: emailError
visible: emailField.acceptableInput // only show if email is invalid
color: "red"
text: "Invalid Email"
}
Check their GitHub - Usage for App Developers to learn more about qpm.
Important for Windows users: QPM Version 0.10.0 (the one you can download on the website) is currently broken on windows! It's already fixed in master, but not released yet. Until a newer versions gets released, you can download the latest dev build from here: