From 9d73bf289e2719d781670baad1733989a56d7f40 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Tue, 10 Jan 2012 11:52:43 +1000 Subject: Add undo and redo functions to TextInput and TextEdit. The functionality already existed and was usable through keyboard short cuts but was not accessible through API. Task-number: QTBUG-16191 Change-Id: I080fa2ddb76668a7a632aa7477004f99037ea68b Reviewed-by: Martin Jones --- src/quick/items/qquicktextinput_p_p.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/quick/items/qquicktextinput_p_p.h') diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h index b20b8c44f2..03d825d108 100644 --- a/src/quick/items/qquicktextinput_p_p.h +++ b/src/quick/items/qquicktextinput_p_p.h @@ -113,6 +113,8 @@ public: , selectByMouse(false) , canPaste(false) , canPasteValid(false) + , canUndo(false) + , canRedo(false) , hAlignImplicit(true) , selectPressed(false) , textLayoutDirty(true) @@ -237,6 +239,8 @@ public: bool selectByMouse:1; bool canPaste:1; bool canPasteValid:1; + bool canUndo:1; + bool canRedo:1; bool hAlignImplicit:1; bool selectPressed:1; bool textLayoutDirty:1; @@ -349,8 +353,6 @@ public: void insert(const QString &); void clear(); - void undo() { internalUndo(); finishChange(-1, true); } - void redo() { internalRedo(); finishChange(); } void selectWordAtPos(int); void setCursorPosition(int pos) { if (pos <= m_text.length()) moveCursor(qMax(0, pos)); } @@ -422,6 +424,7 @@ private: void internalUndo(int until = -1); void internalRedo(); + void emitUndoRedoChanged(); void emitCursorPositionChanged(); -- cgit v1.2.3