Results 1 to 2 of 2

Thread: Reading from QDataStream question

  1. #1
    Join Date
    Sep 2009
    Posts
    60
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Reading from QDataStream question

    I have a QDataStream:

    Qt Code:
    1. QByteArray itemData;
    2. QDataStream dataStream(&itemData, QIODevice::WriteOnly);
    3. dataStream << qstring << intvalue << qpixmap
    To copy to clipboard, switch view to plain text mode 

    When I want to get the data from the datastream, I don't want all the data at one time, so will this cause the data to come out in the right order?

    Qt Code:
    1. QString string1;
    2. int number;
    3. QPixmap pixmap;
    4.  
    5. dataStream >> string1;
    6. .
    7. .
    8. .
    9. dataStream >> number >> pixmap;
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: Reading from QDataStream question

    Could you maybe rephrase your question? What is the problem here exactly?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QDataStream reading to C++ vectors
    By pdoria in forum Qt Programming
    Replies: 6
    Last Post: 24th July 2009, 20:34
  2. QDataStream question...
    By grellsworth in forum Qt Programming
    Replies: 10
    Last Post: 21st April 2008, 12:17
  3. QWT 5, QT3, SuSE 10.2. Crash and burn
    By DrMcCleod in forum Qwt
    Replies: 8
    Last Post: 7th September 2007, 20:53
  4. QDataStream reading into QString
    By jakamph in forum Qt Programming
    Replies: 4
    Last Post: 15th October 2006, 09:22
  5. Reading QByteArray from QDataStream Qt3.3
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 1st April 2006, 20:23

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.