[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ktexteditor-devel
Subject:    Re: UndoInterface and ClipboardInterface alternatives in KDE4
From:       BtbN <btbn () btbn ! de>
Date:       2007-05-19 15:12:11
Message-ID: op.tskxulked0t2ll () highend
[Download RAW message or body]

I finally found out how it works.
Here are my solutions, if somebody is interested:

-------------------
Copy:
kapp->clipboard()->setText(view->selectionText());

Paste:
view->insertText(kapp->clipboard()->text());

Cut:
kapp->clipboard()->setText(view->selectionText());
view->removeSelectionText();

Undo:
QMetaObject::invokeMethod(view->document(),"undo");

Redo:
QMetaObject::invokeMethod(view->document(),"redo");
-------------------

And there seems to be a bug with the redo()-Function of KateDocument.
If i type in some lines, undo them , and then redo, the cursor gets to an  
invalid position, because he is moved to the end of the text, that should  
normaly be there.
The text gets there with the next redo. If you move the cursor, while he  
is at the invalid position, the app crahses.
_______________________________________________
KTextEditor-Devel mailing list
KTextEditor-Devel@kde.org
https://mail.kde.org/mailman/listinfo/ktexteditor-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic