diff --git a/desktop/toolkit/qt5/qt5-base/files/qt_kde.patch b/desktop/toolkit/qt5/qt5-base/files/qt_kde.patch index 5cf68efdd9..9c2ab55228 100644 --- a/desktop/toolkit/qt5/qt5-base/files/qt_kde.patch +++ b/desktop/toolkit/qt5/qt5-base/files/qt_kde.patch @@ -20602,6 +20602,21 @@ index 5a616faa4c..5512635f97 100644 # Make sure to delete the "android-build" directory, which contains all the # build artefacts, and also the androiddeployqt/gradle artefacts +diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp +index 98b02f0202..eac1524107 100644 +--- a/src/corelib/animation/qvariantanimation.cpp ++++ b/src/corelib/animation/qvariantanimation.cpp +@@ -276,7 +276,9 @@ void QVariantAnimationPrivate::setCurrentValueForProgress(const qreal progress) + + const qreal startProgress = currentInterval.start.first; + const qreal endProgress = currentInterval.end.first; +- const qreal localProgress = (progress - startProgress) / (endProgress - startProgress); ++ const qreal localProgress = ++ qIsNull(progress - startProgress) ? 0.0 // avoid 0/0 below ++ /* else */ : (progress - startProgress) / (endProgress - startProgress); + + QVariant ret = q->interpolated(currentInterval.start.second, + currentInterval.end.second, diff --git a/src/corelib/configure.json b/src/corelib/configure.json index c5e0423273..9b5d19d41b 100644 --- a/src/corelib/configure.json @@ -20768,6 +20783,46 @@ index 10672c1f92..25f87c7e6a 100644 #endif } +diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp +index 070139b608..ef6e91d826 100644 +--- a/src/corelib/io/qabstractfileengine.cpp ++++ b/src/corelib/io/qabstractfileengine.cpp +@@ -101,7 +101,7 @@ QT_BEGIN_NAMESPACE + \sa QAbstractFileEngine, QAbstractFileEngine::create() + */ + +-static bool qt_file_engine_handlers_in_use = false; ++static QBasicAtomicInt qt_file_engine_handlers_in_use = Q_BASIC_ATOMIC_INITIALIZER(false); + + /* + All application-wide handlers are stored in this list. The mutex must be +@@ -132,7 +132,7 @@ Q_GLOBAL_STATIC(QAbstractFileEngineHandlerList, fileEngineHandlers) + QAbstractFileEngineHandler::QAbstractFileEngineHandler() + { + QWriteLocker locker(fileEngineHandlerMutex()); +- qt_file_engine_handlers_in_use = true; ++ qt_file_engine_handlers_in_use.storeRelaxed(true); + fileEngineHandlers()->prepend(this); + } + +@@ -148,7 +148,7 @@ QAbstractFileEngineHandler::~QAbstractFileEngineHandler() + QAbstractFileEngineHandlerList *handlers = fileEngineHandlers(); + handlers->removeOne(this); + if (handlers->isEmpty()) +- qt_file_engine_handlers_in_use = false; ++ qt_file_engine_handlers_in_use.storeRelaxed(false); + } + } + +@@ -161,7 +161,7 @@ QAbstractFileEngine *qt_custom_file_engine_handler_create(const QString &path) + { + QAbstractFileEngine *engine = nullptr; + +- if (qt_file_engine_handlers_in_use) { ++ if (qt_file_engine_handlers_in_use.loadRelaxed()) { + QReadLocker locker(fileEngineHandlerMutex()); + + // check for registered handlers that can load the file diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp index 7411eab68b..c58dde8bfd 100644 --- a/src/corelib/io/qdiriterator.cpp @@ -21456,6 +21511,19 @@ index d743d5a5c7..50e5654221 100644 } // namespace QModulesPrivate #undef QT_DECLARE_CORE_MODULE_TYPES_ITER +diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp +index 4a4fdc4ace..8f4083ba9d 100644 +--- a/src/corelib/kernel/qobject.cpp ++++ b/src/corelib/kernel/qobject.cpp +@@ -4223,7 +4223,7 @@ void QObject::dumpObjectInfo() const + qDebug(" SIGNALS OUT"); + + QObjectPrivate::ConnectionData *cd = d->connections.loadRelaxed(); +- if (cd && cd->signalVectorCount()) { ++ if (cd && cd->signalVectorCount() > 0) { + QObjectPrivate::SignalVector *signalVector = cd->signalVector.loadRelaxed(); + for (int signal_index = 0; signal_index < signalVector->count(); ++signal_index) { + const QObjectPrivate::Connection *c = signalVector->at(signal_index).first.loadRelaxed(); diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index d7d670b5bc..36d9ea4998 100644 --- a/src/corelib/kernel/qtranslator.cpp @@ -68425,7 +68493,7 @@ index f076ea06a7..c960eaeef4 100644 static const char language_name_list[] = diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp -index f9ec7678fe..e6e7cbaad4 100644 +index f9ec7678fe..7ba3c53e8c 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -1331,11 +1331,11 @@ const QString::Null QString::null = { }; @@ -68527,6 +68595,15 @@ index f9ec7678fe..e6e7cbaad4 100644 QRegularExpressionMatch match = re.match(*this, index + 1); if (!match.hasMatch()) break; +@@ -12290,7 +12291,7 @@ static qsizetype qLastIndexOf(Haystack haystack0, qsizetype from, + const auto needle = needle0.data(); + const auto *end = haystack; + haystack += from; +- const std::size_t sl_minus_1 = sl - 1; ++ const std::size_t sl_minus_1 = sl ? sl - 1 : 0; + const auto *n = needle + sl_minus_1; + const auto *h = haystack + sl_minus_1; + std::size_t hashNeedle = 0, hashHaystack = 0; diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index 5a4ac497e0..8b71c014e0 100644 --- a/src/corelib/text/qstring.h @@ -68668,6 +68745,84 @@ index 93c4bf23e8..b2e2640ba2 100644 private: Q_DISABLE_COPY(QMutex) friend class QMutexLocker; +diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp +index d4fb756b94..1d01fc1b28 100644 +--- a/src/corelib/thread/qsemaphore.cpp ++++ b/src/corelib/thread/qsemaphore.cpp +@@ -357,47 +357,31 @@ void QSemaphore::release(int n) + quintptr prevValue = u.fetchAndAddRelease(nn); + if (futexNeedsWake(prevValue)) { + #ifdef FUTEX_OP +- if (!futexHasWaiterCount) { +- /* +- On 32-bit systems, all waiters are waiting on the same address, +- so we'll wake them all and ask the kernel to clear the high bit. +- +- atomic { +- int oldval = u; +- u = oldval & ~(1 << 31); +- futexWake(u, INT_MAX); +- if (oldval == 0) // impossible condition +- futexWake(u, INT_MAX); +- } +- */ +- quint32 op = FUTEX_OP_ANDN | FUTEX_OP_OPARG_SHIFT; +- quint32 oparg = 31; +- quint32 cmp = FUTEX_OP_CMP_EQ; +- quint32 cmparg = 0; +- futexWakeOp(u, INT_MAX, INT_MAX, u, FUTEX_OP(op, oparg, cmp, cmparg)); +- } else { ++ if (futexHasWaiterCount) { + /* + On 64-bit systems, the single-token waiters wait on the low half + and the multi-token waiters wait on the upper half. So we ask + the kernel to wake up n single-token waiters and all multi-token +- waiters (if any), then clear the multi-token wait bit. ++ waiters (if any), and clear the multi-token wait bit. + + atomic { + int oldval = *upper; +- *upper = oldval & ~(1 << 31); ++ *upper = oldval | 0; + futexWake(lower, n); +- if (oldval < 0) // sign bit set ++ if (oldval != 0) // always true + futexWake(upper, INT_MAX); + } + */ +- quint32 op = FUTEX_OP_ANDN | FUTEX_OP_OPARG_SHIFT; +- quint32 oparg = 31; +- quint32 cmp = FUTEX_OP_CMP_LT; ++ quint32 op = FUTEX_OP_OR; ++ quint32 oparg = 0; ++ quint32 cmp = FUTEX_OP_CMP_NE; + quint32 cmparg = 0; ++ u.fetchAndAndRelease(futexNeedsWakeAllBit - 1); + futexWakeOp(*futexLow32(&u), n, INT_MAX, *futexHigh32(&u), FUTEX_OP(op, oparg, cmp, cmparg)); ++ return; + } +-#else +- // Unset the bit and wake everyone. There are two possibibilies ++#endif ++ // Unset the bit and wake everyone. There are two possibilities + // under which a thread can set the bit between the AND and the + // futexWake: + // 1) it did see the new counter value, but it wasn't enough for +@@ -405,8 +389,12 @@ void QSemaphore::release(int n) + // 2) it did not see the new counter value, in which case its + // futexWait will fail. + u.fetchAndAndRelease(futexNeedsWakeAllBit - 1); +- futexWakeAll(u); +-#endif ++ if (futexHasWaiterCount) { ++ futexWakeAll(*futexLow32(&u)); ++ futexWakeAll(*futexHigh32(&u)); ++ } else { ++ futexWakeAll(u); ++ } + } + return; + } diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp index 88b058f410..0f1da4dc9b 100644 --- a/src/corelib/thread/qwaitcondition_unix.cpp @@ -68901,10 +69056,18 @@ index 21506e9e2c..c9f934fef9 100644 // Locale support: virtual const QCalendarLocale *localeMonthIndexData() const = 0; diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp -index 756264a00e..a2816e87f4 100644 +index 756264a00e..8e7a380071 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp -@@ -240,7 +240,7 @@ static int fromOffsetString(QStringView offsetString, bool *valid) noexcept +@@ -43,6 +43,7 @@ + #if QT_CONFIG(datetimeparser) + #include "private/qdatetimeparser_p.h" + #endif ++#include + + #include "qdatastream.h" + #include "qset.h" +@@ -240,7 +241,7 @@ static int fromOffsetString(QStringView offsetString, bool *valid) noexcept const QStringView hhRef = time.left(qMin(hhLen, time.size())); bool ok = false; const int hour = C.toInt(hhRef, &ok); @@ -68913,7 +69076,22 @@ index 756264a00e..a2816e87f4 100644 return 0; const QStringView mmRef = time.mid(qMin(mmIndex, time.size())); -@@ -5502,7 +5502,13 @@ QT_WARNING_POP +@@ -1429,9 +1430,11 @@ QDate QDate::addDays(qint64 ndays) const + if (isNull()) + return QDate(); + +- // Due to limits on minJd() and maxJd() we know that any overflow +- // will be invalid and caught by fromJulianDay(). +- return fromJulianDay(jd + ndays); ++ qint64 r; ++ if (Q_UNLIKELY(add_overflow(jd, ndays, &r))) ++ return QDate(); ++ else ++ return fromJulianDay(r); + } + + /*! +@@ -5502,7 +5505,13 @@ QT_WARNING_POP \snippet code/src_corelib_tools_qdatetime.cpp 12 @@ -68928,7 +69106,7 @@ index 756264a00e..a2816e87f4 100644 The expressions that don't have leading zeroes (d, M, h, m, s, z) will be greedy. This means that they will use two digits even if this will put them outside the range and/or leave too few digits for other -@@ -5557,7 +5563,7 @@ QDateTime QDateTime::fromString(const QString &string, const QString &format, QC +@@ -5557,7 +5566,7 @@ QDateTime QDateTime::fromString(const QString &string, const QString &format, QC QDateTimeParser dt(QMetaType::QDateTime, QDateTimeParser::FromString, cal); // dt.setDefaultLocale(QLocale::c()); ### Qt 6 @@ -75458,9 +75636,20 @@ index 6d2bbc83c1..ccf2234540 100644 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x48, 0x65, 0x72, 0x6d, 0x6f, 0x73, 0x69, 0x6c, 0x6c, 0x6f, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x68, 0x6f, 0x65, 0x6e, 0x69, 0x78, 0x0, 0x45, 0x74, 0x63, 0x2f, diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp -index b816b4ecff..adc590878d 100644 +index b816b4ecff..48d1803455 100644 --- a/src/corelib/time/qtimezoneprivate_tz.cpp +++ b/src/corelib/time/qtimezoneprivate_tz.cpp +@@ -371,8 +371,8 @@ static QDate calculatePosixDate(const QByteArray &dateRule, int year) + int month = dateParts.at(0).mid(1).toInt(); + int week = dateParts.at(1).toInt(); + int dow = dateParts.at(2).toInt(); +- if (dow == 0) +- ++dow; ++ if (dow == 0) // Sunday; we represent it as 7 ++ dow = 7; + return calculateDowDate(year, month, dow, week); + } else if (dateRule.at(0) == 'J') { + // Day of Year ignores Feb 29 @@ -394,29 +394,34 @@ static int parsePosixTime(const char *begin, const char *end) // Format "hh[:mm[:ss]]" int hour, min = 0, sec = 0; @@ -75645,7 +75834,7 @@ index 790c187cb9..8abb57586b 100644 return std::shared_ptr(); } diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h -index 6be695e317..0110956b77 100644 +index 6be695e317..f9003c31a2 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -153,18 +153,10 @@ public: @@ -75691,6 +75880,15 @@ index 6be695e317..0110956b77 100644 if (!QTypeInfoQuery::isRelocatable) { T *b = ptr + offset; T *j = ptr + s; +@@ -549,6 +538,8 @@ Q_OUTOFLINE_TEMPLATE typename QVarLengthArray::iterator QVarLengthA + int f = int(abegin - ptr); + int l = int(aend - ptr); + int n = l - f; ++ if (n == 0) // avoid UB in std::copy() below ++ return ptr + f; + if (QTypeInfo::isComplex) { + std::copy(ptr + l, ptr + s, QT_MAKE_CHECKED_ARRAY_ITERATOR(ptr + f, s - f)); + T *i = ptr + s; diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 8d1b15b507..d61c26dc2e 100644 --- a/src/corelib/tools/qvector.h @@ -75807,7 +76005,7 @@ index c8c4864eca..12c95742d2 100644 "x11prefix": { "label": "X11 prefix", diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp -index ced5a505eb..5560b7a3bb 100644 +index ced5a505eb..b482bf8227 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -182,7 +182,7 @@ QImageData::~QImageData() @@ -75828,7 +76026,15 @@ index ced5a505eb..5560b7a3bb 100644 #pragma optimize("", on) #endif -@@ -2647,12 +2647,9 @@ void QImage::setPixelColor(int x, int y, const QColor &color) +@@ -2255,6 +2255,7 @@ bool QImage::reinterpretAsFormat(Format format) + // In case detach() ran out of memory + if (!d) { + d = oldD; ++ d->ref.ref(); + return false; + } + } +@@ -2647,12 +2648,9 @@ void QImage::setPixelColor(int x, int y, const QColor &color) ((uint *)s)[x] = qConvertRgb64ToRgb30(c); return; case Format_RGBX64: @@ -75842,7 +76048,7 @@ index ced5a505eb..5560b7a3bb 100644 return; default: setPixel(x, y, c.toArgb32()); -@@ -5061,7 +5058,7 @@ void QImage::applyColorTransform(const QColorTransform &transform) +@@ -5061,7 +5059,7 @@ void QImage::applyColorTransform(const QColorTransform &transform) int segments = sizeInBytes() / (1<<16); segments = std::min(segments, height()); QThreadPool *threadPool = QThreadPool::globalInstance(); @@ -75890,6 +76096,125 @@ index 6807ce937a..eedfe3e00e 100644 } colorSpaceState = GammaChrm; } +diff --git a/src/gui/image/qppmhandler.cpp b/src/gui/image/qppmhandler.cpp +index 728259ba9e..b03458bdd9 100644 +--- a/src/gui/image/qppmhandler.cpp ++++ b/src/gui/image/qppmhandler.cpp +@@ -63,7 +63,7 @@ static void discard_pbm_line(QIODevice *d) + } while (res > 0 && buf[res-1] != '\n'); + } + +-static int read_pbm_int(QIODevice *d) ++static int read_pbm_int(QIODevice *d, bool *ok) + { + char c; + int val = -1; +@@ -97,6 +97,8 @@ static int read_pbm_int(QIODevice *d) + else + break; + } ++ if (val < 0) ++ *ok = false; + return hasOverflow ? -1 : val; + } + +@@ -113,16 +115,17 @@ static bool read_pbm_header(QIODevice *device, char& type, int& w, int& h, int& + if (type < '1' || type > '6') + return false; + +- w = read_pbm_int(device); // get image width +- h = read_pbm_int(device); // get image height ++ bool ok = true; ++ w = read_pbm_int(device, &ok); // get image width ++ h = read_pbm_int(device, &ok); // get image height + + if (type == '1' || type == '4') + mcc = 1; // ignore max color component + else +- mcc = read_pbm_int(device); // get max color component ++ mcc = read_pbm_int(device, &ok); // get max color component + +- if (w <= 0 || w > 32767 || h <= 0 || h > 32767 || mcc <= 0 || mcc > 0xffff) +- return false; // weird P.M image ++ if (!ok || w <= 0 || w > 32767 || h <= 0 || h > 32767 || mcc <= 0 || mcc > 0xffff) ++ return false; // weird P.M image + + return true; + } +@@ -233,18 +236,18 @@ static bool read_pbm_body(QIODevice *device, char type, int w, int h, int mcc, Q + } else { // read ascii data + uchar *p; + int n; +- char buf; +- for (y = 0; (y < h) && (device->peek(&buf, 1) == 1); y++) { ++ bool ok = true; ++ for (y = 0; y < h && ok; y++) { + p = outImage->scanLine(y); + n = pbm_bpl; + if (nbits == 1) { + int b; + int bitsLeft = w; +- while (n--) { ++ while (n-- && ok) { + b = 0; + for (int i=0; i<8; i++) { + if (i < bitsLeft) +- b = (b << 1) | (read_pbm_int(device) & 1); ++ b = (b << 1) | (read_pbm_int(device, &ok) & 1); + else + b = (b << 1) | (0 & 1); // pad it our self if we need to + } +@@ -253,36 +256,38 @@ static bool read_pbm_body(QIODevice *device, char type, int w, int h, int mcc, Q + } + } else if (nbits == 8) { + if (mcc == 255) { +- while (n--) { +- *p++ = read_pbm_int(device); ++ while (n-- && ok) { ++ *p++ = read_pbm_int(device, &ok); + } + } else { +- while (n--) { +- *p++ = (read_pbm_int(device) & 0xffff) * 255 / mcc; ++ while (n-- && ok) { ++ *p++ = (read_pbm_int(device, &ok) & 0xffff) * 255 / mcc; + } + } + } else { // 32 bits + n /= 4; + int r, g, b; + if (mcc == 255) { +- while (n--) { +- r = read_pbm_int(device); +- g = read_pbm_int(device); +- b = read_pbm_int(device); ++ while (n-- && ok) { ++ r = read_pbm_int(device, &ok); ++ g = read_pbm_int(device, &ok); ++ b = read_pbm_int(device, &ok); + *((QRgb*)p) = qRgb(r, g, b); + p += 4; + } + } else { +- while (n--) { +- r = read_pbm_int(device); +- g = read_pbm_int(device); +- b = read_pbm_int(device); ++ while (n-- && ok) { ++ r = read_pbm_int(device, &ok); ++ g = read_pbm_int(device, &ok); ++ b = read_pbm_int(device, &ok); + *((QRgb*)p) = scale_pbm_color(mcc, r, g, b); + p += 4; + } + } + } + } ++ if (!ok) ++ return false; + } + + if (format == QImage::Format_Mono) { diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index 8acc80776c..16fd78f25f 100644 --- a/src/gui/image/qxpmhandler.cpp @@ -76611,7 +76936,7 @@ index f1fd755e91..d9c0239940 100644 Q_ASSERT(at < m_engines.size()); if (!m_engines.at(at)) { diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp -index a2b3c8dc76..9d70873590 100644 +index a2b3c8dc76..322f494e5d 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -105,14 +105,13 @@ public: @@ -76630,7 +76955,29 @@ index a2b3c8dc76..9d70873590 100644 { } -@@ -2944,7 +2943,7 @@ QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, in +@@ -2358,9 +2357,10 @@ QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QT + floatMinWidth = qMax(floatMinWidth, cd->minimumWidth); + } + +- // constraint the maximumWidth by the minimum width of the fixed size floats, to +- // keep them visible ++ // constraint the maximum/minimumWidth by the minimum width of the fixed size floats, ++ // to keep them visible + layoutStruct.maximumWidth = qMax(layoutStruct.maximumWidth, floatMinWidth); ++ layoutStruct.minimumWidth = qMax(layoutStruct.minimumWidth, floatMinWidth); + + // as floats in cells get added to the table's float list but must not affect + // floats in other cells we must clear the list here. +@@ -2537,6 +2537,8 @@ recalc_minmax_widths: + for (int n = 0; n < cspan; ++n) { + const int col = i + n; + QFixed w = widthToDistribute / (cspan - n); ++ if (td->maxWidths[col] != QFIXED_MAX) ++ w = qMax(td->maxWidths[col], w); + td->maxWidths[col] = qMax(td->minWidths.at(col), w); + widthToDistribute -= td->maxWidths.at(col); + if (widthToDistribute <= 0) +@@ -2944,7 +2946,7 @@ QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, in QTextFrameData *fd = data(f); QFixed newContentsWidth; @@ -76639,7 +76986,7 @@ index a2b3c8dc76..9d70873590 100644 { QTextFrameFormat fformat = f->frameFormat(); // set sizes of this frame from the format -@@ -3398,7 +3397,6 @@ void QTextDocumentLayoutPrivate::layoutFlow(QTextFrame::Iterator it, QTextLayout +@@ -3398,7 +3400,6 @@ void QTextDocumentLayoutPrivate::layoutFlow(QTextFrame::Iterator it, QTextLayout cp.contentsWidth = layoutStruct->contentsWidth; checkPoints.append(cp); checkPoints.reserve(checkPoints.size()); @@ -76647,7 +76994,7 @@ index a2b3c8dc76..9d70873590 100644 } else { currentLazyLayoutPosition = checkPoints.constLast().positionInFrame; // ####### -@@ -3810,7 +3808,6 @@ void QTextDocumentLayout::documentChanged(int from, int oldLength, int length) +@@ -3810,7 +3811,6 @@ void QTextDocumentLayout::documentChanged(int from, int oldLength, int length) d->contentHasAlignment = false; d->currentLazyLayoutPosition = 0; d->checkPoints.clear(); @@ -77440,6 +77787,90 @@ index 8b5035ad96..4b1510eb3c 100644 return false; versionString = QByteArray::number(elem.value().at(0) + 1); +diff --git a/src/network/ssl/qsslcontext_openssl.cpp b/src/network/ssl/qsslcontext_openssl.cpp +index c9f202f573..d0a428c2d2 100644 +--- a/src/network/ssl/qsslcontext_openssl.cpp ++++ b/src/network/ssl/qsslcontext_openssl.cpp +@@ -409,7 +409,7 @@ init_context: + break; + case QSsl::DtlsV1_0OrLater: + minVersion = DTLS1_VERSION; +- maxVersion = DTLS_MAX_VERSION; ++ maxVersion = 0; + break; + case QSsl::DtlsV1_2: + minVersion = DTLS1_2_VERSION; +@@ -417,7 +417,7 @@ init_context: + break; + case QSsl::DtlsV1_2OrLater: + minVersion = DTLS1_2_VERSION; +- maxVersion = DTLS_MAX_VERSION; ++ maxVersion = 0; + break; + case QSsl::TlsV1_3OrLater: + #ifdef TLS1_3_VERSION +diff --git a/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp b/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp +index aaf8741130..b58935372c 100644 +--- a/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp ++++ b/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp +@@ -59,57 +59,6 @@ + + QT_BEGIN_NAMESPACE + +-#ifdef OPENSSL_NO_DEPRECATED_3_0 +- +-static int q_DH_check(DH *dh, int *status) +-{ +- // DH_check was first deprecated in OpenSSL 3.0.0, as low-level +- // API; the EVP_PKEY family of functions was advised as an alternative. +- // As of now EVP_PKEY_params_check ends up calling ... DH_check, +- // which is good enough. +- +- Q_ASSERT(dh); +- Q_ASSERT(status); +- +- EVP_PKEY *key = q_EVP_PKEY_new(); +- if (!key) { +- qCWarning(lcSsl, "EVP_PKEY_new failed"); +- QSslSocketBackendPrivate::logAndClearErrorQueue(); +- return 0; +- } +- const auto keyDeleter = qScopeGuard([key](){ +- q_EVP_PKEY_free(key); +- }); +- if (!q_EVP_PKEY_set1_DH(key, dh)) { +- qCWarning(lcSsl, "EVP_PKEY_set1_DH failed"); +- QSslSocketBackendPrivate::logAndClearErrorQueue(); +- return 0; +- } +- +- EVP_PKEY_CTX *keyCtx = q_EVP_PKEY_CTX_new(key, nullptr); +- if (!keyCtx) { +- qCWarning(lcSsl, "EVP_PKEY_CTX_new failed"); +- QSslSocketBackendPrivate::logAndClearErrorQueue(); +- return 0; +- } +- const auto ctxDeleter = qScopeGuard([keyCtx]{ +- q_EVP_PKEY_CTX_free(keyCtx); +- }); +- +- const int result = q_EVP_PKEY_param_check(keyCtx); +- QSslSocketBackendPrivate::logAndClearErrorQueue(); +- // Note: unlike DH_check, we cannot obtain the 'status', +- // if the 'result' is 0 (actually the result is 1 only +- // if this 'status' was 0). We could probably check the +- // errors from the error queue, but it's not needed anyway +- // - see the 'isSafeDH' below, how it returns immediately +- // on 0. +- Q_UNUSED(status) +- +- return result; +-} +-#endif // OPENSSL_NO_DEPRECATED_3_0 +- + static bool isSafeDH(DH *dh) + { + int status = 0; diff --git a/src/network/ssl/qsslkey_openssl.cpp b/src/network/ssl/qsslkey_openssl.cpp index 43cb8c6de8..10f6c6c26e 100644 --- a/src/network/ssl/qsslkey_openssl.cpp @@ -77495,6 +77926,127 @@ index 277037e59c..af47dbf9ac 100644 } QList QSslSocketBackendPrivate::verify(const QList &caCertificates, +diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp +index ed80fc14bd..0f48e498bb 100644 +--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp ++++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp +@@ -148,7 +148,6 @@ DEFINEFUNC(int, EVP_PKEY_up_ref, EVP_PKEY *a, a, return 0, return) + DEFINEFUNC2(EVP_PKEY_CTX *, EVP_PKEY_CTX_new, EVP_PKEY *pkey, pkey, ENGINE *e, e, return nullptr, return) + DEFINEFUNC(int, EVP_PKEY_param_check, EVP_PKEY_CTX *ctx, ctx, return 0, return) + DEFINEFUNC(void, EVP_PKEY_CTX_free, EVP_PKEY_CTX *ctx, ctx, return, return) +-DEFINEFUNC(int, EVP_PKEY_base_id, EVP_PKEY *a, a, return NID_undef, return) + DEFINEFUNC(int, RSA_bits, RSA *a, a, return 0, return) + DEFINEFUNC(int, DSA_bits, DSA *a, a, return 0, return) + DEFINEFUNC(int, OPENSSL_sk_num, OPENSSL_STACK *a, a, return -1, return) +@@ -368,7 +367,15 @@ DEFINEFUNC(const SSL_CIPHER *, SSL_get_current_cipher, SSL *a, a, return nullptr + DEFINEFUNC(int, SSL_version, const SSL *a, a, return 0, return) + DEFINEFUNC2(int, SSL_get_error, SSL *a, a, int b, b, return -1, return) + DEFINEFUNC(STACK_OF(X509) *, SSL_get_peer_cert_chain, SSL *a, a, return nullptr, return) ++ ++#if defined(OPENSSL_VERSION_MAJOR) && OPENSSL_VERSION_MAJOR >= 3 ++DEFINEFUNC(X509 *, SSL_get1_peer_certificate, SSL *a, a, return nullptr, return) ++DEFINEFUNC(int, EVP_PKEY_get_base_id, const EVP_PKEY *pkey, pkey, return -1, return) ++#else + DEFINEFUNC(X509 *, SSL_get_peer_certificate, SSL *a, a, return nullptr, return) ++DEFINEFUNC(int, EVP_PKEY_base_id, EVP_PKEY *a, a, return NID_undef, return) ++#endif // OPENSSL_VERSION_MAJOR >= 3 ++ + DEFINEFUNC(long, SSL_get_verify_result, const SSL *a, a, return -1, return) + DEFINEFUNC(SSL *, SSL_new, SSL_CTX *a, a, return nullptr, return) + DEFINEFUNC(SSL_CTX *, SSL_get_SSL_CTX, SSL *a, a, return nullptr, return) +@@ -489,9 +496,7 @@ DEFINEFUNC(DH *, DH_new, DUMMYARG, DUMMYARG, return nullptr, return) + DEFINEFUNC(void, DH_free, DH *dh, dh, return, DUMMYARG) + DEFINEFUNC3(DH *, d2i_DHparams, DH**a, a, const unsigned char **pp, pp, long length, length, return nullptr, return) + DEFINEFUNC2(int, i2d_DHparams, DH *a, a, unsigned char **p, p, return -1, return) +-#ifndef OPENSSL_NO_DEPRECATED_3_0 + DEFINEFUNC2(int, DH_check, DH *dh, dh, int *codes, codes, return 0, return) +-#endif // OPENSSL_NO_DEPRECATED_3_0 + DEFINEFUNC3(BIGNUM *, BN_bin2bn, const unsigned char *s, s, int len, len, BIGNUM *ret, ret, return nullptr, return) + + #ifndef OPENSSL_NO_EC +@@ -848,7 +853,6 @@ bool q_resolveOpenSslSymbols() + RESOLVEFUNC(EVP_PKEY_CTX_new) + RESOLVEFUNC(EVP_PKEY_param_check) + RESOLVEFUNC(EVP_PKEY_CTX_free) +- RESOLVEFUNC(EVP_PKEY_base_id) + RESOLVEFUNC(RSA_bits) + RESOLVEFUNC(OPENSSL_sk_new_null) + RESOLVEFUNC(OPENSSL_sk_push) +@@ -1073,7 +1077,15 @@ bool q_resolveOpenSslSymbols() + RESOLVEFUNC(SSL_version) + RESOLVEFUNC(SSL_get_error) + RESOLVEFUNC(SSL_get_peer_cert_chain) ++ ++#if defined(OPENSSL_VERSION_MAJOR) && OPENSSL_VERSION_MAJOR >= 3 ++ RESOLVEFUNC(SSL_get1_peer_certificate) ++ RESOLVEFUNC(EVP_PKEY_get_base_id) ++#else + RESOLVEFUNC(SSL_get_peer_certificate) ++ RESOLVEFUNC(EVP_PKEY_base_id) ++#endif // OPENSSL_VERSION_MAJOR >= 3 ++ + RESOLVEFUNC(SSL_get_verify_result) + RESOLVEFUNC(SSL_new) + RESOLVEFUNC(SSL_get_SSL_CTX) +@@ -1172,9 +1184,7 @@ bool q_resolveOpenSslSymbols() + RESOLVEFUNC(DH_free) + RESOLVEFUNC(d2i_DHparams) + RESOLVEFUNC(i2d_DHparams) +-#ifndef OPENSSL_NO_DEPRECATED_3_0 + RESOLVEFUNC(DH_check) +-#endif // OPENSSL_NO_DEPRECATED_3_0 + RESOLVEFUNC(BN_bin2bn) + + #ifndef OPENSSL_NO_EC +diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h +index c46afcf53e..b36d0bc126 100644 +--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h ++++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h +@@ -236,7 +236,6 @@ Q_AUTOTEST_EXPORT int q_EVP_PKEY_up_ref(EVP_PKEY *a); + EVP_PKEY_CTX *q_EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e); + void q_EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx); + int q_EVP_PKEY_param_check(EVP_PKEY_CTX *ctx); +-int q_EVP_PKEY_base_id(EVP_PKEY *a); + int q_RSA_bits(RSA *a); + Q_AUTOTEST_EXPORT int q_OPENSSL_sk_num(OPENSSL_STACK *a); + Q_AUTOTEST_EXPORT void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *)); +@@ -509,7 +508,6 @@ const SSL_CIPHER *q_SSL_get_current_cipher(SSL *a); + int q_SSL_version(const SSL *a); + int q_SSL_get_error(SSL *a, int b); + STACK_OF(X509) *q_SSL_get_peer_cert_chain(SSL *a); +-X509 *q_SSL_get_peer_certificate(SSL *a); + long q_SSL_get_verify_result(const SSL *a); + SSL *q_SSL_new(SSL_CTX *a); + SSL_CTX *q_SSL_get_SSL_CTX(SSL *a); +@@ -581,10 +579,7 @@ DH *q_DH_new(); + void q_DH_free(DH *dh); + DH *q_d2i_DHparams(DH **a, const unsigned char **pp, long length); + int q_i2d_DHparams(DH *a, unsigned char **p); +- +-#ifndef OPENSSL_NO_DEPRECATED_3_0 + int q_DH_check(DH *dh, int *codes); +-#endif // OPENSSL_NO_DEPRECATED_3_0 + + BIGNUM *q_BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret); + #define q_SSL_CTX_set_tmp_dh(ctx, dh) q_SSL_CTX_ctrl((ctx), SSL_CTRL_SET_TMP_DH, 0, (char *)dh) +@@ -751,6 +746,17 @@ void *q_CRYPTO_malloc(size_t num, const char *file, int line); + int q_SSL_CTX_get_security_level(const SSL_CTX *ctx); + void q_SSL_CTX_set_security_level(SSL_CTX *ctx, int level); + ++// Here we have the ones that make difference between OpenSSL pre/post v3: ++#if defined(OPENSSL_VERSION_MAJOR) && OPENSSL_VERSION_MAJOR >= 3 ++X509 *q_SSL_get1_peer_certificate(SSL *a); ++#define q_SSL_get_peer_certificate q_SSL_get1_peer_certificate ++int q_EVP_PKEY_get_base_id(const EVP_PKEY *pkey); ++#define q_EVP_PKEY_base_id q_EVP_PKEY_get_base_id ++#else ++X509 *q_SSL_get_peer_certificate(SSL *a); ++int q_EVP_PKEY_base_id(EVP_PKEY *a); ++#endif // OPENSSL_VERSION_MAJOR >= 3 ++ + QT_END_NAMESPACE + + #endif diff --git a/src/network/ssl/qsslsocket_schannel.cpp b/src/network/ssl/qsslsocket_schannel.cpp index f91709690a..c956ce3c2b 100644 --- a/src/network/ssl/qsslsocket_schannel.cpp @@ -78743,7 +79295,7 @@ index fb324afbd8..2fc3167fd5 100644 } diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp -index a641935dc5..ceee4a3a59 100644 +index a641935dc5..6bc9d46755 100644 --- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp +++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp @@ -158,6 +158,20 @@ static inline QVariant qDateTimeFromString(QString &val) @@ -78785,7 +79337,15 @@ index a641935dc5..ceee4a3a59 100644 MYSQL_BIND *bind; for(i = 0; i < fields.count(); ++i) { -@@ -378,35 +392,34 @@ bool QMYSQLResultPrivate::bindInValues() +@@ -365,7 +379,6 @@ void QMYSQLResultPrivate::bindBlobs() + bool QMYSQLResultPrivate::bindInValues() + { + MYSQL_BIND *bind; +- char *field; + int i = 0; + + if (!meta) +@@ -378,35 +391,34 @@ bool QMYSQLResultPrivate::bindInValues() inBinds = new MYSQL_BIND[fields.size()]; memset(inBinds, 0, fields.size() * sizeof(MYSQL_BIND)); @@ -78832,7 +79392,7 @@ index a641935dc5..ceee4a3a59 100644 ++i; } -@@ -1355,24 +1368,23 @@ bool QMYSQLDriver::open(const QString& db, +@@ -1355,24 +1367,23 @@ bool QMYSQLDriver::open(const QString& db, } #if MYSQL_VERSION_ID >= 50007 @@ -78998,6 +79558,95 @@ index d1febd81d4..67c045e8bd 100644 } } +diff --git a/src/printsupport/dialogs/images/print-24.png b/src/printsupport/dialogs/images/printer-24.png +similarity index 100% +rename from src/printsupport/dialogs/images/print-24.png +rename to src/printsupport/dialogs/images/printer-24.png +diff --git a/src/printsupport/dialogs/images/print-32.png b/src/printsupport/dialogs/images/printer-32.png +similarity index 100% +rename from src/printsupport/dialogs/images/print-32.png +rename to src/printsupport/dialogs/images/printer-32.png +diff --git a/src/printsupport/dialogs/images/view-page-sided-24.png b/src/printsupport/dialogs/images/view-pages-facing-24.png +similarity index 100% +rename from src/printsupport/dialogs/images/view-page-sided-24.png +rename to src/printsupport/dialogs/images/view-pages-facing-24.png +diff --git a/src/printsupport/dialogs/images/view-page-sided-32.png b/src/printsupport/dialogs/images/view-pages-facing-32.png +similarity index 100% +rename from src/printsupport/dialogs/images/view-page-sided-32.png +rename to src/printsupport/dialogs/images/view-pages-facing-32.png +diff --git a/src/printsupport/dialogs/images/view-page-multi-24.png b/src/printsupport/dialogs/images/view-pages-overview-24.png +similarity index 100% +rename from src/printsupport/dialogs/images/view-page-multi-24.png +rename to src/printsupport/dialogs/images/view-pages-overview-24.png +diff --git a/src/printsupport/dialogs/images/view-page-multi-32.png b/src/printsupport/dialogs/images/view-pages-overview-32.png +similarity index 100% +rename from src/printsupport/dialogs/images/view-page-multi-32.png +rename to src/printsupport/dialogs/images/view-pages-overview-32.png +diff --git a/src/printsupport/dialogs/images/view-page-one-24.png b/src/printsupport/dialogs/images/view-pages-single-24.png +similarity index 100% +rename from src/printsupport/dialogs/images/view-page-one-24.png +rename to src/printsupport/dialogs/images/view-pages-single-24.png +diff --git a/src/printsupport/dialogs/images/view-page-one-32.png b/src/printsupport/dialogs/images/view-pages-single-32.png +similarity index 100% +rename from src/printsupport/dialogs/images/view-page-one-32.png +rename to src/printsupport/dialogs/images/view-pages-single-32.png +diff --git a/src/printsupport/dialogs/images/fit-page-24.png b/src/printsupport/dialogs/images/zoom-fit-page-24.png +similarity index 100% +rename from src/printsupport/dialogs/images/fit-page-24.png +rename to src/printsupport/dialogs/images/zoom-fit-page-24.png +diff --git a/src/printsupport/dialogs/images/fit-page-32.png b/src/printsupport/dialogs/images/zoom-fit-page-32.png +similarity index 100% +rename from src/printsupport/dialogs/images/fit-page-32.png +rename to src/printsupport/dialogs/images/zoom-fit-page-32.png +diff --git a/src/printsupport/dialogs/images/fit-width-24.png b/src/printsupport/dialogs/images/zoom-fit-width-24.png +similarity index 100% +rename from src/printsupport/dialogs/images/fit-width-24.png +rename to src/printsupport/dialogs/images/zoom-fit-width-24.png +diff --git a/src/printsupport/dialogs/images/fit-width-32.png b/src/printsupport/dialogs/images/zoom-fit-width-32.png +similarity index 100% +rename from src/printsupport/dialogs/images/fit-width-32.png +rename to src/printsupport/dialogs/images/zoom-fit-width-32.png +diff --git a/src/printsupport/dialogs/qprintdialog.qrc b/src/printsupport/dialogs/qprintdialog.qrc +index 5a579baa55..10b8e1d341 100644 +--- a/src/printsupport/dialogs/qprintdialog.qrc ++++ b/src/printsupport/dialogs/qprintdialog.qrc +@@ -1,9 +1,9 @@ + + +-images/fit-page-24.png +-images/fit-page-32.png +-images/fit-width-24.png +-images/fit-width-32.png ++images/zoom-fit-page-24.png ++images/zoom-fit-page-32.png ++images/zoom-fit-width-24.png ++images/zoom-fit-width-32.png + images/go-first-24.png + images/go-first-32.png + images/go-last-24.png +@@ -18,14 +18,14 @@ + images/layout-portrait-32.png + images/page-setup-24.png + images/page-setup-32.png +-images/print-24.png +-images/print-32.png +-images/view-page-multi-24.png +-images/view-page-multi-32.png +-images/view-page-one-24.png +-images/view-page-one-32.png +-images/view-page-sided-24.png +-images/view-page-sided-32.png ++images/printer-24.png ++images/printer-32.png ++images/view-pages-overview-24.png ++images/view-pages-overview-32.png ++images/view-pages-single-24.png ++images/view-pages-single-32.png ++images/view-pages-facing-24.png ++images/view-pages-facing-32.png + images/zoom-in-24.png + images/zoom-in-32.png + images/zoom-out-24.png diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index bf77666c41..c5b845f4ec 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -79011,6 +79660,52 @@ index bf77666c41..c5b845f4ec 100644 } if (!printToFile && filePrintersAdded) { widget.printers->removeItem(widget.printers->count()-1); +diff --git a/src/printsupport/dialogs/qprintpreviewdialog.cpp b/src/printsupport/dialogs/qprintpreviewdialog.cpp +index 39575d5f57..23b7e89538 100644 +--- a/src/printsupport/dialogs/qprintpreviewdialog.cpp ++++ b/src/printsupport/dialogs/qprintpreviewdialog.cpp +@@ -352,7 +352,7 @@ void QPrintPreviewDialogPrivate::init(QPrinter *_printer) + static inline void qt_setupActionIcon(QAction *action, QLatin1String name) + { + QLatin1String imagePrefix(":/qt-project.org/dialogs/qprintpreviewdialog/images/"); +- QIcon icon; ++ QIcon icon = QIcon::fromTheme(name); + icon.addFile(imagePrefix + name + QLatin1String("-24.png"), QSize(24, 24)); + icon.addFile(imagePrefix + name + QLatin1String("-32.png"), QSize(32, 32)); + action->setIcon(icon); +@@ -383,8 +383,8 @@ void QPrintPreviewDialogPrivate::setupActions() + fitPageAction->setObjectName(QLatin1String("fitPageAction")); + fitWidthAction->setCheckable(true); + fitPageAction->setCheckable(true); +- qt_setupActionIcon(fitWidthAction, QLatin1String("fit-width")); +- qt_setupActionIcon(fitPageAction, QLatin1String("fit-page")); ++ qt_setupActionIcon(fitWidthAction, QLatin1String("zoom-fit-width")); ++ qt_setupActionIcon(fitPageAction, QLatin1String("zoom-fit-page")); + QObject::connect(fitGroup, SIGNAL(triggered(QAction*)), q, SLOT(_q_fit(QAction*))); + + // Zoom +@@ -410,9 +410,9 @@ void QPrintPreviewDialogPrivate::setupActions() + singleModeAction = modeGroup->addAction(QCoreApplication::translate("QPrintPreviewDialog", "Show single page")); + facingModeAction = modeGroup->addAction(QCoreApplication::translate("QPrintPreviewDialog", "Show facing pages")); + overviewModeAction = modeGroup->addAction(QCoreApplication::translate("QPrintPreviewDialog", "Show overview of all pages")); +- qt_setupActionIcon(singleModeAction, QLatin1String("view-page-one")); +- qt_setupActionIcon(facingModeAction, QLatin1String("view-page-sided")); +- qt_setupActionIcon(overviewModeAction, QLatin1String("view-page-multi")); ++ qt_setupActionIcon(singleModeAction, QLatin1String("view-pages-single")); ++ qt_setupActionIcon(facingModeAction, QLatin1String("view-pages-facing")); ++ qt_setupActionIcon(overviewModeAction, QLatin1String("view-pages-overview")); + singleModeAction->setObjectName(QLatin1String("singleModeAction")); + facingModeAction->setObjectName(QLatin1String("facingModeAction")); + overviewModeAction->setObjectName(QLatin1String("overviewModeAction")); +@@ -426,7 +426,7 @@ void QPrintPreviewDialogPrivate::setupActions() + printerGroup = new QActionGroup(q); + printAction = printerGroup->addAction(QCoreApplication::translate("QPrintPreviewDialog", "Print")); + pageSetupAction = printerGroup->addAction(QCoreApplication::translate("QPrintPreviewDialog", "Page setup")); +- qt_setupActionIcon(printAction, QLatin1String("print")); ++ qt_setupActionIcon(printAction, QLatin1String("printer")); + qt_setupActionIcon(pageSetupAction, QLatin1String("page-setup")); + QObject::connect(printAction, SIGNAL(triggered(bool)), q, SLOT(_q_print())); + QObject::connect(pageSetupAction, SIGNAL(triggered(bool)), q, SLOT(_q_pageSetup())); diff --git a/src/src.pro b/src/src.pro index f3f8d57af7..8990109743 100644 --- a/src/src.pro @@ -80525,6 +81220,38 @@ index ea6124f45d..7a444713c1 100644 */ void QXmlSimpleReader::setFeature(const QString& name, bool enable) { +diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp +index da5327594c..4a04e0f7c6 100644 +--- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp ++++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp +@@ -561,7 +561,8 @@ protected: + qint64 readData(char *data, qint64 maxSize) override + { + maxSize = qMin(maxSize, qint64(buf->size() - offset)); +- memcpy(data, buf->constData() + offset, maxSize); ++ if (maxSize > 0) ++ memcpy(data, buf->constData() + offset, maxSize); + offset += maxSize; + return maxSize; + } +@@ -604,13 +605,15 @@ protected: + qint64 readData(char *data, qint64 maxSize) override + { + maxSize = qMin(maxSize, qint64(buf.size() - pos())); +- memcpy(data, buf.constData() + pos(), maxSize); ++ if (maxSize > 0) ++ memcpy(data, buf.constData() + pos(), maxSize); + return maxSize; + } + qint64 writeData(const char *data, qint64 maxSize) override + { + maxSize = qMin(maxSize, qint64(buf.size() - pos())); +- memcpy(buf.data() + pos(), data, maxSize); ++ if (maxSize > 0) ++ memcpy(buf.data() + pos(), data, maxSize); + return maxSize; + } + diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index afbd64c405..a0aefac268 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -81213,7 +81940,7 @@ index 5da69e76a5..55027530ec 100644 QTEST_APPLESS_MAIN(tst_QCalendar) #include "tst_qcalendar.moc" diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp -index 332a00efb5..92ead6545b 100644 +index 332a00efb5..ed31704cbb 100644 --- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp @@ -62,6 +62,7 @@ private slots: @@ -81258,6 +81985,66 @@ index 332a00efb5..92ead6545b 100644 void tst_QTimeZone::utcTest() { #ifdef QT_BUILD_INTERNAL +@@ -1153,11 +1181,14 @@ void tst_QTimeZone::tzTest() + QCOMPARE(dat.standardTimeOffset, 3600); + QCOMPARE(dat.daylightTimeOffset, 0); + +- // Known high datetimes +- qint64 stdHi = QDateTime(QDate(2100, 1, 1), QTime(0, 0, 0), Qt::UTC).toMSecsSinceEpoch(); +- qint64 dstHi = QDateTime(QDate(2100, 6, 1), QTime(0, 0, 0), Qt::UTC).toMSecsSinceEpoch(); ++ // Date-times late enough to exercise POSIX rules: ++ qint64 stdHi = QDate(2100, 1, 1).startOfDay(Qt::UTC).toMSecsSinceEpoch(); ++ qint64 dstHi = QDate(2100, 6, 1).startOfDay(Qt::UTC).toMSecsSinceEpoch(); ++ // Relevant last Sundays in October and March: ++ QCOMPARE(Qt::DayOfWeek(QDate(2099, 10, 25).dayOfWeek()), Qt::Sunday); ++ QCOMPARE(Qt::DayOfWeek(QDate(2100, 3, 28).dayOfWeek()), Qt::Sunday); ++ QCOMPARE(Qt::DayOfWeek(QDate(2100, 10, 31).dayOfWeek()), Qt::Sunday); + +- // Tets high dates use the POSIX rule + dat = tzp.data(stdHi); + QCOMPARE(dat.atMSecsSinceEpoch - stdHi, (qint64)0); + QCOMPARE(dat.offsetFromUtc, 3600); +@@ -1171,29 +1202,33 @@ void tst_QTimeZone::tzTest() + QCOMPARE(dat.daylightTimeOffset, 3600); + + dat = tzp.previousTransition(stdHi); +- QCOMPARE(QDateTime::fromMSecsSinceEpoch(dat.atMSecsSinceEpoch, Qt::OffsetFromUTC, 3600), +- QDateTime(QDate(2099, 10, 26), QTime(2, 0), Qt::OffsetFromUTC, 3600)); ++ QCOMPARE(dat.abbreviation, QStringLiteral("CET")); ++ QCOMPARE(QDateTime::fromMSecsSinceEpoch(dat.atMSecsSinceEpoch, Qt::UTC), ++ QDateTime(QDate(2099, 10, 25), QTime(3, 0), Qt::OffsetFromUTC, 7200)); + QCOMPARE(dat.offsetFromUtc, 3600); + QCOMPARE(dat.standardTimeOffset, 3600); + QCOMPARE(dat.daylightTimeOffset, 0); + + dat = tzp.previousTransition(dstHi); +- QCOMPARE(QDateTime::fromMSecsSinceEpoch(dat.atMSecsSinceEpoch, Qt::OffsetFromUTC, 3600), +- QDateTime(QDate(2100, 3, 29), QTime(2, 0), Qt::OffsetFromUTC, 3600)); ++ QCOMPARE(dat.abbreviation, QStringLiteral("CEST")); ++ QCOMPARE(QDateTime::fromMSecsSinceEpoch(dat.atMSecsSinceEpoch, Qt::UTC), ++ QDateTime(QDate(2100, 3, 28), QTime(2, 0), Qt::OffsetFromUTC, 3600)); + QCOMPARE(dat.offsetFromUtc, 7200); + QCOMPARE(dat.standardTimeOffset, 3600); + QCOMPARE(dat.daylightTimeOffset, 3600); + + dat = tzp.nextTransition(stdHi); +- QCOMPARE(QDateTime::fromMSecsSinceEpoch(dat.atMSecsSinceEpoch, Qt::OffsetFromUTC, 3600), +- QDateTime(QDate(2100, 3, 29), QTime(2, 0), Qt::OffsetFromUTC, 3600)); ++ QCOMPARE(dat.abbreviation, QStringLiteral("CEST")); ++ QCOMPARE(QDateTime::fromMSecsSinceEpoch(dat.atMSecsSinceEpoch, Qt::UTC), ++ QDateTime(QDate(2100, 3, 28), QTime(2, 0), Qt::OffsetFromUTC, 3600)); + QCOMPARE(dat.offsetFromUtc, 7200); + QCOMPARE(dat.standardTimeOffset, 3600); + QCOMPARE(dat.daylightTimeOffset, 3600); + + dat = tzp.nextTransition(dstHi); ++ QCOMPARE(dat.abbreviation, QStringLiteral("CET")); + QCOMPARE(QDateTime::fromMSecsSinceEpoch(dat.atMSecsSinceEpoch, Qt::OffsetFromUTC, 3600), +- QDateTime(QDate(2100, 10, 25), QTime(2, 0), Qt::OffsetFromUTC, 3600)); ++ QDateTime(QDate(2100, 10, 31), QTime(3, 0), Qt::OffsetFromUTC, 7200)); + QCOMPARE(dat.offsetFromUtc, 3600); + QCOMPARE(dat.standardTimeOffset, 3600); + QCOMPARE(dat.daylightTimeOffset, 0); diff --git a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp index a1d0100f96..5443cf120b 100644 --- a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp @@ -81554,6 +82341,126 @@ index 0000000000..ee79c36ba5 + +QTEST_MAIN(tst_QTextImageHandler) +#include "tst_qtextimagehandler.moc" +diff --git a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp +index 474079037b..93bbf9f34f 100644 +--- a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp ++++ b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp +@@ -29,7 +29,7 @@ + + #include + +- ++#include + #include + #include + #include +@@ -44,6 +44,7 @@ + #include + #include + #endif ++#include + #include + + typedef QList IntList; +@@ -100,6 +101,13 @@ private slots: + void checkBorderAttributes_data(); + void checkBorderAttributes(); + ++#ifndef QT_NO_WIDGETS ++ void columnWidthWithSpans(); ++ ++ void columnWidthWithImage_data(); ++ void columnWidthWithImage(); ++#endif ++ + private: + QTextTable *create2x2Table(); + QTextTable *create4x4Table(); +@@ -1278,5 +1286,84 @@ void tst_QTextTable::checkBorderAttributes() + } + } + ++#ifndef QT_NO_WIDGETS ++void tst_QTextTable::columnWidthWithSpans() ++{ ++ cleanup(); ++ init(); ++ QTextTable *table = cursor.insertTable(4, 4); ++ QTextEdit textEdit; ++ textEdit.setDocument(doc); ++ textEdit.show(); ++ QVERIFY(QTest::qWaitForWindowExposed(&textEdit)); ++ ++ for (int i = 0; i < table->columns(); ++i) ++ table->cellAt(0, i).firstCursorPosition().insertText(QString("Header %1").arg(i)); ++ ++ QTextBlock block = table->cellAt(0, 0).firstCursorPosition().block(); ++ const QRectF beforeRect = table->document()->documentLayout()->blockBoundingRect(block); ++ table->mergeCells(1, 0, 1, table->columns()); ++ block = table->cellAt(0, 0).firstCursorPosition().block(); ++ const QRectF afterRect = table->document()->documentLayout()->blockBoundingRect(block); ++ QCOMPARE(afterRect, beforeRect); ++} ++ ++void tst_QTextTable::columnWidthWithImage_data() ++{ ++ const auto imageHtml = [](int width, int height) { ++ QImage image(width, height, QImage::Format_RGB32); ++ image.fill(Qt::red); ++ QByteArray imageBytes; ++ QBuffer buffer(&imageBytes); ++ buffer.open(QIODevice::WriteOnly); ++ image.save(&buffer, "png"); ++ return QString("").arg(QString(imageBytes.toBase64())); ++ }; ++ ++ QTest::addColumn("leftHtml"); ++ QTest::addColumn("rightHtml"); ++ QTest::addColumn("imageSize"); ++ QTest::addRow("image") ++ << imageHtml(500, 32) << "" << QSize(500, 32); ++ QTest::addRow("image, text") ++ << imageHtml(32, 32) << "abc" << QSize(32, 32); ++ QTest::addRow("image, 100%% text") ++ << imageHtml(32, 32) << "abc" ++ << QSize(32, 32); ++ QTest::addRow("image, image") ++ << imageHtml(256, 32) << imageHtml(256, 32) << QSize(256, 32); ++} ++ ++void tst_QTextTable::columnWidthWithImage() ++{ ++ const QString tableTemplate = "%1 %2
"; ++ ++ QFETCH(QString, leftHtml); ++ QFETCH(QString, rightHtml); ++ QFETCH(QSize, imageSize); ++ ++ QTextDocument doc; ++ doc.setHtml(tableTemplate.arg(leftHtml).arg(rightHtml)); ++ QTextEdit textEdit; ++ textEdit.setDocument(&doc); ++ textEdit.show(); ++ QVERIFY(QTest::qWaitForWindowExposed(&textEdit)); ++ ++ QTextCursor cursor(doc.firstBlock()); ++ cursor.movePosition(QTextCursor::Right); ++ ++ QTextTable *currentTable = cursor.currentTable(); ++ QVERIFY(currentTable); ++ ++ QTextBlock block = currentTable->cellAt(0, 0).firstCursorPosition().block(); ++ const QRectF leftRect = currentTable->document()->documentLayout()->blockBoundingRect(block); ++ block = currentTable->cellAt(0, 1).firstCursorPosition().block(); ++ const QRectF rightRect = currentTable->document()->documentLayout()->blockBoundingRect(block); ++ QCOMPARE(leftRect.size().toSize(), imageSize); ++ QVERIFY(rightRect.left() > leftRect.right()); ++} ++#endif ++ ++ + QTEST_MAIN(tst_QTextTable) + #include "tst_qtexttable.moc" diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index 4dd6ce897b..fc7b1d090e 100644 --- a/tests/auto/network-settings.h diff --git a/desktop/toolkit/qt5/qt5-base/pspec.xml b/desktop/toolkit/qt5/qt5-base/pspec.xml index 0b3159b80e..5d73b7916d 100755 --- a/desktop/toolkit/qt5/qt5-base/pspec.xml +++ b/desktop/toolkit/qt5/qt5-base/pspec.xml @@ -280,6 +280,13 @@ --> + + 2022-01-06 + 5.15.2 + Rebuild kde patch. + Mustafa Cinasal + muscnsl@gmail.com + 2021-12-11 5.15.2