Results 1 to 3 of 3

Thread: How to block the textedit'd text to be copied

  1. #1
    Join Date
    May 2007
    Posts
    110
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X

    Default How to block the textedit'd text to be copied

    Hi

    I m using Qt4.2.2
    I m using one textedit that display some text ..I want to block the text to be copied...

    I have used setReadOnly(true) for non modified text; But Copy is available for selected text...
    Qt 4.2.2 provides on signal copyAvailable(bool)

    bu how i will use this signal
    connect(textEdit,SIGNAL(copyAvailable(bool)),this, );
    what will be used in the slot...

    or any other method to block textedit's selected data to be copied...

    if anybody know help me....

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to block the textedit'd text to be copied

    Try:
    Qt Code:
    1. textEdit->setTextInteractionFlags(Qt::NoTextInteraction);
    To copy to clipboard, switch view to plain text mode 
    ..or use QLabel
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to block the textedit'd text to be copied

    alternatively you can subclass QTextEdit and reimplement the createMimeDataFromSelection() method to return an empty content whatherver the selection is...
    Current Qt projects : QCodeEdit, RotiDeCode

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.