# HG changeset patch # User Matti Hamalainen # Date 1491742446 -10800 # Node ID 597bf29c58984abe1d37d454f6a0f97d91f0c2c5 # Parent 7c507c1d30e958ce10b269829a1adf60af7bc9c8 Use a better validator (regexp) for the amount input field. diff -r 7c507c1d30e9 -r 597bf29c5898 main.cpp --- a/main.cpp Sun Apr 09 15:23:52 2017 +0300 +++ b/main.cpp Sun Apr 09 15:54:06 2017 +0300 @@ -226,9 +226,13 @@ ui->button_LogoImage->setPixmap(logoImage); ui->button_LogoImage->setAlignment(Qt::AlignCenter); - ui->edit_Amount->setValidator(new QDoubleValidator(0, 1000, 2, this)); setCommonStyleSheet(this); + // Validator for amount input + //ui->edit_Amount->setValidator(new QDoubleValidator(0, 1000, 2, this)); + QRegExp vregex("\\d{0,4}[,.]\\d{0,2}|\\d{0,4}"); + ui->edit_Amount->setValidator(new QRegExpValidator(vregex, this)); + // Setup person list filtering and sorting peopleSortIndex = 1; peopleSortOrder = Qt::AscendingOrder;