Results 1 to 2 of 2

Thread: Restricting TextEdit Data to less than 1MB size while pasting form clipboard

  1. #1
    Join Date
    Dec 2006
    Posts
    7
    Qt products
    Qt3

    Default Restricting TextEdit Data to less than 1MB size while pasting form clipboard

    I want to paste data from some file to textEdit. The problem is the size should be less than 1MB. How to get the size of data from clipboard and handle in which signal of TextEdit?
    actually am using a designer and qtextEdit is not sub-classed. so is there any other way of doing it?
    Last edited by keshab; 18th December 2006 at 11:20.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Restricting TextEdit Data to less than 1MB size while pasting form clipboard

    reimplement the QTextEdit::paste() method. Contents of the clipboard can be fetched using QClipboard::text(), when you have it, just check its QString::size() and QString::truncate() it.

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
  •  
Qt is a trademark of The Qt Company.