I'm having trouble validating price.
Example accepted price: 10,00 / 100,00 / 1.000,00
Not accepted: 10 / 100 / 1000.00
Code, but this passing 100 / 10 / 1000.00
bool ok;
QLocale::setDefault(QLocale(QLocale::Portuguese, QLocale::Brazil));
QLocale brazil; // Constructs a default QLocale
QString text;
if(ui->price->text().length() <= 2){
qDebug() << text.sprintf("%6.2f", ui->price->text().toDouble()); //format 50 = 50.00
}
brazil.toDouble(ui->price->text(), &ok);
qDebug() << ok;