summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextcursor
Commit message (Collapse)AuthorAgeFilesLines
* Cursor positioning in QTextDocument after undo()mae2010-06-081-1/+17
| | | | | | | | | | | | | | | | | | | | | | | QTextDocument had no way of storing the cursor position from which a document change was initiated in the undo stack. That means that any undo operation would reposition the text cursor to the text position where the actual change happened. This works in many cases, but not always. In Qt Creator we have standard IDE shortcuts like e.g. Ctrl+Return for InsertLineBelowCurrentLine, which insert a newline at the end of the current line, not at the cursor position. Using undo there resulted in a surprisingly wrong cursor position. The problem becomes worse with more advanced refactoring and productivity tools (like snippets). The patch creates a synthetic CursorMoved undo item with the position which was current at the time of calling QTextCursor::beginEditBlock(), but only if necesary, i.e. only in those cases where the cursor would be positioned wrongly. Reviewed-by: Roberto Raggi
* Defines whether the cursor should keep its current position.Roberto Raggi2010-06-011-3/+5
| | | | | | | | | | | | | Defines whether the cursor should keep its position when text gets inserted at the current position of the cursor. For example, we don't want QTextCursor to extend the selection when inserting characters at the end of an extra selection representing a user-type but we do want the selection to grow when rewriting a region of code (e.g. when using our QuickFix engine). Task-number: QTBUG-11075 Reviewed-by: mae
* Fix QTextDocument::undo() cursor positioningmae2010-04-071-0/+34
| | | | | | | | | | | When doing block undo operations, QTextDocument used the change position of the last undo command for positioning the cursor. This is incorrect if the last commands are of type QTextUndoCommand::Removed but split because of the text fragments. The bug is highly noticable in creator when inserting snippets and doing undo afterwards. The change adds an auto test.
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | Reviewed-by: Trust Me
* Added auto test for the cursor position when doing block undo and redomae2009-12-041-1/+27
| | | | | | | | Block changes in different selections happens quite frequently with Qt Creator, e.g. when renaming local variables. This test tests the desired cursor position behaviour: after an undo, the cursor should be where it was when the block operation started. After a redo, the cursor should be where it was after the block operation ended.
* QTextCursor selection extension when inserting charactersmae2009-09-231-0/+94
| | | | | | | | | The change makes QTextCursor not extend the selection when inserting characters at the end of the selection, provided that the cursor position is at the end. Reviewed-by: Simon Hausmann Reviewed-by: Roberto Raggi
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* Update tech preview license header.Jason McDonald2009-08-311-13/+13
| | | | Reviewed-by: Trust Me
* Update license headers.Jason McDonald2009-08-111-1/+1
| | | | Reviewed-by: Trust Me
* Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
| | | | Reviewed-by: Trust Me
* Remove obsolete code from autotests.Jason McDonald2009-04-161-10/+0
| | | | | | | | Each version of Qt has its own set of autotests, therefore preprocessor directives relating to obsolete QT_VERSION's are not necessary. Reviewed-by: Carlos Duclos
* Long live Qt 4.5!Lars Knoll2009-03-233-0/+1678