This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Single line text area, not editable, but selectable

Tags: None
(comma "," separated)
deadeyes
Registered Member
Posts
34
Karma
0
Hi all,

I am having another specific need for my application.
I want to have a textbox where the contents can be selected by your mouse, but that can't be edited.
I tried using enabled=false but then I can't select the text in the textbox.

It is probably someone already has encountered.

Thanks in advance for your help!
pinotree
KDE Developer
Posts
222
Karma
7
OS
Usually, text edit widgets do provide a "readOnly" property which makes the content read-only, leaving the widget enabled. If the text widget you are using has this property, then it's your solution.


Pino Toscano
deadeyes
Registered Member
Posts
34
Karma
0
deadeyes wrote:Hi all,

I am having another specific need for my application.
I want to have a textbox where the contents can be selected by your mouse, but that can't be edited.
I tried using enabled=false but then I can't select the text in the textbox.

It is probably someone already has encountered.

Thanks in advance for your help!


That did the trick :)
setEnabled(true);
setReadOnly(true);

Done :)

Thanks!


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft