Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
4.3.3
-
None
Description
An QDoubleValidator in addition with an inputmask on a lineedit is unsuable.
For example setting a QDoubleValidator and then the input mask, works.
But setting the input mask first then the validator, input does not work as expected.
//works
#include <QApplication>
#include <QDoubleValidator>
#include <QLineEdit>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLineEdit edit("0");
edit.setValidator(new QDoubleValidator(0.0, 999.0, 1, &edit));
edit.setInputMask("009.0");
edit.show();
return app.exec();
}
//does not work
#include <QApplication>
#include <QDoubleValidator>
#include <QLineEdit>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLineEdit edit("0");
edit.setInputMask("009.0");
edit.setValidator(new QDoubleValidator(0.0, 999.0, 1, &edit));
edit.show();
return app.exec();
}