I've set up a validator on a QLineEdit for entering a time interval:
QRegExp exp("\\d\\d:[0-5]\\d:[0-5]\\d");
QRegExp exp("\\d\\d:[0-5]\\d:[0-5]\\d");
lineEdit_->setValidator(new QRegExpValidator(exp, this));
To copy to clipboard, switch view to plain text mode
This works just fine. The problem is when I try to add an input mask. I want the colons to show up automatically. I tried:
lineEdit_->setInputMask("99:99:99");
lineEdit_->setInputMask("99:99:99");
To copy to clipboard, switch view to plain text mode
to no avail. It won't let me enter anything. Anyone have any insight as to the proper way to mix validators and masks?
Also, if I call lineEdit_->setValidator(0), will it automatically delete the validator object that was previously being used or is there a memory leak if I don't delete it myself?
Thanks.
Bookmarks