Fortune* Example: Bump QDataStream format version
One of the examples were using a different version than the others. Though QString's formatting probably didn't change since then so it was no problem. Anyway, pretend like we're releasing it now for the first time and set 6.5 on all of them Task-number: QTBUG-108875 Change-Id: I28b496ab3d8ff54c503a032ba15882cdf3d5eccf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 71cd3bc074b4eea3158ba037ae2fe1c5b922ff3d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
1ec87cc886
commit
359a7d1b79
@ -62,7 +62,7 @@ void FortuneThread::run()
|
||||
//! [8] //! [11]
|
||||
|
||||
QDataStream in(&socket);
|
||||
in.setVersion(QDataStream::Qt_4_0);
|
||||
in.setVersion(QDataStream::Qt_6_5);
|
||||
QString fortune;
|
||||
//! [11] //! [12]
|
||||
|
||||
|
@ -60,7 +60,7 @@ Client::Client(QWidget *parent)
|
||||
|
||||
//! [1]
|
||||
in.setDevice(tcpSocket);
|
||||
in.setVersion(QDataStream::Qt_4_0);
|
||||
in.setVersion(QDataStream::Qt_6_5);
|
||||
//! [1]
|
||||
|
||||
connect(hostCombo, &QComboBox::editTextChanged,
|
||||
|
@ -94,7 +94,7 @@ void Server::sendFortune()
|
||||
//! [5]
|
||||
QByteArray block;
|
||||
QDataStream out(&block, QIODevice::WriteOnly);
|
||||
out.setVersion(QDataStream::Qt_5_10);
|
||||
out.setVersion(QDataStream::Qt_6_5);
|
||||
|
||||
out << fortunes[QRandomGenerator::global()->bounded(fortunes.size())];
|
||||
//! [4] //! [7]
|
||||
|
@ -25,7 +25,7 @@ void FortuneThread::run()
|
||||
|
||||
QByteArray block;
|
||||
QDataStream out(&block, QIODevice::WriteOnly);
|
||||
out.setVersion(QDataStream::Qt_4_0);
|
||||
out.setVersion(QDataStream::Qt_6_5);
|
||||
out << text;
|
||||
//! [3] //! [4]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user