Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML TextArea. Get paste event using contextmenu option
Qt 6.12 LTS is out! See what's new in the release blog

QML TextArea. Get paste event using contextmenu option

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 1.1k Views
  • 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 DonateD Offline
    Diego DonateD Offline
    Diego Donate
    wrote on last edited by
    #1

    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
    0

    • Login

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