1 Attachment(s)
How can I implement a dialog like Windows when I input an invalid file name?
Hi guys,
I'm a QT programmer, now I need to enable users to specify a name for an object in my program. There's a rule that the name can only contain several characters, and if user inputs an invalid character, I want to pop up a dialog to indicate the error, like Windows does (see the attached image). I have implemented a sub-class deriving from QRegExpValidator, and can successfully obtain the signal when it fails to validate. But how can I implement a dialog like this? Anyone has any idea about this?
Thanks in advance.Attachment 7008
Re: How can I implement a dialog like Windows when I input an invalid file name?
It think QToolTip will do the trick for you
Re: How can I implement a dialog like Windows when I input an invalid file name?
Can you explain the detail? I've tried QToolTip like this: lineEdit->setToolTip(tr("Please input valid characters")); but it doesn't work:(
Quote:
Originally Posted by
nish
It think QToolTip will do the trick for you
Re: How can I implement a dialog like Windows when I input an invalid file name?
show the tooltip when you get a signal from your QRegExpValidator using QToolTip::showText