[PyQt] QsciScintilla with multiple documents
Phil Thompson
phil at riverbankcomputing.com
Tue Apr 23 11:26:44 BST 2013
On Tue, 23 Apr 2013 14:53:13 +0430, Lee Harr <missive at hotmail.com> wrote:
>> > With the QTextEdit there is a separate QTextDocument that can
>> > be swapped in and out to make a multi-document editor.
>> >
>> > I am trying to switch over to QsciScintilla but am having trouble
>> > achieving the same effect.
>> >
>> > Does the QsciDocument serve the same purpose as QTextDocument?
>> > The online documentation for QsciDocument is very sparse. It says
>> > it is for having multiple QsciScintilla viewing the same document
>> > which is sort of the opposite of what I want.
>> >
>> > Should I just be creating multiple QsciScintilla to make the multiple
>> > document system? Or am I missing something more like QTextDocument?
>>
>> Just use setText().
>
>
> But what about the undo information?
>
> With QTextDocument, each document has its own undo
> stack (which is what you want for a multi-document editor)
> but when I setText() on the QsciScintilla the undo information
> is lost.
>
> Is there a way to save the undo stack? The only undo-related
> methods I see are undo() and begin- and end- UndoAction()
No, the underlying Scintilla code doesn't support it.
Phil
More information about the PyQt
mailing list