I would like to know how to validate the price on Qt, as follows:
Examples accepted: 10,00
/ 100,00
/ 1.000,00 = true
My code, (but is validating true: 10
/ 100
)
bool ok;
QLocale::setDefault(QLocale(QLocale::Portuguese, QLocale::Brazil));
QLocale brazil; // Constructs a default QLocale
brazil.toDouble(ui->price->text(), &ok);
qDebug() << ok;