Revamp Local Fortune Client/Server Ex: Update the QDataStream's ver

... from Qt5.10 to Qt.6.0

Task-number: QTBUG-117036
Pick-to: 6.6 6.5
Change-Id: I47983b74d1001fa2e2cd278edda3d78430b97b45
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
Rym Bouabid 2023-09-18 18:47:43 +02:00
parent 6ca8b61b6b
commit 294fd9af6d
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ Client::Client(QWidget *parent)
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
in.setDevice(socket);
in.setVersion(QDataStream::Qt_5_10);
in.setVersion(QDataStream::Qt_6_0);
connect(hostLineEdit, &QLineEdit::textChanged,
this, &Client::enableGetFortuneButton);

View File

@ -59,7 +59,7 @@ void Server::sendFortune()
{
QByteArray block;
QDataStream out(&block, QIODevice::WriteOnly);
out.setVersion(QDataStream::Qt_5_10);
out.setVersion(QDataStream::Qt_6_0);
const int fortuneIndex = QRandomGenerator::global()->bounded(0, fortunes.size());
const QString &message = fortunes.at(fortuneIndex);
out << quint32(message.size());