From b42df9756a8d72cbdfbf72f15e98385b35148eb6 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Thu, 11 Mar 2021 09:35:58 +0100 Subject: [PATCH 1/3] Doc: Add hyperlink to relevant section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pick-to: 6.0 6.1 Fixes: QTBUG-91734 Change-Id: I3910c7fcf1625ad08a65e691a8eaf9ed6b61779a Reviewed-by: MÃ¥rten Nordheim --- src/network/doc/src/qt6-changes.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/doc/src/qt6-changes.qdoc b/src/network/doc/src/qt6-changes.qdoc index 024280200a..c315461649 100644 --- a/src/network/doc/src/qt6-changes.qdoc +++ b/src/network/doc/src/qt6-changes.qdoc @@ -115,8 +115,8 @@ \li QNetworkRequest::HTTP2WasUsedAttribute (use QNetworkRequest::Http2WasUsedAttribute). \endlist - QNetworkRequest::FollowRedirectsAttribute is removed in Qt 6, see the section - about redirects handling below. + QNetworkRequest::FollowRedirectsAttribute is removed in Qt 6, see + \l {Redirect policies}{the section about redirects handling} below. \section2 Configuring QSslSocket From 5fa8f5df7bb722c5b7451229f5eecd13bd13326f Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Thu, 11 Mar 2021 11:33:11 +0100 Subject: [PATCH 2/3] Doc: Change section titles that cause bad links Section titles are valid targets for QDoc's autolinker. When they are identical to other valid link targets, such as for example a class, these sections may cause invalid links. Pick-to: 6.0 6.1 Fixes: QTBUG-91141 Change-Id: Ie9a6258d2bf83932335976d8c0b5fc59f2028ae5 Reviewed-by: Friedemann Kleint --- src/dbus/doc/src/qt6-changes.qdoc | 10 +++++----- src/gui/doc/src/qt6-changes.qdoc | 12 ++++++------ src/opengl/doc/src/qt6-changes.qdoc | 2 +- src/sql/doc/src/qt6-changes.qdoc | 2 +- src/testlib/doc/src/qt6-changes.qdoc | 2 +- src/widgets/doc/src/qt6-changes.qdoc | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/dbus/doc/src/qt6-changes.qdoc b/src/dbus/doc/src/qt6-changes.qdoc index d03f9f1d9a..dc1553b360 100644 --- a/src/dbus/doc/src/qt6-changes.qdoc +++ b/src/dbus/doc/src/qt6-changes.qdoc @@ -46,22 +46,22 @@ The QtDBus module has undergone some basic consolidation and cleanup. There should be minimal porting effort to be able to switch to Qt6. - \section2 QDBusMessage + \section2 The QDBusMessage class The QDBusMessage::call() and QDBusMessage::asyncCall() methods with a fixed size of arguments have been removed in Qt6. - \section2 QDBusArgument + \section2 The QDBusArgument class The QDBusArgument::operator<<() specializations for QHash, QMap and QList have been unified into common specializations for associative containers. - \section2 QDBusConnection + \section2 The QDBusConnection class The QDBusConnection::sender() function has been removed in Qt6. - \section2 QDBusMessage + \section2 The QDBusMessage class The QDBusMessage::createErrorReply() function now takes the QString \c name argument by const reference instead of taking by value. - \section2 QDBusPendingReply + \section2 The QDBusPendingReply class QDBusPendingReply has been changed to be a variadic template class in order to support more than 8 template parameters now. The template parameters are the types that will be used to extract the contents of the reply's data. diff --git a/src/gui/doc/src/qt6-changes.qdoc b/src/gui/doc/src/qt6-changes.qdoc index 69f75b5b3a..e66b53c081 100644 --- a/src/gui/doc/src/qt6-changes.qdoc +++ b/src/gui/doc/src/qt6-changes.qdoc @@ -43,18 +43,18 @@ \section1 Kernel classes - \section2 QBitmap + \section2 The QBitmap class Implicit construction of a QBitmap from a QPixmap is no longer supported. The constructor and assignment operator have been made explicit and marked as deprecated. Use the new static factory function \l{QBitmap::}{fromPixmap} instead. - \section2 QCursor + \section2 The QCursor class Implicit construction of a QCursor from a QPixmap is no longer supported, the constructor has been made explicit. - \section2 QKeyCombination + \section2 The QKeyCombination class QKeyCombination is a new class for storing a combination of a key with an optional modifier. It should be used as a replacement for combining values from @@ -70,7 +70,7 @@ \section1 Text classes - \section2 QFontDatabase + \section2 The QFontDatabase class The QFontDatabase class has now only static member functions. The constructor has been deprecated. Instead of e.g. @@ -85,7 +85,7 @@ const QStringList fontFamilies = QFontDatabase::families(); \endcode - \section2 QFont + \section2 The QFont class The numerical values of the QFont::Weight enumerator have been changed to be in line with OpenType weight values. QFont::setWeight() expects an enum value @@ -117,7 +117,7 @@ In addition, the class \l QOpenGLWidget has been moved to a new module, named Qt OpenGL Widgets. - \section2 QOpenGLContext + \section2 The QOpenGLContext class The QOpenGLContext::versionFunctions() function is replaced by QOpenGLVersionFunctionsFactory::get(). QOpenGLVersionFunctionsFactory is a public diff --git a/src/opengl/doc/src/qt6-changes.qdoc b/src/opengl/doc/src/qt6-changes.qdoc index a64f71d22e..c4cb6d0220 100644 --- a/src/opengl/doc/src/qt6-changes.qdoc +++ b/src/opengl/doc/src/qt6-changes.qdoc @@ -67,7 +67,7 @@ \note A notable exception is \l QOpenGLContext, which still resides in Qt Gui. - \section1 QOpenGLWidgets + \section1 The QOpenGLWidgets class Another exception is the \l QOpenGLWidget class. This has been moved to a new module named \c{Qt OpenGL Widgets} and should be included from there. diff --git a/src/sql/doc/src/qt6-changes.qdoc b/src/sql/doc/src/qt6-changes.qdoc index 750c1162b6..55c94d0b60 100644 --- a/src/sql/doc/src/qt6-changes.qdoc +++ b/src/sql/doc/src/qt6-changes.qdoc @@ -41,7 +41,7 @@ In this topic we summarize those changes in Qt SQL, and provide guidance to handle them. - \section1 QSqlQuery + \section1 The QSqlQuery class \section2 boundValues() Signature diff --git a/src/testlib/doc/src/qt6-changes.qdoc b/src/testlib/doc/src/qt6-changes.qdoc index 0a735d855d..1b5b5e88ba 100644 --- a/src/testlib/doc/src/qt6-changes.qdoc +++ b/src/testlib/doc/src/qt6-changes.qdoc @@ -43,7 +43,7 @@ \section1 Touch-related functionality - \section2 QTouchEventSequence + \section2 The QTouchEventSequence class QTest::QTouchEventSequence functions taking a QWidget parameter has been moved to a new class: QTest::QTouchEventWidgetSequence. The list of affected diff --git a/src/widgets/doc/src/qt6-changes.qdoc b/src/widgets/doc/src/qt6-changes.qdoc index 585021efeb..d689ed173b 100644 --- a/src/widgets/doc/src/qt6-changes.qdoc +++ b/src/widgets/doc/src/qt6-changes.qdoc @@ -43,7 +43,7 @@ \section1 Kernel classes - \section2 QWidget + \section2 The QWidget class The virtual QWidget::enterEvent() handler now receives a QEnterEvent* parameter which has information about the pointer position, rather than @@ -71,12 +71,12 @@ \section1 Widgets - \section2 QAbstractButton + \section2 The QAbstractButton class The default timeout parameter for QAbstractButton::animateClick() is removed to allow modern connection syntax without the need for qOverload. - \section2 QComboBox + \section2 The QComboBox class The QComboBox::setModel() function is now virtual. From 6bd61513290ef23783220b0e7507c4f03d5114e7 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Sun, 7 Mar 2021 14:44:23 +0200 Subject: [PATCH 3/3] QProcess/Win: implement async closing of write channel Instead of blocking in QProcessPrivate::closeWriteChannel(), we can handle a pending close in _q_canWrite() slot when there is no more data to write. Change-Id: I2a30789b6099a2ec075292348ebe33a11341bca3 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qprocess.cpp | 14 ++++++++------ src/corelib/io/qprocess_p.h | 1 - src/corelib/io/qprocess_win.cpp | 6 ------ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index f03fc067cf..745c88e726 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1097,8 +1097,13 @@ bool QProcessPrivate::_q_canReadStandardError() bool QProcessPrivate::_q_canWrite() { if (writeBuffer.isEmpty()) { +#ifdef Q_OS_WIN + if (stdinChannel.closed && pipeWriterBytesToWrite() == 0) + closeWriteChannel(); +#else if (stdinChannel.notifier) stdinChannel.notifier->setEnabled(false); +#endif #if defined QPROCESS_DEBUG qDebug("QProcessPrivate::canWrite(), not writing anything (empty write buffer)."); #endif @@ -1107,10 +1112,12 @@ bool QProcessPrivate::_q_canWrite() const bool writeSucceeded = writeToStdin(); +#ifdef Q_OS_UNIX if (writeBuffer.isEmpty() && stdinChannel.closed) closeWriteChannel(); else if (stdinChannel.notifier) stdinChannel.notifier->setEnabled(!writeBuffer.isEmpty()); +#endif return writeSucceeded; } @@ -1211,11 +1218,6 @@ void QProcessPrivate::closeWriteChannel() qDebug("QProcessPrivate::closeWriteChannel()"); #endif -#ifdef Q_OS_WIN - // ### Find a better fix, feeding the process little by little - // instead. - flushPipeWriter(); -#endif closeChannel(&stdinChannel); } @@ -1373,7 +1375,7 @@ void QProcess::closeWriteChannel() { Q_D(QProcess); d->stdinChannel.closed = true; // closing - if (d->writeBuffer.isEmpty()) + if (bytesToWrite() == 0) d->closeWriteChannel(); } diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h index 7b58b32369..73db9423e6 100644 --- a/src/corelib/io/qprocess_p.h +++ b/src/corelib/io/qprocess_p.h @@ -365,7 +365,6 @@ public: STARTUPINFOW createStartupInfo(); bool callCreateProcess(QProcess::CreateProcessArguments *cpargs); bool drainOutputPipes(); - void flushPipeWriter(); qint64 pipeWriterBytesToWrite() const; #endif diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index 0088284d2d..3bdf070be4 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -796,12 +796,6 @@ void QProcessPrivate::findExitCode() } } -void QProcessPrivate::flushPipeWriter() -{ - if (stdinChannel.writer && stdinChannel.writer->bytesToWrite() > 0) - stdinChannel.writer->waitForWrite(ULONG_MAX); -} - qint64 QProcessPrivate::pipeWriterBytesToWrite() const { return stdinChannel.writer ? stdinChannel.writer->bytesToWrite() : qint64(0);