/* Copyright (c) 2023, DyssolTEC. * All rights reserved. This file is part of Dyssol. See LICENSE file for license information. */ #pragma once #include template class CQtValidator : public QRegExpValidator { void fixup(QString& _input) const override { _input = "0"; } }; template<> class CQtValidator : public QRegExpValidator { public: explicit CQtValidator(QObject* _parent = nullptr) : QRegExpValidator(QRegExp{ "^([+-]?(?:[0-9]+\\.?|[0-9]*\\.[0-9]+))(?:[Ee][+-]?[0-9]+)?$" }, _parent) { } }; template<> class CQtValidator : public QRegExpValidator { public: explicit CQtValidator(QObject* _parent = nullptr) : QRegExpValidator(QRegExp{ "^([+-]?([\\d]+))([Ee][+]?[0-9]+)?$" }, _parent) { } }; template<> class CQtValidator : public QRegExpValidator { public: explicit CQtValidator(QObject* _parent = nullptr) : QRegExpValidator(QRegExp{ "^([+]?([\\d]+))([Ee][+]?[0-9]+)?$" }, _parent) { } };