Ok, solved.
anda_skoa, The ui->object->clear() was an desperate act (kkk) when the clearmask not worked, sorry, my bad.
In my original code, i was setted the input mask in the form, in this format: phone: (xx)xxxx-xxxx, date: xx/xx/xxxx (and the clearMask() do not worked on code)
so i had to change my approach. I set up the mask in my form initialization as the ChrisW67 sugestion:
ui->leTelefone->setInputMask("(00)0000-0000;_");
ui->leAniversaio->setInputMask("00/00/0000;_");
ui->leTelefone->setInputMask("(00)0000-0000;_");
ui->leAniversaio->setInputMask("00/00/0000;_");
To copy to clipboard, switch view to plain text mode
And before insert or update the data in database, i made this verification:
if (ui->leTelefone->text() == "()-")
ui->leTelefone->setInputMask(""); // prevent to insert only the mask in database
if (ui->leAniversaio->text() == "//")
ui->leAniversaio->setInputMask("");
if (ui->leTelefone->text() == "()-")
ui->leTelefone->setInputMask(""); // prevent to insert only the mask in database
if (ui->leAniversaio->text() == "//")
ui->leAniversaio->setInputMask("");
To copy to clipboard, switch view to plain text mode
I don't know if this is the correct approach, but it worked!
thanks a lot!
Juliano
Bookmarks