Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved QML TextArea. Get paste event using contextmenu option

    QML and Qt Quick
    1
    1
    603
    Loading More Posts
    • 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.
    • Diego Donate
      Diego Donate last edited by

      Hi,

      I have a QML TextArea, and I need to know the text pasted using the 'paste' option in the contexte menu (mouse right button).

      I can check the paste using keys with:

      Keys.onPressed: function(keyEvent) {
          .....
          if (keyEvent.matches(StandardKey.Paste)){
              ....
      

      and there I can use QT code:

      QClipboard* pClipboard = qApp->clipboard();
      if (pClipboard)
      {
          QClipboard::Mode eMode = QClipboard::Clipboard;
          const QMimeData* pMimeData = pClipboard->mimeData( eMode );
          ....
      

      to get the text in clipboard, before being pasted.

      How can I do the same using whe mouse 'paste' option?

      Thanks,
      Diego

      1 Reply Last reply Reply Quote 0
      • First post
        Last post