Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Native Copy/Paste, text selection in TextEdit at the Android
Forum Updated to NodeBB v4.3 + New Features

Native Copy/Paste, text selection in TextEdit at the Android

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 2 Posters 6.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maxim.prishchepa
    wrote on last edited by
    #1

    Hello, how can i use native for android copy/paste menu and native text selection, like this:

    !http://i.stack.imgur.com/KV0Sy.png(Screen)!

    is it possible to use in QML TextEdit, TextInput components??

    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz).

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tomasl
      wrote on last edited by
      #2

      Hi, please take a look at the bugreport and workarounds mentioned here:
      https://bugreports.qt-project.org/browse/QTBUG-34867

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maxim.prishchepa
        wrote on last edited by
        #3

        tnx a lot tomasl 4 answer,
        i saw this bug, and even try to use TextInputWithHandles at the 5.4, but at my device it doesn't work, will be w8 next release, hope it will be fixed and our customer not fire us before :))

        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz).

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tomasl
          wrote on last edited by
          #4

          Did you see my comment in the bugreport? This works fine for me in Qt 5.4 final:
          Changing \qml\QtQuick\Controls\Private\EditMenu.qml from loading nothing on Android to loading "EditMenu_ios.qml" seems to work very well. Both selection handles, cursor and a popup context menu for copy/cut/paste/select/select all works fine in TextField and TextArea.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            maxim.prishchepa
            wrote on last edited by
            #5

            tomasl
            I try to change EditMenu.qml as you say to:
            @source: Qt.resolvedUrl(Qt.platform.os === "ios" ? "EditMenu_ios.qml"
            : Qt.platform.os === "android" ? "EditMenu_ios.qml" : "EditMenu_base.qml")@

            and use:
            @import QtQuick.Controls.Private 1.0
            ...
            -TextInput- to TextInputWithHandles@

            but get next warinngs:
            @file:///data/data/com.eshta.chat/qt-reserved-files/qml/QtQuick/Controls/Private/EditMenu_ios.qml:101: TypeError: Cannot read property 'menu' of null[EditMenu_ios.qml:101]
            file:///data/data/com.eshta.chat/qt-reserved-files/qml/QtQuick/Controls/Private/TextInputWithHandles.qml:169: TypeError: Cannot call method 'mapFromItem' of null[TextInputWithHandles.qml:169]
            file:///data/data/com.eshta.chat/qt-reserved-files/qml/QtQuick/Controls/Private/TextInputWithHandles.qml:147: TypeError: Cannot read property of null[TextInputWithHandles.qml:147]
            file:///data/data/com.eshta.chat/qt-reserved-files/qml/QtQuick/Controls/Private/TextInputWithHandles.qml:143: TypeError: Cannot call method 'mapFromItem' of null[TextInputWithHandles.qml:143]
            file:///data/data/com.eshta.chat/qt-reserved-files/qml/QtQuick/Controls/Private/EditMenu_ios.qml:118: TypeError: Cannot read property 'menu' of null[EditMenu_ios.qml:118]
            file:///data/data/com.eshta.chat/qt-reserved-files/qml/QtQuick/Controls/Private/EditMenu_ios.qml:169: TypeError: Cannot read property 'menu' of null[EditMenu_ios.qml:169]
            file:///data/data/com.eshta.chat/qt-reserved-files/qml/QtQuick/Controls/Private/EditMenu_ios.qml:101: TypeError: Cannot read property 'menu' of null[EditMenu_ios.qml:101]@
            etc..

            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz).

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tomasl
              wrote on last edited by
              #6

              Maxim,
              I did not import the private controls, just used regular TextField from controls (Not TextInput or TextInputWithHandles).

              Tomas

              1 Reply Last reply
              0
              • M Offline
                M Offline
                maxim.prishchepa
                wrote on last edited by
                #7

                O_o realy?? tomorow i'll test it, tnx a lot :)

                Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz).

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved