From 1a1a19f74e7f55388da043ae1e2e34e334d5f740 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 23 Sep 2014 15:53:49 +0200 Subject: EditMenu: let menu property be a component to lazy load it Since all input fields have a menu assigned to it by default (which in most cases never will be shown), it should be an optimization to await creating it until needed. Change-Id: I5777bbdae42103981e9b2f5ddfdfd763acea07ae Reviewed-by: J-P Nurmi --- examples/quick/controls/gallery/main.qml | 36 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'examples') diff --git a/examples/quick/controls/gallery/main.qml b/examples/quick/controls/gallery/main.qml index 0a385a1b..a6f4ce39 100644 --- a/examples/quick/controls/gallery/main.qml +++ b/examples/quick/controls/gallery/main.qml @@ -140,25 +140,27 @@ ApplicationWindow { ChildWindow { id: window1 } - Menu { + Component { id: editmenu - MenuItem { action: cutAction } - MenuItem { action: copyAction } - MenuItem { action: pasteAction } - MenuSeparator {} Menu { - title: "Text &Format" - MenuItem { action: a1 } - MenuItem { action: a2 } - MenuItem { action: a3 } - MenuSeparator { } - MenuItem { text: "Allow &Hyphenation"; checkable: true } - } - Menu { - title: "Font &Style" - MenuItem { text: "&Bold"; checkable: true } - MenuItem { text: "&Italic"; checkable: true } - MenuItem { text: "&Underline"; checkable: true } + MenuItem { action: cutAction } + MenuItem { action: copyAction } + MenuItem { action: pasteAction } + MenuSeparator {} + Menu { + title: "Text &Format" + MenuItem { action: a1 } + MenuItem { action: a2 } + MenuItem { action: a3 } + MenuSeparator { } + MenuItem { text: "Allow &Hyphenation"; checkable: true } + } + Menu { + title: "Font &Style" + MenuItem { text: "&Bold"; checkable: true } + MenuItem { text: "&Italic"; checkable: true } + MenuItem { text: "&Underline"; checkable: true } + } } } -- cgit v1.2.1