Results 1 to 4 of 4

Thread: How to convert image data type to plain text and back ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    8
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: How to convert image data type to plain text and back ?

    Quote Originally Posted by high_flyer View Post
    what happens if you use toUtf8 () ?
    Same result ....

  2. #2
    Join Date
    Apr 2011
    Posts
    8
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: How to convert image data type to plain text and back ?

    Solved by using :
    Qt Code:
    1. {
    2. QByteArray data;
    3. data = ((ui->enterTextEdit->toPlainText()).remove(0,1) ).toUtf8();
    4.  
    5. QString strOK;
    6. strOK = QString::fromUtf8(QByteArray::fromHex(data));
    7. ui->resultTextBrowser->setText(strOK);
    8. }
    To copy to clipboard, switch view to plain text mode 

    Last edited by high_flyer; 13th April 2011 at 17:14. Reason: code tags

Similar Threads

  1. Display an image to a plain QWidget
    By franco.amato in forum Qt Programming
    Replies: 4
    Last Post: 19th March 2012, 10:07
  2. convert decimal seconds to QDateTime and back
    By mcarter in forum Qt Programming
    Replies: 2
    Last Post: 18th March 2010, 13:06
  3. Convert between a custom data type wrapped in a QVariant
    By darkadept in forum Qt Programming
    Replies: 2
    Last Post: 17th March 2009, 10:07
  4. Replies: 6
    Last Post: 4th February 2009, 08:46
  5. QTextEdit + paste rich text as plain text only
    By Yong in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2008, 17:45

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.