How do I make a check in a form that is not clicked the OK button if there is any field empty (null or blank)?
How do I make a check in a form that is not clicked the OK button if there is any field empty (null or blank)?
Disable the button by default and only enable it when you know all the fields are filled in to your satisfaction? Maybe you could use the focusOut to detect when a field has been completed and then check the contents before enabling the button. If you want it to enable as the user is typing you could install a simple keyPress event filter that does the checking per keypress.
Look into QValidator and QLineEdit::setValidator().
Horse sense is the thing that keeps horses from betting on people. --W.C. Fields
Ask Smart Questions
I'd suggest doing it in a similar fashion QWizardPage does it - using signals and slots.
Bookmarks