Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qdatastream
    Log in to post

    • SOLVED Can't read custom type from QSettings
      General and Desktop • qvariant qsettings qdatastream qt6.3.0 • • jager012  

      6
      0
      Votes
      6
      Posts
      46
      Views

      When you use custom types, it's pretty usual to register them all before building any of the widgets that will use them as part of your application startup sequence after you created your QApplication object.
    • SOLVED QSerialPort & QDataStream - Data not sent to the Serial Device
      General and Desktop • qserialport qt6 serial qdatastream hex • • Kevin470  

      3
      0
      Votes
      3
      Posts
      52
      Views

      @Christian-Ehrlicher Yup, it worked! Thanks a lot.
    • UNSOLVED How to write entire QVector to a binary file?
      General and Desktop • qvector qdatastream binary format • • CJha  

      46
      0
      Votes
      46
      Posts
      2628
      Views

      @CJha said in How to write entire QVector to a binary file?: If it's a copy then I assume it is always going to be the data No, because Qt containers use copy-on-write. See https://doc.qt.io/qt-5/implicit-sharing.html
    • UNSOLVED Qt4 and Qt5 compatibility issue with QDatastream and QDateTime
      General and Desktop • qt5 qt4 qstring qdatastream qdatetime • • johnyang  

      2
      0
      Votes
      2
      Posts
      164
      Views

      Now I realized I have to set QDataStream::setVersion to QDataStream::Qt_4_7. I think the problem is solved.
    • UNSOLVED Incomplete data in QDataStream when reading from QTcpSocket
      General and Desktop • qtcpsocket qtcpserver qbytearray qdatastream • • RBLL  

      16
      0
      Votes
      16
      Posts
      718
      Views

      Maybe that QByteArray is the culprit, you could try rewrite into more vanilla standard: ... { QByteArray block; QBuffer buffer(&block); buffer.open(QIODevice::WriteOnly); QDataStream out(&buffer); ... at least you would expose more stuff to the debugger :-)
    • SOLVED QDataStream an openCV::mat serialisation...
      General and Desktop • opencv qbytearray qdatastream • • Dariusz  

      3
      0
      Votes
      3
      Posts
      414
      Views

      @jsulm said in QDataStream an openCV::mat serialisation...: @Dariusz What is stream here? Is it QDataStream? "Any idea what did I mess up with this ?" - well, what is not working? Yep :- ) I think I might "got it". Naturally 5 min after asking question... elemSize1() return incorrect number of channels. Looks like I need elemSize() instead. still testing. Yep it was wrong element number. Hope it helps other "serializers" out here : -)
    • SOLVED Using QDataStream with STL containers
      General and Desktop • serialization qdatastream stl • • Eukaryote  

      5
      0
      Votes
      5
      Posts
      1225
      Views

      Adding typedef typename Container::value_type valType; to the loop helped with this issue . Thank you very much .
    • SOLVED Store objects to file
      General and Desktop • qdatastream pointers store • • jsavin  

      12
      0
      Votes
      12
      Posts
      3209
      Views

      @raven-worx @mrjj @Wieland @Pablo-J-Rogina Thank you guys ! It worked perfectly. I'm now able to read and write a XML file and load items to my drawing. Thank you again Happy coding !
    • UNSOLVED QDatastream should read a QVector from File.
      General and Desktop • qvector qdatastream load • • KonradMD  

      5
      0
      Votes
      5
      Posts
      2375
      Views

      Thanks @karlheinzreichel Originaly I have data called Sample, to save it I save it as a QVector<double> const Value. for(int iSamples=0;iSamples<_pSampleProcessing->getRawDataVector().size();iSamples++) { xDataVector.append(_pSampleProcessing->getRawDataVector().at(iSamples).getX()); yDataVector.append(_pSampleProcessing->getRawDataVector().at(iSamples).getY()); } I dont think so, because If it would be overloaded I might get an error, because I tried it to save it as a Sample before. So saving as a double seems possible.
    • UNSOLVED read and write to qtcpsocket using qdatastream
      General and Desktop • qtcpsocket qdatastream • • CybeX  

      3
      0
      Votes
      3
      Posts
      9915
      Views

      I've posted an answer how to know if you have read everything here: https://stackoverflow.com/a/46162082/969016
    • UNSOLVED Backwards-compatible QDataStream?
      General and Desktop • serialization qdatastream • • tmladek  

      6
      0
      Votes
      6
      Posts
      1526
      Views

      Another solution: Store all your data as key-value pairs in QMap<QString, QVariant> and write it to QDataStream. Next, applications will read full QMap contents from stream, then access needed values by their names.
    • UNSOLVED QDataStream pack and unpack
      General and Desktop • qdatastream • • nickpp  

      5
      0
      Votes
      5
      Posts
      1482
      Views

      @VRonin, division by 2, really? I know you can do much better ;) while (data) { const quint8 byte = data & 1; // data % 2 data >>= 1; // data / 2 myStream.writeRawData(&byte, 1); }
    • How to force QString to serialize as UTF-8?
      General and Desktop • qstring qdatastream • • Resurr3ction  

      1
      0
      Votes
      1
      Posts
      899
      Views

      No one has replied

    • How to serialize QAbstractItemModel in QDataStream?
      General and Desktop • qabstractitemmo mvc serialization qdatastream • • Ralf  

      2
      0
      Votes
      2
      Posts
      1310
      Views

      Hi, There's no ready made code to dump your model since only you know what make sense to dump. So yes you'll have to write the dumper and loader yourself. QDataStream comes to mind for that task. Hope it helps
    • [SOLVED] Threaded QTcpServer Multiple QSslSocket clients with QDataStream readyread() sometimes not emitted
      General and Desktop • qthread qtcpserver qeventloop qmysql qsslsocket qdatastream • • SebastianS  

      2
      0
      Votes
      2
      Posts
      1685
      Views

      Ok guy thank you for that much replies :P! I solved the issue by myself anyway. In case sombebody has a similar problem here comes the solution: What I did wrong was that I connected a time consuming function to the UpdateClient::tcpReady() slot. In this function I did some stuff which also lead to the emission of UpdateClient::tcpReady(). This broke the QEventQueue. So to what I had to chance was to skip the direct signal slot connection an do this in the UpdateClient::tcpReady(): QTimer::singleShot(0, this, SIGNAL(updateAvailable())); No everything is working fine ;).
    • QDataStream read a structure
      General and Desktop • read qdatastream bytes big endian • • dridk2  

      2
      0
      Votes
      2
      Posts
      1810
      Views

      I am not sure I completely understand the problem since I do not see any structure in your read/write code. But normal way to deal with structures (the same as with classes) is to write/read every member separate in their natural form with provided by QDataStream functionality. And you certainly need to know type of the data written to the file to read it properly. Your problem (as far as I can understand) is related to using wrong function to read integer data, cause you read it as char data,