summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtEmbeddedDelegate.java10
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtInputDelegate.java11
2 files changed, 16 insertions, 5 deletions
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtEmbeddedDelegate.java b/src/android/jar/src/org/qtproject/qt/android/QtEmbeddedDelegate.java
index 9a34afa51b..1c0fd0f7d8 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtEmbeddedDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtEmbeddedDelegate.java
@@ -141,10 +141,20 @@ class QtEmbeddedDelegate extends QtActivityDelegateBase implements QtNative.AppS
void setView(QtView view) {
m_view = view;
+ updateInputDelegate();
if (m_view != null)
registerGlobalFocusChangeListener(m_view);
}
+ private void updateInputDelegate() {
+ if (m_view == null) {
+ m_inputDelegate.setEditPopupMenu(null);
+ return;
+ }
+ m_inputDelegate.setEditPopupMenu(new EditPopupMenu(m_activity, m_view));
+ }
+
+
public void setRootWindowRef(long ref) {
m_rootWindowRef = ref;
}
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtInputDelegate.java b/src/android/jar/src/org/qtproject/qt/android/QtInputDelegate.java
index 206b024877..11346ed715 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtInputDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtInputDelegate.java
@@ -406,12 +406,13 @@ class QtInputDelegate implements QtInputConnection.QtInputConnectionListener {
if (!QtClipboardManager.hasClipboardText(activity))
editButtons &= ~EditContextView.PASTE_BUTTON;
- if ((mode & CursorHandleShowEdit) == CursorHandleShowEdit && editButtons != 0) {
- m_editPopupMenu.setPosition(editX, editY, editButtons,
- m_cursorHandle, m_leftSelectionHandle, m_rightSelectionHandle);
- } else {
- if (m_editPopupMenu != null)
+ if (m_editPopupMenu != null) {
+ if ((mode & CursorHandleShowEdit) == CursorHandleShowEdit && editButtons != 0) {
+ m_editPopupMenu.setPosition(editX, editY, editButtons,
+ m_cursorHandle, m_leftSelectionHandle, m_rightSelectionHandle);
+ } else {
m_editPopupMenu.hide();
+ }
}
}