Defer construction of TextEdit/TextInput delegates.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Fri, 4 May 2012 06:07:32 +0000 (16:07 +1000)
committerQt by Nokia <qt-info@nokia.com>
Sun, 13 May 2012 22:51:15 +0000 (00:51 +0200)
commitbd5e23a00e97603c1cc73328c508a044f1528802
tree8ffe4145ec6d62c5d9e0798af9d48c29d66ff176
parent6f9b3893c8c7bc0b6663acb34c17c120852ef7b7
Defer construction of TextEdit/TextInput delegates.

Don't create instances of the delegate components until the item
gains focus, or the cursorVisible property is set to true.

Cursor delegates are typically small and relatively fast to create and
so won't have a significant cost during a one off focus in event,
but that cost can still add up when creating a number of TextInputs
or TextEdits at once.  If a delegate that is instantiated immeditately
is required it is possible to instead create a child item and bind to
the cursorRectangle and cursorVisible properties.

Change-Id: I5ec2b5b6a30e534aee3dd5a58c6a5ac0686f5ce2
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
15 files changed:
src/quick/items/items.pri
src/quick/items/qquicktextedit.cpp
src/quick/items/qquicktextedit_p.h
src/quick/items/qquicktextedit_p_p.h
src/quick/items/qquicktextinput.cpp
src/quick/items/qquicktextinput_p.h
src/quick/items/qquicktextinput_p_p.h
src/quick/items/qquicktextutil.cpp [new file with mode: 0644]
src/quick/items/qquicktextutil_p.h [new file with mode: 0644]
tests/auto/quick/qquicktextedit/data/http/cursorHttpTest.qml
tests/auto/quick/qquicktextedit/data/http/cursorHttpTestFail1.qml
tests/auto/quick/qquicktextedit/data/http/cursorHttpTestFail2.qml
tests/auto/quick/qquicktextedit/data/http/cursorHttpTestPass.qml
tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp