From 4598939ee2fad1238609ca43717199fd4e98c75f Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 5 Jul 2012 10:18:43 +1000 Subject: Speed up TextEdit construction time. Defer setting content on the QTextDocument until componentComplete() to avoid unnecessary layouts and move one time setup for the text document from setContent to the constructor. Reduces the construction time of a TextEdit with RichText textFormat by about a third. Change-Id: Idde0772063bf769cde984efddd68589c55a7431a Reviewed-by: Martin Jones --- src/quick/items/qquicktextedit_p_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick/items/qquicktextedit_p_p.h') diff --git a/src/quick/items/qquicktextedit_p_p.h b/src/quick/items/qquicktextedit_p_p.h index 1fb82110ea..6e15736b0b 100644 --- a/src/quick/items/qquicktextedit_p_p.h +++ b/src/quick/items/qquicktextedit_p_p.h @@ -82,7 +82,7 @@ public: , documentDirty(true), dirty(false), richText(false), cursorVisible(false), cursorPending(false) , focusOnPress(true), persistentSelection(false), requireImplicitWidth(false) , selectByMouse(false), canPaste(false), canPasteValid(false), hAlignImplicit(true) - , textCached(false), inLayout(false) + , textCached(true), inLayout(false) { } -- cgit v1.2.3