diff options
Diffstat (limited to 'src')
40 files changed, 183 insertions, 70 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index c3e1ba4010f..8a343b15eeb 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -858,6 +858,7 @@ qint64 QAnimationDriver::elapsed() const */ /*! + \internal The default animation driver just spins the timer... */ QDefaultAnimationDriver::QDefaultAnimationDriver(QUnifiedTimer *timer) diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 4386b907c13..90a0e359c9f 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -1278,7 +1278,6 @@ qt_feature("permissions" PUBLIC ) qt_feature("openssl-hash" PRIVATE LABEL "OpenSSL based cryptographic hash" - AUTODETECT OFF CONDITION QT_FEATURE_openssl_linked AND QT_FEATURE_opensslv30 PURPOSE "Uses OpenSSL based implementation of cryptographic hash algorithms." ) diff --git a/src/corelib/doc/src/external-resources.qdoc b/src/corelib/doc/src/external-resources.qdoc index 2232b49bf23..5d357c65496 100644 --- a/src/corelib/doc/src/external-resources.qdoc +++ b/src/corelib/doc/src/external-resources.qdoc @@ -28,11 +28,6 @@ */ /*! - \externalpage https://marcmutz.wordpress.com/effective-qt/containers/#containers-qlist - \title Pros and Cons of Using QList -*/ - -/*! \externalpage https://marcmutz.wordpress.com/effective-qt/containers/ \title Understand the Qt Containers */ diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index 0771c15584b..d3c398f0860 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -249,6 +249,12 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode, FILE *fh, QFile::FileHand } /*! + \class QFSFileEnginePrivate + \inmodule QtCore + \internal +*/ + +/*! Opens the file handle \a fh using the open mode \a flags. */ bool QFSFileEnginePrivate::openFh(QIODevice::OpenMode openMode, FILE *fh) diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp index 456a209af37..6edf4395887 100644 --- a/src/corelib/io/qwindowspipereader.cpp +++ b/src/corelib/io/qwindowspipereader.cpp @@ -14,6 +14,11 @@ using namespace Qt::StringLiterals; static const DWORD minReadBufferSize = 4096; +/*! + \class QWindowsPipeReader + \inmodule QtCore + \internal +*/ QWindowsPipeReader::QWindowsPipeReader(QObject *parent) : QObject(parent), handle(INVALID_HANDLE_VALUE), diff --git a/src/corelib/kernel/qeventdispatcher_cf.mm b/src/corelib/kernel/qeventdispatcher_cf.mm index 2dddf147f85..d57c057a21a 100644 --- a/src/corelib/kernel/qeventdispatcher_cf.mm +++ b/src/corelib/kernel/qeventdispatcher_cf.mm @@ -207,6 +207,7 @@ QEventLoop *QEventDispatcherCoreFoundation::currentEventLoop() const } /*! + \internal Processes all pending events that match \a flags until there are no more events to process. Returns \c true if pending events were handled; otherwise returns \c false. diff --git a/src/corelib/kernel/qpermissions.cpp b/src/corelib/kernel/qpermissions.cpp index 6767917e176..69383dafdd9 100644 --- a/src/corelib/kernel/qpermissions.cpp +++ b/src/corelib/kernel/qpermissions.cpp @@ -119,7 +119,7 @@ Q_LOGGING_CATEGORY(lcPermissions, "qt.permissions", QtWarningMsg); To ensure the relevant permission backend is included with your application, please \l {QT_ANDROID_PACKAGE_SOURCE_DIR} {point the build system to your custom \c AndroidManifest.xml} - or use \l {qt_add_android_permission()}. + or use \l {qt_add_android_permission}(). The relevant permission names are described in the documentation for each permission type. diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp index d538ed7b4e9..9141a8f8bad 100644 --- a/src/corelib/kernel/qproperty.cpp +++ b/src/corelib/kernel/qproperty.cpp @@ -402,6 +402,16 @@ QPropertyBindingPrivate::NotificationState QPropertyBindingPrivate::notifyNonRec } /*! + \class QUntypedPropertyBinding + \inmodule QtCore + \since 6.0 + \ingroup tools + \brief Represents a type-erased property binding. + + \sa QUntypedBindable +*/ + +/*! Constructs a null QUntypedPropertyBinding. \sa isNull() @@ -409,8 +419,8 @@ QPropertyBindingPrivate::NotificationState QPropertyBindingPrivate::notifyNonRec QUntypedPropertyBinding::QUntypedPropertyBinding() = default; /*! - \fn template<typename Functor> - QUntypedPropertyBinding(QMetaType metaType, Functor &&f, const QPropertyBindingSourceLocation &location) + \fn template<typename Functor> QUntypedPropertyBinding( + QMetaType metaType, Functor &&f, const QPropertyBindingSourceLocation &location) \internal */ @@ -448,7 +458,6 @@ QUntypedPropertyBinding::QUntypedPropertyBinding(const QUntypedPropertyBinding & : d(other.d) { } - /*! Copy-assigns \a other to this QUntypedPropertyBinding. */ @@ -1183,7 +1192,7 @@ QString QPropertyBindingError::description() const \return \c true when the binding was successfully set. - //! \sa QUntypedPropertyBinding::valueMetaType() + \sa QUntypedPropertyBinding::valueMetaType() */ /*! @@ -1199,8 +1208,7 @@ QString QPropertyBindingError::description() const Returns the metatype of the property from which the QUntypedBindable was created. If the bindable is invalid, an invalid metatype will be returned. - \sa isValid() - //! \sa QUntypedPropertyBinding::valueMetaType() + \sa isValid(), QUntypedPropertyBinding::valueMetaType() */ /*! diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index 9fdac89f775..6000edaa177 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -392,8 +392,8 @@ public: translation files may contain misleading or malicious translations. \sa QCoreApplication::installTranslator(), QCoreApplication::removeTranslator(), - QObject::tr(), QCoreApplication::translate(), {I18N Example}, - {Hello tr() Example}, {Arrow Pad Example}, {Troll Print Example} + QObject::tr(), QCoreApplication::translate(), + {Localized Clock Example}, {Arrow Pad Example}, {Troll Print Example} */ /*! diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp index 13d74e591d5..0aeb2b07f47 100644 --- a/src/corelib/serialization/qcborvalue.cpp +++ b/src/corelib/serialization/qcborvalue.cpp @@ -975,6 +975,7 @@ QCborContainerPrivate *QCborContainerPrivate::detach(QCborContainerPrivate *d, q } /*! + \internal Prepare for an insertion at position \a index Detaches and ensures there are at least index entries in the array, padding diff --git a/src/corelib/serialization/qdatastream.cpp b/src/corelib/serialization/qdatastream.cpp index ae3bed5b751..fd2f7faeee5 100644 --- a/src/corelib/serialization/qdatastream.cpp +++ b/src/corelib/serialization/qdatastream.cpp @@ -552,6 +552,7 @@ void QDataStream::setByteOrder(ByteOrder bo) \value Qt_6_9 \value Qt_6_10 \value Qt_6_11 + \value Qt_6_12 \omitvalue Qt_DefaultCompiledVersion \sa setVersion(), version() diff --git a/src/corelib/serialization/qdatastream.h b/src/corelib/serialization/qdatastream.h index 04373fe9c8a..d6fcf17efcd 100644 --- a/src/corelib/serialization/qdatastream.h +++ b/src/corelib/serialization/qdatastream.h @@ -96,8 +96,9 @@ public: Qt_6_9 = Qt_6_7, Qt_6_10 = 23, Qt_6_11 = 24, - Qt_DefaultCompiledVersion = Qt_6_11 -#if QT_VERSION >= QT_VERSION_CHECK(6, 12, 0) + Qt_6_12 = Qt_6_11, + Qt_DefaultCompiledVersion = Qt_6_12 +#if QT_VERSION >= QT_VERSION_CHECK(6, 13, 0) #error Add the datastream version for this Qt version and update Qt_DefaultCompiledVersion #endif }; diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp index 9cd90fa9d65..ff70289013a 100644 --- a/src/corelib/serialization/qxmlstream.cpp +++ b/src/corelib/serialization/qxmlstream.cpp @@ -3678,7 +3678,7 @@ void QXmlStreamWriter::setStopWritingOnError(bool stop) The error status is never reset. Writes happening after the error occurred may be ignored, even if the error condition is cleared. - \sa error(), errorString(), raiseError(const QString &message), + \sa error(), errorString(), raiseError() */ bool QXmlStreamWriter::hasError() const { @@ -3692,7 +3692,7 @@ bool QXmlStreamWriter::hasError() const QXmlStreamWriter::Error::None. \since 6.10 - \sa errorString(), raiseError(const QString &message), hasError() + \sa errorString(), raiseError(), hasError() */ QXmlStreamWriter::Error QXmlStreamWriter::error() const { @@ -3708,7 +3708,7 @@ QXmlStreamWriter::Error QXmlStreamWriter::error() const a null string. \since 6.10 - \sa error(), raiseError(const QString &message), hasError() + \sa error(), raiseError(), hasError() */ QString QXmlStreamWriter::errorString() const { diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index fed09aee45e..18007cacae6 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -301,6 +301,7 @@ bool operator<(LikelyPair lhs, LikelyPair rhs) } // anonymous namespace /*! + \internal Fill in blank fields of a locale ID. An ID in which some fields are zero stands for any locale that agrees with diff --git a/src/corelib/text/qstringconverter.cpp b/src/corelib/text/qstringconverter.cpp index bf6e776ee0e..896142b4837 100644 --- a/src/corelib/text/qstringconverter.cpp +++ b/src/corelib/text/qstringconverter.cpp @@ -2739,7 +2739,7 @@ QStringList QStringConverter::availableCodecs() May also provide data from residual content that was pending decoding. When there is no residual data to account for, the return's \c error - field will be set to \l {QCharConverter::FinalizeResult::Error::} + field will be set to \l {QStringConverter::FinalizeResultChar::error} {NoError}. If \a out is supplied and non-null, it must have space in which up to @@ -2793,7 +2793,7 @@ auto QStringDecoder::finalize(char16_t *out, qsizetype maxlen) -> FinalizeResult May also provide data from residual content that was pending decoding. When there is no residual data to account for, the return's \c error - field will be set to \l {QCharConverter::FinalizeResult::Error::} + field will be set to \l {QStringConverter::FinalizeResultChar::error} {NoError}. If \a out is supplied and non-null, it must have space in which up to diff --git a/src/corelib/thread/qreadwritelock.cpp b/src/corelib/thread/qreadwritelock.cpp index 96e35dcb965..2a1af2315ca 100644 --- a/src/corelib/thread/qreadwritelock.cpp +++ b/src/corelib/thread/qreadwritelock.cpp @@ -234,14 +234,14 @@ QBasicReadWriteLock::contendedTryLockForRead(QDeadlineTimer timeout, void *dd) return d->recursiveLockForRead(timeout); auto lock = qt_unique_lock(d->mutex); - if (d != d_ptr.loadRelaxed()) { + if (QReadWriteLockPrivate *dd = d_ptr.loadAcquire(); d != dd) { // d_ptr has changed: this QReadWriteLock was unlocked before we had // time to lock d->mutex. // We are holding a lock to a mutex within a QReadWriteLockPrivate // that is already released (or even is already re-used). That's ok // because the QFreeList never frees them. // Just unlock d->mutex (at the end of the scope) and retry. - d = d_ptr.loadAcquire(); + d = dd; continue; } return d->lockForRead(lock, timeout); @@ -340,11 +340,11 @@ QBasicReadWriteLock::contendedTryLockForWrite(QDeadlineTimer timeout, void *dd) return d->recursiveLockForWrite(timeout); auto lock = qt_unique_lock(d->mutex); - if (d != d_ptr.loadRelaxed()) { + if (QReadWriteLockPrivate *dd = d_ptr.loadAcquire(); d != dd) { // The mutex was unlocked before we had time to lock the mutex. // We are holding to a mutex within a QReadWriteLockPrivate that is already released // (or even is already re-used) but that's ok because the QFreeList never frees them. - d = d_ptr.loadAcquire(); + d = dd; continue; } return d->lockForWrite(lock, timeout); diff --git a/src/corelib/time/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp index 10882738a39..05ba3d2beae 100644 --- a/src/corelib/time/qdatetimeparser.cpp +++ b/src/corelib/time/qdatetimeparser.cpp @@ -2389,6 +2389,7 @@ bool operator==(QDateTimeParser::SectionNode s1, QDateTimeParser::SectionNode s2 } /*! + \internal Sets \a cal as the calendar to use. The default is Gregorian. */ diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf index 24d9d522735..8b7569c1296 100644 --- a/src/gui/doc/qtgui.qdocconf +++ b/src/gui/doc/qtgui.qdocconf @@ -50,7 +50,8 @@ depends += \ qtshadertools \ qttestlib \ qtplatformintegration \ - qthelp + qthelp \ + qtquickcontrols headerdirs += .. diff --git a/src/gui/doc/src/external-resources.qdoc b/src/gui/doc/src/external-resources.qdoc index 0f356dd5046..14ed0817e62 100644 --- a/src/gui/doc/src/external-resources.qdoc +++ b/src/gui/doc/src/external-resources.qdoc @@ -36,6 +36,7 @@ \externalpage https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html \title Freedesktop Icon Naming Specification */ + /*! \externalpage https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#directory_layout \title Icon Theme Specification - Directory Layout diff --git a/src/gui/itemmodels/qfileinfogatherer.cpp b/src/gui/itemmodels/qfileinfogatherer.cpp index b7ab3dbbc46..ea19db0d20f 100644 --- a/src/gui/itemmodels/qfileinfogatherer.cpp +++ b/src/gui/itemmodels/qfileinfogatherer.cpp @@ -46,6 +46,12 @@ static QString translateDriveName(const QFileInfo &drive) } /*! + \class QFileInfoGatherer + \inmodule QtGui + \internal +*/ + +/*! Creates thread */ QFileInfoGatherer::QFileInfoGatherer(QObject *parent) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 741b089306e..e8df40f21b2 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -490,6 +490,12 @@ static QWindowGeometrySpecification windowGeometrySpecification = Q_WINDOW_GEOME */ /*! + \class QGuiApplicationPrivate + \inmodule QtGui + \internal +*/ + +/*! Initializes the window system and constructs an application object with \a argc command line arguments in \a argv. diff --git a/src/gui/kernel/qplatformintegrationfactory.cpp b/src/gui/kernel/qplatformintegrationfactory.cpp index d0a5e8871f8..d113e86090d 100644 --- a/src/gui/kernel/qplatformintegrationfactory.cpp +++ b/src/gui/kernel/qplatformintegrationfactory.cpp @@ -24,6 +24,7 @@ QPlatformIntegration *QPlatformIntegrationFactory::create(const QString &platfor } /*! + \internal Returns the list of valid keys, i.e. the keys this factory can create styles for. diff --git a/src/gui/kernel/qplatformthemefactory.cpp b/src/gui/kernel/qplatformthemefactory.cpp index beefa1c2942..3ac462598fd 100644 --- a/src/gui/kernel/qplatformthemefactory.cpp +++ b/src/gui/kernel/qplatformthemefactory.cpp @@ -31,6 +31,7 @@ QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString } /*! + \internal Returns the list of valid keys, i.e. the keys this factory can create styles for. diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index 6b45d26fb4c..cb927d7c296 100644 --- a/src/gui/opengl/qopenglfunctions.cpp +++ b/src/gui/opengl/qopenglfunctions.cpp @@ -192,6 +192,12 @@ QOpenGLFunctions::QOpenGLFunctions(QOpenGLContext *context) qWarning("QOpenGLFunctions created with non-current context"); } +/*! + \class QOpenGLExtensions + \inmodule QtGui + \internal +*/ + QOpenGLExtensions::QOpenGLExtensions() { } diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 047be5f1c3d..8e815394849 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2881,6 +2881,7 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, /*! + * \internal * Returns \c true if the rectangle is completely within the current clip * state of the paint engine. */ diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index 908051a477c..b1ea3f240f1 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -3192,6 +3192,7 @@ static inline bool is_monochrome(const QList<QRgb> &colorTable) } /*! + * \internal * Adds an image to the pdf and return the pdf-object id. Returns -1 if adding the image failed. */ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, bool lossless, qint64 serial_no) diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp index 0d435c95048..08128c30a70 100644 --- a/src/gui/painting/qstroker.cpp +++ b/src/gui/painting/qstroker.cpp @@ -145,6 +145,11 @@ static inline qreal adapted_angle_on_x(const QLineF &line) return QLineF(0, 0, 1, 0).angleTo(line); } +/*! + \class QStrokerOps + \inmodule QtGui + \internal +*/ QStrokerOps::QStrokerOps() : m_elements(0) , m_curveThreshold(qt_real_to_fixed(0.25)) @@ -373,6 +378,7 @@ QStroker::LineJoinMode QStroker::joinModeForJoin(Qt::PenJoinStyle joinStyle) /*! + \internal This function is called to stroke the currently built up subpath. The subpath is cleared when the function completes. */ diff --git a/src/gui/platform/unix/dbusmenu/qdbusplatformmenu.cpp b/src/gui/platform/unix/dbusmenu/qdbusplatformmenu.cpp index fe050461260..00c3192e00a 100644 --- a/src/gui/platform/unix/dbusmenu/qdbusplatformmenu.cpp +++ b/src/gui/platform/unix/dbusmenu/qdbusplatformmenu.cpp @@ -48,6 +48,7 @@ void QDBusPlatformMenuItem::setIcon(const QIcon &icon) } /*! + \internal Set a submenu under this menu item. */ void QDBusPlatformMenuItem::setMenu(QPlatformMenu *menu) diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index d41296291f6..4df55d5b89c 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -402,7 +402,7 @@ bool QFontEngine::processHheaTable() const const qreal unitsPerEm = emSquareSize().toReal(); // Bail out if values are too large for QFixed - const auto limitForQFixed = qreal(std::numeric_limits<int>::max() / 64) / fontDef.pixelSize; + const auto limitForQFixed = qreal(std::numeric_limits<int>::max() >> 6) / fontDef.pixelSize; if (ascent > limitForQFixed || descent > limitForQFixed || leading > limitForQFixed) return false; m_ascent = QFixed::fromReal(ascent * fontDef.pixelSize / unitsPerEm); @@ -470,7 +470,7 @@ bool QFontEngine::processOS2Table() const if (typoAscent == 0 && typoDescent == 0) return false; // Bail out if values are too large for QFixed - const auto limitForQFixed = qreal(std::numeric_limits<int>::max() / 64) / fontDef.pixelSize; + const auto limitForQFixed = qreal(std::numeric_limits<int>::max() >> 6) / fontDef.pixelSize; if (typoAscent > limitForQFixed || typoDescent > limitForQFixed || typoLineGap > limitForQFixed) return false; @@ -481,7 +481,7 @@ bool QFontEngine::processOS2Table() const // Some fonts may have invalid OS/2 data. We detect this and bail out. if (winAscent == 0 && winDescent == 0) return false; - const auto limitForQFixed = qreal(std::numeric_limits<int>::max() / 64) / fontDef.pixelSize; + const auto limitForQFixed = qreal(std::numeric_limits<int>::max() >> 6) / fontDef.pixelSize; if (winAscent > limitForQFixed || winDescent > limitForQFixed) return false; m_ascent = QFixed::fromReal(winAscent * fontDef.pixelSize / unitsPerEm); @@ -1059,6 +1059,7 @@ void QFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metr } /*! + \internal Returns \c true if the font table idetified by \a tag exists in the font; returns \c false otherwise. diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 4f01d09fed1..d519cd5a5d3 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2385,6 +2385,11 @@ static QString colorValue(QColor color) return result; } +/*! + \class QTextHtmlExporter + \inmodule QtGui + \internal +*/ QTextHtmlExporter::QTextHtmlExporter(const QTextDocument *_doc) : doc(_doc), fragmentMarkers(false) { diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index 227cbae2952..85a74d366ac 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -1006,6 +1006,7 @@ int QTextDocumentPrivate::undoRedo(bool undo) } /*! + \internal Appends a custom undo \a item to the undo stack. */ void QTextDocumentPrivate::appendUndoItem(QAbstractUndoItem *item) diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp index ff8644b5302..337228ff170 100644 --- a/src/gui/text/qtexttable.cpp +++ b/src/gui/text/qtexttable.cpp @@ -394,11 +394,9 @@ void QTextTablePrivate::fragmentRemoved(QChar type, uint fragment) } /*! - /fn void QTextTablePrivate::update() const - + \internal This function is usually called when the table is "dirty". It seems to update all kind of table information. - */ void QTextTablePrivate::update() const { diff --git a/src/gui/util/qlayoutpolicy.cpp b/src/gui/util/qlayoutpolicy.cpp index 4d81a426835..0c0651c1f39 100644 --- a/src/gui/util/qlayoutpolicy.cpp +++ b/src/gui/util/qlayoutpolicy.cpp @@ -8,6 +8,11 @@ QT_BEGIN_NAMESPACE +/*! + \class QLayoutPolicy + \inmodule QtGui + \internal +*/ void QLayoutPolicy::setControlType(ControlType type) { /* diff --git a/src/network/access/qbytedatabuffer_p.h b/src/network/access/qbytedatabuffer_p.h index a119093cf7e..036b562d06a 100644 --- a/src/network/access/qbytedatabuffer_p.h +++ b/src/network/access/qbytedatabuffer_p.h @@ -280,6 +280,8 @@ public: } return false; } + + const QByteArray &last() const { return buffers.last(); } }; QT_END_NAMESPACE diff --git a/src/network/access/qhttp2connection.cpp b/src/network/access/qhttp2connection.cpp index 2895e8335d2..c0b07ddd652 100644 --- a/src/network/access/qhttp2connection.cpp +++ b/src/network/access/qhttp2connection.cpp @@ -34,8 +34,38 @@ using namespace Http2; \sa QHttp2Connection */ -QHttp2Stream::QHttp2Stream(QHttp2Connection *connection, quint32 streamID) noexcept - : QObject(connection), m_streamID(streamID) +/*! + \struct QHttp2Stream::Configuration + \inmodule QtNetwork + \internal + + \brief Configuration options for a QHttp2Stream. + + The Configuration struct holds options that control stream behavior. + + \sa QHttp2Connection::createStream() +*/ + +/*! + \variable QHttp2Stream::Configuration::useDownloadBuffer + + Controls whether incoming DATA frames, from QHttp2Stream::dataReceived(), + are buffered. The default is \c true. + + You may disable buffering for client-initiated streams when the + application processes DATA immediately. + + Buffering must remain enabled for pushed streams. A pushed stream can + receive DATA before the application becomes aware of them and the buffered + DATA is required to deliver the pushed response. + + \sa QHttp2Stream::downloadBuffer(), QHttp2Stream::takeDownloadBuffer(), + QHttp2Configuration::serverPushEnabled(), QHttp2Stream::dataReceived() +*/ + +QHttp2Stream::QHttp2Stream(QHttp2Connection *connection, quint32 streamID, + Configuration configuration) noexcept + : QObject(connection), m_streamID(streamID), m_configuration(configuration) { Q_ASSERT(connection); Q_ASSERT(streamID); // stream id 0 is reserved for connection control messages @@ -213,6 +243,12 @@ QHttp2Stream::~QHttp2Stream() noexcept { Returns the buffer containing the data received from the remote peer. */ +/*! + \fn QHttp2Stream::Configuration QHttp2Stream::configuration() const + + Returns the configuration of this stream. +*/ + void QHttp2Stream::finishWithError(Http2::Http2Error errorCode, const QString &message) { qCDebug(qHttp2ConnectionLog, "[%p] stream %u finished with error: %ls (error code: %u)", @@ -697,8 +733,14 @@ void QHttp2Stream::handleDATA(const Frame &inboundFrame) inboundFrame.dataSize()); if (endStream) transitionState(StateTransition::CloseRemote); - emit dataReceived(fragment, endStream); - m_downloadBuffer.append(std::move(fragment)); + const auto shouldBuffer = m_configuration.useDownloadBuffer && !fragment.isEmpty(); + if (shouldBuffer) { + // Only non-empty fragments get appended! + m_downloadBuffer.append(std::move(fragment)); + emit dataReceived(m_downloadBuffer.last(), endStream); + } else { + emit dataReceived(fragment, endStream); + } } if (!endStream && m_recvWindow < connection->streamInitialReceiveWindowSize / 2) { @@ -885,23 +927,35 @@ QHttp2Connection *QHttp2Connection::createDirectServerConnection(QIODevice *sock } /*! - Creates a stream on this connection. + \fn QH2Expected<QHttp2Stream *, QHttp2Connection::CreateStreamError> QHttp2Connection::createStream() + Creates a stream on this connection, using the default QHttp2Stream::Configuration. + +//! [createStream] Automatically picks the next available stream ID and returns a pointer to the new stream, if possible. Otherwise returns an error. \sa QHttp2Connection::CreateStreamError, QHttp2Stream +//! [createStream] + \sa createStream(QHttp2Stream::Configuration) +*/ + +/*! + Creates a stream with \a configuration on this connection. + + \include qhttp2connection.cpp createStream */ -QH2Expected<QHttp2Stream *, QHttp2Connection::CreateStreamError> QHttp2Connection::createStream() +QH2Expected<QHttp2Stream *, QHttp2Connection::CreateStreamError> +QHttp2Connection::createStream(QHttp2Stream::Configuration configuration) { Q_ASSERT(m_connectionType == Type::Client); // This overload is just for clients if (m_nextStreamID > lastValidStreamID) return { QHttp2Connection::CreateStreamError::StreamIdsExhausted }; - return createLocalStreamInternal(); + return createLocalStreamInternal(configuration); } QH2Expected<QHttp2Stream *, QHttp2Connection::CreateStreamError> -QHttp2Connection::createLocalStreamInternal() +QHttp2Connection::createLocalStreamInternal(QHttp2Stream::Configuration conf) { if (m_goingAway) return { QHttp2Connection::CreateStreamError::ReceivedGOAWAY }; @@ -909,7 +963,7 @@ QHttp2Connection::createLocalStreamInternal() if (size_t(m_peerMaxConcurrentStreams) <= size_t(numActiveLocalStreams())) return { QHttp2Connection::CreateStreamError::MaxConcurrentStreamsReached }; - if (QHttp2Stream *ptr = createStreamInternal_impl(streamID)) { + if (QHttp2Stream *ptr = createStreamInternal_impl(streamID, conf)) { m_nextStreamID += 2; return {ptr}; } @@ -917,7 +971,8 @@ QHttp2Connection::createLocalStreamInternal() return { QHttp2Connection::CreateStreamError::UnknownError }; } -QHttp2Stream *QHttp2Connection::createStreamInternal_impl(quint32 streamID) +QHttp2Stream *QHttp2Connection::createStreamInternal_impl(quint32 streamID, + QHttp2Stream::Configuration conf) { Q_ASSERT(streamID > m_lastIncomingStreamID || streamID >= m_nextStreamID); @@ -930,7 +985,7 @@ QHttp2Stream *QHttp2Connection::createStreamInternal_impl(quint32 streamID) if (!result.inserted) return nullptr; QPointer<QHttp2Stream> &stream = result.iterator.value(); - stream = new QHttp2Stream(this, streamID); + stream = new QHttp2Stream(this, streamID, conf); stream->m_recvWindow = streamInitialReceiveWindowSize; stream->m_sendWindow = streamInitialSendWindowSize; diff --git a/src/network/access/qhttp2connection_p.h b/src/network/access/qhttp2connection_p.h index f3f14145278..e2af7d7ab33 100644 --- a/src/network/access/qhttp2connection_p.h +++ b/src/network/access/qhttp2connection_p.h @@ -101,6 +101,11 @@ public: Q_ENUM(State) constexpr static quint8 DefaultPriority = 127; + struct Configuration + { + bool useDownloadBuffer = true; + }; + ~QHttp2Stream() noexcept; // HTTP2 things @@ -124,6 +129,8 @@ public: QByteDataBuffer takeDownloadBuffer() noexcept { return std::exchange(m_downloadBuffer, {}); } void clearDownloadBuffer() { m_downloadBuffer.clear(); } + Configuration configuration() const { return m_configuration; } + Q_SIGNALS: void headersReceived(const HPack::HttpHeader &headers, bool endStream); void headersUpdated(); @@ -154,7 +161,8 @@ private Q_SLOTS: private: friend class QHttp2Connection; - QHttp2Stream(QHttp2Connection *connection, quint32 streamID) noexcept; + QHttp2Stream(QHttp2Connection *connection, quint32 streamID, + Configuration configuration) noexcept; [[nodiscard]] QHttp2Connection *getConnection() const { @@ -201,6 +209,8 @@ private: bool m_isReserved = false; bool m_owningByteDevice = false; + const Configuration m_configuration; + friend tst_QHttp2Connection; }; @@ -235,7 +245,12 @@ public: createDirectServerConnection(QIODevice *socket, const QHttp2Configuration &config); ~QHttp2Connection(); - [[nodiscard]] QH2Expected<QHttp2Stream *, CreateStreamError> createStream(); + [[nodiscard]] QH2Expected<QHttp2Stream *, CreateStreamError> createStream() + { + return createStream(QHttp2Stream::Configuration{}); + } + [[nodiscard]] QH2Expected<QHttp2Stream *, CreateStreamError> + createStream(QHttp2Stream::Configuration config); QHttp2Stream *getStream(quint32 streamId) const; QHttp2Stream *promisedStream(const QUrl &streamKey) const @@ -278,8 +293,9 @@ private: friend class QHttp2Stream; [[nodiscard]] QIODevice *getSocket() const { return qobject_cast<QIODevice *>(parent()); } - QH2Expected<QHttp2Stream *, QHttp2Connection::CreateStreamError> createLocalStreamInternal(); - QHttp2Stream *createStreamInternal_impl(quint32 streamID); + QH2Expected<QHttp2Stream *, QHttp2Connection::CreateStreamError> + createLocalStreamInternal(QHttp2Stream::Configuration = {}); + QHttp2Stream *createStreamInternal_impl(quint32 streamID, QHttp2Stream::Configuration = {}); bool isInvalidStream(quint32 streamID) noexcept; bool streamWasResetLocally(quint32 streamID) noexcept; diff --git a/src/plugins/sqldrivers/.cmake.conf b/src/plugins/sqldrivers/.cmake.conf index be788d10f8e..846c4f3b923 100644 --- a/src/plugins/sqldrivers/.cmake.conf +++ b/src/plugins/sqldrivers/.cmake.conf @@ -1 +1 @@ -set(QT_REPO_MODULE_VERSION "6.11.0") +set(QT_REPO_MODULE_VERSION "6.12.0") diff --git a/src/testlib/doc/src/qt-webpages.qdoc b/src/testlib/doc/src/qt-webpages.qdoc index 611f3795ba9..b32fd4f750f 100644 --- a/src/testlib/doc/src/qt-webpages.qdoc +++ b/src/testlib/doc/src/qt-webpages.qdoc @@ -15,7 +15,3 @@ \title Googletest Mocking (gMock) Framework */ -/*! - \externalpage https://www.itk.org/Wiki/CMake_Testing_With_CTest - \title CMake/Testing With CTest -*/ diff --git a/src/widgets/doc/src/external-resources.qdoc b/src/widgets/doc/src/external-resources.qdoc index 96117546a29..0eccc3b19d4 100644 --- a/src/widgets/doc/src/external-resources.qdoc +++ b/src/widgets/doc/src/external-resources.qdoc @@ -1,12 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \externalpage http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html - \title Apple Human Interface Guidelines -*/ - /*! \externalpage https://rk.nvg.ntnu.no/sinclair/computers/zxspectrum/zxspectrum.htm \title Sinclair Spectrum diff --git a/src/xml/doc/src/external-resources.qdoc b/src/xml/doc/src/external-resources.qdoc index 89c30a84c47..89552477ae8 100644 --- a/src/xml/doc/src/external-resources.qdoc +++ b/src/xml/doc/src/external-resources.qdoc @@ -1,17 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \externalpage http://www.w3.org/2000/xmlns/ - \title http://www.w3.org/2000/xmlns/ -*/ - -/*! - \externalpage http://www.saxproject.org/ - \title SAX2 Java interface -*/ - /*! \externalpage http://www.w3.org/TR/DOM-Level-2-Core/ \title W3C DOM Level 2 |
