summaryrefslogtreecommitdiff
path: root/src/controls/Private/EditMenu.qml
diff options
context:
space:
mode:
authorMarco Martin <mart@kde.org>2015-08-06 14:03:59 +0200
committerMarco Martin <mart@kde.org>2015-08-07 08:19:29 +0000
commit966a053e7689f41807d8994a93d5fd3952e09932 (patch)
tree2fd0dd8687a87c5a957e6cdfcac0421b9d94af7b /src/controls/Private/EditMenu.qml
parent485d039e7b8ddb150b0f9723cfb08815eb843cba (diff)
downloadqtquickcontrols-966a053e7689f41807d8994a93d5fd3952e09932.tar.gz
Allow for styles to provide own EditMenu
Allow for styles to define their own EditMenu component, to provide cut/copy/paste actions with the platform style. In order to be able to provide mobile-optimized controls on Linux systems, use the boolean env var QT_MOBILE_PLATFORM in this case. This allows on a plain Linux system to offer controls with the touch friendly text selection handles and the little inline cut/copy/paste menu Change-Id: Id9013b4386423938735390325a003fcccdcfd598 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Diffstat (limited to 'src/controls/Private/EditMenu.qml')
-rw-r--r--src/controls/Private/EditMenu.qml13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/controls/Private/EditMenu.qml b/src/controls/Private/EditMenu.qml
index 51abe758..dc3ba64a 100644
--- a/src/controls/Private/EditMenu.qml
+++ b/src/controls/Private/EditMenu.qml
@@ -45,7 +45,7 @@ Loader {
property Item selectionHandle
property Flickable flickable
property Component defaultMenu: item && item.defaultMenu ? item.defaultMenu : null
- property Menu menuInstance: null
+ property QtObject menuInstance: null
property MouseArea mouseArea
Connections {
@@ -67,6 +67,13 @@ Loader {
return menuInstance;
}
- source: Qt.resolvedUrl(Qt.platform.os === "ios" ? "EditMenu_ios.qml"
- : Qt.platform.os === "android" ? "" : "EditMenu_base.qml")
+ Component.onCompleted: {
+ if (__style.__editMenu) {
+ sourceComponent = __style.__editMenu;
+ } else {
+ // todo: get ios/android/base menus from style as well
+ source = (Qt.resolvedUrl(Qt.platform.os === "ios" ? "EditMenu_ios.qml"
+ : Qt.platform.os === "android" ? "" : "EditMenu_base.qml"));
+ }
+ }
}