diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-05-04 16:07:32 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-14 00:51:15 +0200 |
commit | bd5e23a00e97603c1cc73328c508a044f1528802 (patch) | |
tree | 8ffe4145ec6d62c5d9e0798af9d48c29d66ff176 /tests/auto/quick/qquicktextedit/data | |
parent | 6f9b3893c8c7bc0b6663acb34c17c120852ef7b7 (diff) |
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>
Diffstat (limited to 'tests/auto/quick/qquicktextedit/data')
4 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktextedit/data/http/cursorHttpTest.qml b/tests/auto/quick/qquicktextedit/data/http/cursorHttpTest.qml index be4526e22b..043304d027 100644 --- a/tests/auto/quick/qquicktextedit/data/http/cursorHttpTest.qml +++ b/tests/auto/quick/qquicktextedit/data/http/cursorHttpTest.qml @@ -9,14 +9,18 @@ Rectangle { width: 300; height: 300; color: "white" ] TextEdit { cursorDelegate: cursorFail + cursorVisible: true } TextEdit { cursorDelegate: cursorWait + cursorVisible: true } TextEdit { cursorDelegate: cursorNorm + cursorVisible: true } TextEdit { cursorDelegate: cursorErr + cursorVisible: true } } diff --git a/tests/auto/quick/qquicktextedit/data/http/cursorHttpTestFail1.qml b/tests/auto/quick/qquicktextedit/data/http/cursorHttpTestFail1.qml index 1d7763f913..a6556454fe 100644 --- a/tests/auto/quick/qquicktextedit/data/http/cursorHttpTestFail1.qml +++ b/tests/auto/quick/qquicktextedit/data/http/cursorHttpTestFail1.qml @@ -8,11 +8,14 @@ Rectangle { width: 300; height: 300; color: "white" ] TextEdit { cursorDelegate: cursorFail + cursorVisible: true } TextEdit { cursorDelegate: cursorWait + cursorVisible: true } TextEdit { cursorDelegate: cursorNorm + cursorVisible: true } } diff --git a/tests/auto/quick/qquicktextedit/data/http/cursorHttpTestFail2.qml b/tests/auto/quick/qquicktextedit/data/http/cursorHttpTestFail2.qml index c82ec02e68..9429779a87 100644 --- a/tests/auto/quick/qquicktextedit/data/http/cursorHttpTestFail2.qml +++ b/tests/auto/quick/qquicktextedit/data/http/cursorHttpTestFail2.qml @@ -8,11 +8,14 @@ Rectangle { width: 300; height: 300; color: "white" ] TextEdit { cursorDelegate: cursorWait + cursorVisible: true } TextEdit { cursorDelegate: cursorNorm + cursorVisible: true } TextEdit { cursorDelegate: cursorErr + cursorVisible: true } } diff --git a/tests/auto/quick/qquicktextedit/data/http/cursorHttpTestPass.qml b/tests/auto/quick/qquicktextedit/data/http/cursorHttpTestPass.qml index 96d582c95d..69e498ef8d 100644 --- a/tests/auto/quick/qquicktextedit/data/http/cursorHttpTestPass.qml +++ b/tests/auto/quick/qquicktextedit/data/http/cursorHttpTestPass.qml @@ -8,10 +8,12 @@ Rectangle { width: 300; height: 300; color: "white" TextEdit { cursorDelegate: cursorWait text: "Hello" + cursorVisible: true } TextEdit { objectName: "textEditObject" cursorDelegate: cursorNorm + cursorVisible: true focus: true; text: "Hello" } |