From c80f262258b7846bf199887bcfdbb6dcfda6ad6f Mon Sep 17 00:00:00 2001 From: Piotr Mikolajczyk Date: Thu, 25 Feb 2021 15:36:29 +0100 Subject: Android: Add select and copy capability to read-only text widgets In case of a read-only text editing widget it was imposibble to copy text from it. In QtWidgets you could not even see the selection handless. Text selection in QtWidgets module was filtered depending on readOnly property of the widget. Additionally, in InputMethod the read-only state was translated into disabled. Patch also makes the edit menu to be aware of the read-only status of the control - the menu items are different for rw and ro controls. Task-number: QTBUG-91417 Change-Id: Ic7b27f78678eeaa87a38607af787f254db1383b8 Reviewed-by: Rami Potinkara Reviewed-by: Ville Voutilainen --- src/widgets/widgets/qwidgetlinecontrol_p.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/widgets/widgets/qwidgetlinecontrol_p.h') diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h index f906165c20..bb24fe4d5b 100644 --- a/src/widgets/widgets/qwidgetlinecontrol_p.h +++ b/src/widgets/widgets/qwidgetlinecontrol_p.h @@ -164,6 +164,9 @@ public: int selectionStart() const { return hasSelectedText() ? m_selstart : -1; } int selectionEnd() const { return hasSelectedText() ? m_selend : -1; } +#if defined (Q_OS_ANDROID) + bool isSelectableByMouse() const { return true; } +#endif bool inSelection(int x) const { if (m_selstart >= m_selend) -- cgit v1.2.3