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

2008-11-12 Thread Derek Fountain
 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've not even played with QTextEdit as yet, but I notice it has a 
cursorPositionChanged() signal and a setReadOnly() method. So how about 
connecting that signal to a routine that switches the widget to read 
only when the cursor is moved into certain areas? Or maybe less 
confusingly for the user, don't actually allow the cursor into those 
areas in the first place?
___
Qt-jambi-interest mailing list
Qt-jambi-interest@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest


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

2008-11-11 Thread Gregor Mückl
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



signature.asc
Description: This is a digitally signed message part.
___
Qt-jambi-interest mailing list
Qt-jambi-interest@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest