[Qt-interest] Need some help about QLineEdit

Bo Thorsen bo at fioniasoftware.dk
Mon Oct 17 09:24:58 CEST 2011


Den 17-10-2011 08:08, Zeljko skrev:
> Girish Ramakrishnan wrote:
>> BTW, it looks like you just want a readOnly lineedit? Why would
>> someone disable cut/paste/copy in a editable lineedit? (I think
>> password mode edits have copy/paste disabled anyway)
>
> No, I don't wont "readonly" lineedit. I want to know when user
> copied/pasted/cutted something in/from QLineEdit and eventually forbid such op.

I intensely hate applications that do this. It's horrible to work with 
because I might know that what I'm writing will later fill your 
requirements for the contents of the line edit, but not while I'm typing 
it. And every single implementation of this kind of user annoyance 
sucks! Please don't do it.

The correct solution is to have a QValidator on the line edit and only 
enable the OK button (or whatever you do with the line edit) or just 
ignore the content changes when the validator doesn't accept it.

You're on the wrong track here, and the reason you have difficulties 
implementing your idea is that Qt is designed so well that it's 
difficult to implement this bad idea.

Bo Thorsen,
Fionia Software.

-- 

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk



More information about the Qt-interest-old mailing list