I'm using Qt Designer to create some forms and i have one QLineEdit field whiche i would like it to be not selectable.
could anyone help me??
thanks so much
I'm using Qt Designer to create some forms and i have one QLineEdit field whiche i would like it to be not selectable.
could anyone help me??
thanks so much
What do you mean by not selectable?
Maybe you need some other widget (i saw in another topic, that you want a not editable QLineEdit) if you tell us what you are trying to achieve, maybe we can give better advices.
pakine (25th August 2010)
If you mean text selection: reimp mouse press/move event and ignore it.
pakine (25th August 2010)
yeah, i wanted to mean, disabling to select the text inside with the mouse. i should reimplement press/move events.
thanks everybody
I know that the thread is old but it still appears in Google.
So, I used
Qt Code:
self.lineEdit.selectionChanged.connect(lambda: self.lineEdit.setSelection(0, 0))To copy to clipboard, switch view to plain text mode
You can use a QLabel if you don't want people to edit your text. A line edit is used for taking input.
If you want to it to be editable only at certain times, you can just update the label .
Bookmarks