[Qt-jambi-interest] Making sections of text in a QTextEdit uneditable

Gregor Mückl GregorMueckl at gmx.de
Wed Nov 12 01:50:04 CET 2008


Hi!

As far as crazy ideas go, this one is probably shooting for the top 10: I want 
to show the user a text edit control with a fragment of source code. Parts of 
that fragment are shown only as a convenience to provide context information 
and should not be altered by the user. So this means that there are about 1 or 
2 lines at the start and at the end of the fragment which should not be 
editable by the user (while the middle section is fully editable).

I have thought about separate text labels above and below the editable 
fragment, but I consider this to be a less elegant solution than having it all 
in one widget, in which the content would scroll consistently if the fragment 
gets longer.

Is something like this possible at all (without totally reimplementing 
QTextEdtir, of course)? What trickery would be required to make this work?

Regards,
Gregor

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt.nokia.com/pipermail/qt-jambi-interest/attachments/20081112/f4ab9735/attachment.bin 


More information about the Qt-jambi-interest mailing list