If we really want to be strict about URL validation, I think we shouldn’t reinvent the wheel. QUrl provides us everything we need to parse a URL from a string and check whether it’s valid. Unfortunately it’s not exposed to QML (the url type in QML doesn’t match our needs), so we’d need to expose a C++ helper to QML to validate a given URL.
If we really want to be strict about URL validation, I think we shouldn’t reinvent the wheel. QUrl provides us everything we need to parse a URL from a string and check whether it’s valid. Unfortunately it’s not exposed to QML (the url type in QML doesn’t match our needs), so we’d need to expose a C++ helper to QML to validate a given URL.