Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
removed_api.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#define QT_CORE_BUILD_REMOVED_API
5
6#include "qglobal.h"
7
8QT_USE_NAMESPACE
9
10#if QT_CORE_REMOVED_SINCE(6, 1)
11
12#include "qmetatype.h"
13
14int QMetaType::id() const
15{
16 return registerHelper();
17}
18
19#endif // QT_CORE_REMOVED_SINCE(6, 1)
20
21#if QT_CORE_REMOVED_SINCE(6, 2)
22
23#include "qbindingstorage.h"
24
25void QBindingStorage::maybeUpdateBindingAndRegister_helper(const QUntypedPropertyData *data) const
26{
27 registerDependency_helper(data);
28}
29
30#endif // QT_CORE_REMOVED_SINCE(6, 2)
31
32#if QT_CORE_REMOVED_SINCE(6, 3)
33
34#include "qbytearraymatcher.h"
35
36# if QT_POINTER_SIZE != 4
37
38int QStaticByteArrayMatcherBase::indexOfIn(const char *h, uint hl, const char *n, int nl, int from) const noexcept
39{
40 qsizetype r = indexOfIn(h, size_t(hl), n, qsizetype(nl), qsizetype(from));
41 Q_ASSERT(r == int(r));
42 return r;
43}
44
45# endif // QT_POINTER_SIZE != 4
46
47qsizetype QByteArrayMatcher::indexIn(const QByteArray &ba, qsizetype from) const
48{
49 return indexIn(QByteArrayView{ba}, from); // ba.isNull() may be significant, so don't ignore it!
50}
51
52#include "tools/qcryptographichash.h"
53
54void QCryptographicHash::addData(const QByteArray &data)
55{
56 addData(QByteArrayView{data});
57}
58
59QByteArray QCryptographicHash::hash(const QByteArray &data, Algorithm method)
60{
61 return hash(QByteArrayView{data}, method);
62}
63
64#include "qdatastream.h"
65
66# ifndef QT_NO_DATASTREAM
67# include "qfloat16.h"
68
69QDataStream &QDataStream::operator>>(qfloat16 &f)
70{
71 return *this >> reinterpret_cast<qint16&>(f);
72}
73
74QDataStream &QDataStream::operator<<(qfloat16 f)
75{
76 return *this << reinterpret_cast<qint16&>(f);
77}
78
79# endif
80
81#include "quuid.h"
82
83QUuid::QUuid(const QString &text)
84 : QUuid{qToAnyStringViewIgnoringNull(text)}
85{
86}
87
88QUuid::QUuid(const char *text)
89 : QUuid{QAnyStringView(text)}
90{
91}
92
93QUuid::QUuid(const QByteArray &text)
94 : QUuid{qToAnyStringViewIgnoringNull(text)}
95{
96}
97
98QUuid QUuid::fromString(QStringView string) noexcept
99{
100 return fromString(QAnyStringView{string});
101}
102
103QUuid QUuid::fromString(QLatin1StringView string) noexcept
104{
105 return fromString(QAnyStringView{string});
106}
107
108QUuid QUuid::fromRfc4122(const QByteArray &bytes)
109{
110 return fromRfc4122(qToByteArrayViewIgnoringNull(bytes));
111}
112
113#include "qbytearraylist.h"
114
115# if QT_POINTER_SIZE != 4
116QByteArray QtPrivate::QByteArrayList_join(const QByteArrayList *that, const char *sep, int seplen)
117{
118 return QByteArrayList_join(that, sep, qsizetype(seplen));
119}
120# endif
121
122#include "qlocale.h"
123
124QString QLocale::languageToCode(Language language)
125{
126 return languageToCode(language, QLocale::AnyLanguageCode);
127}
128
129QLocale::Language QLocale::codeToLanguage(QStringView languageCode) noexcept
130{
131 return codeToLanguage(languageCode, QLocale::AnyLanguageCode);
132}
133
134#include "qoperatingsystemversion.h"
135
136QOperatingSystemVersion QOperatingSystemVersion::current()
137{
138 return QOperatingSystemVersionBase::current();
139}
140
141QString QOperatingSystemVersion::name() const
142{
143 return QOperatingSystemVersionBase::name();
144}
145
146int QOperatingSystemVersion::compare(const QOperatingSystemVersion &v1,
147 const QOperatingSystemVersion &v2)
148{
149 return QOperatingSystemVersionBase::compare(v1, v2);
150}
151
152#include "qurl.h"
153
154QString QUrl::fromAce(const QByteArray &domain)
155{
156 return fromAce(domain, {});
157}
158
159QByteArray QUrl::toAce(const QString &domain)
160{
161 return toAce(domain, {});
162}
163
164#endif // QT_CORE_REMOVED_SINCE(6, 3)
165
166#if QT_CORE_REMOVED_SINCE(6, 4)
167
168#include "qbytearray.h" // uses QT_CORE_INLINE_SINCE
169
170#include "qcalendar.h"
171
172QCalendar::QCalendar(QStringView name)
173 : QCalendar(QAnyStringView{name}) {}
174
175QCalendar::QCalendar(QLatin1StringView name)
176 : QCalendar(QAnyStringView{name}) {}
177
178#include "qcollator.h" // inline function compare(ptr, n, ptr, n) (for MSVC)
179
180#include "qhashfunctions.h"
181
182size_t qHash(const QByteArray &key, size_t seed) noexcept
183{
184 return qHashBits(key.constData(), size_t(key.size()), seed);
185}
186
187size_t qHash(const QByteArrayView &key, size_t seed) noexcept
188{
189 return qHashBits(key.constData(), size_t(key.size()), seed);
190}
191
192#include "qobject.h"
193
194void QObject::setObjectName(const QString &name)
195{
196 setObjectName<void>(name);
197}
198
199#include "qlocale.h" // uses QT_CORE_INLINE_SINCE
200
201#if QT_CONFIG(settings)
202
203#include "qsettings.h"
204
205void QSettings::beginGroup(const QString &prefix)
206{
207 beginGroup(qToAnyStringViewIgnoringNull(prefix));
208}
209
210int QSettings::beginReadArray(const QString &prefix)
211{
212 return beginReadArray(qToAnyStringViewIgnoringNull(prefix));
213}
214
215void QSettings::beginWriteArray(const QString &prefix, int size)
216{
217 beginWriteArray(qToAnyStringViewIgnoringNull(prefix), size);
218}
219
220void QSettings::setValue(const QString &key, const QVariant &value)
221{
222 setValue(qToAnyStringViewIgnoringNull(key), value);
223}
224
225void QSettings::remove(const QString &key)
226{
227 remove(qToAnyStringViewIgnoringNull(key));
228}
229
230bool QSettings::contains(const QString &key) const
231{
232 return contains(qToAnyStringViewIgnoringNull(key));
233}
234
235QVariant QSettings::value(const QString &key, const QVariant &defaultValue) const
236{
237 return value(qToAnyStringViewIgnoringNull(key), defaultValue);
238}
239
240QVariant QSettings::value(const QString &key) const
241{
242 return value(qToAnyStringViewIgnoringNull(key));
243}
244
245#endif // QT_CONFIG(settings)
246
247#include "qversionnumber.h"
248
249QT_WARNING_PUSH
250QT_WARNING_DISABLE_DEPRECATED
251
252QVersionNumber QVersionNumber::fromString(const QString &string, int *suffixIndex)
253{
254 return fromString(qToAnyStringViewIgnoringNull(string), suffixIndex);
255}
256
257QVersionNumber QVersionNumber::fromString(QStringView string, int *suffixIndex)
258{
259 return fromString(QAnyStringView{string}, suffixIndex);
260}
261
262QVersionNumber QVersionNumber::fromString(QLatin1StringView string, int *suffixIndex)
263{
264 return fromString(QAnyStringView{string}, suffixIndex);
265}
266
267QT_WARNING_POP
268
269// #include <qotherheader.h>
270// // implement removed functions from qotherheader.h
271// order sections alphabetically to reduce chances of merge conflicts
272
273#endif // QT_CORE_REMOVED_SINCE(6, 4)
274
275#if QT_CORE_REMOVED_SINCE(6, 5)
276
277#include "qbasictimer.h" // inlined API
278
279#include "qbuffer.h" // inline removed API
280
281#include "qdir.h"
282
283uint QDir::count() const
284{
285 return uint(count(QT6_CALL_NEW_OVERLOAD));
286}
287
288#if QT_POINTER_SIZE != 4
289QString QDir::operator[](int i) const
290{
291 return operator[](qsizetype{i});
292}
293#endif
294
295#include "qtenvironmentvariables.h"
296
297bool qputenv(const char *varName, const QByteArray &value)
298{
299 return qputenv(varName, qToByteArrayViewIgnoringNull(value));
300}
301
302#include "qmetatype.h"
303
304int QMetaType::idHelper() const
305{
306 Q_ASSERT(d_ptr);
307 return registerHelper(d_ptr);
308}
309
310#if QT_CONFIG(sharedmemory)
311#include "qsharedmemory.h"
312
313void QSharedMemory::setNativeKey(const QString &key)
314{
315 setNativeKey(key, QNativeIpcKey::legacyDefaultTypeForOs());
316}
317#endif
318
319#include "qvariant.h"
320
321// these implementations aren't as efficient as they used to be prior to
322// replacement, but there's no way to call the ambiguous overload
323QVariant::QVariant(const QUuid &uuid) : QVariant(QVariant::fromValue(uuid)) {}
324#include "qline.h"
325#include "qpoint.h"
326#include "qrect.h"
327#include "qsize.h"
328QVariant::QVariant(const QPoint &pt) : QVariant(QVariant::fromValue(pt)) {}
329QVariant::QVariant(const QPointF &pt) : QVariant(QVariant::fromValue(pt)) {}
330QVariant::QVariant(const QRect &r) : QVariant(QVariant::fromValue(r)) {}
331QVariant::QVariant(const QRectF &r) : QVariant(QVariant::fromValue(r)) {}
332QVariant::QVariant(const QLine &l) : QVariant(QVariant::fromValue(l)) {}
333QVariant::QVariant(const QLineF &l) : QVariant(QVariant::fromValue(l)) {}
334QVariant::QVariant(const QSize &s) : QVariant(QVariant::fromValue(s)) {}
335QVariant::QVariant(const QSizeF &s) : QVariant(QVariant::fromValue(s)) {}
336
337#if QT_CONFIG(xmlstreamreader)
338
339#include "qxmlstream.h"
340
341QXmlStreamReader::QXmlStreamReader(const QByteArray &data)
342 : QXmlStreamReader(data, PrivateConstructorTag{})
343{
344}
345
346QXmlStreamReader::QXmlStreamReader(const QString &data)
347 : QXmlStreamReader(qToAnyStringViewIgnoringNull(data))
348{
349}
350
351QXmlStreamReader::QXmlStreamReader(const char *data)
352 : QXmlStreamReader(QAnyStringView(data))
353{
354}
355
356void QXmlStreamReader::addData(const QByteArray &data)
357{
358 addData<>(data);
359}
360void QXmlStreamReader::addData(const QString &data)
361{
362 addData(qToAnyStringViewIgnoringNull(data));
363}
364
365void QXmlStreamReader::addData(const char *data)
366{
367 addData(QAnyStringView(data));
368}
369
370#endif // QT_CONFIG(xmlstreamreader)
371
372#if QT_CONFIG(xmlstreamwriter)
373
374#include "qxmlstream.h"
375
376void QXmlStreamWriter::writeAttribute(const QString &qualifiedName, const QString &value)
377{
378 writeAttribute(qToAnyStringViewIgnoringNull(qualifiedName),
379 qToAnyStringViewIgnoringNull(value));
380}
381
382void QXmlStreamWriter::writeAttribute(const QString &namespaceUri, const QString &name, const QString &value)
383{
384 writeAttribute(qToAnyStringViewIgnoringNull(namespaceUri),
385 qToAnyStringViewIgnoringNull(name),
386 qToAnyStringViewIgnoringNull(value));
387}
388
389void QXmlStreamWriter::writeCDATA(const QString &text)
390{
391 writeCDATA(qToAnyStringViewIgnoringNull(text));
392}
393
394void QXmlStreamWriter::writeCharacters(const QString &text)
395{
396 writeCharacters(qToAnyStringViewIgnoringNull(text));
397}
398
399void QXmlStreamWriter::writeComment(const QString &text)
400{
401 writeComment(qToAnyStringViewIgnoringNull(text));
402}
403
404void QXmlStreamWriter::writeDTD(const QString &dtd)
405{
406 writeDTD(qToAnyStringViewIgnoringNull(dtd));
407}
408
409void QXmlStreamWriter::writeEmptyElement(const QString &qualifiedName)
410{
411 writeEmptyElement(qToAnyStringViewIgnoringNull(qualifiedName));
412}
413
414void QXmlStreamWriter::writeEmptyElement(const QString &namespaceUri, const QString &name)
415{
416 writeEmptyElement(qToAnyStringViewIgnoringNull(namespaceUri),
417 qToAnyStringViewIgnoringNull(name));
418}
419
420void QXmlStreamWriter::writeTextElement(const QString &qualifiedName, const QString &text)
421{
422 writeTextElement(qToAnyStringViewIgnoringNull(qualifiedName),
423 qToAnyStringViewIgnoringNull(text));
424}
425
426void QXmlStreamWriter::writeTextElement(const QString &namespaceUri, const QString &name, const QString &text)
427{
428 writeTextElement(qToAnyStringViewIgnoringNull(namespaceUri),
429 qToAnyStringViewIgnoringNull(name),
430 qToAnyStringViewIgnoringNull(text));
431}
432
433void QXmlStreamWriter::writeEntityReference(const QString &name)
434{
435 writeEntityReference(qToAnyStringViewIgnoringNull(name));
436}
437
438void QXmlStreamWriter::writeNamespace(const QString &namespaceUri, const QString &prefix)
439{
440 writeNamespace(qToAnyStringViewIgnoringNull(namespaceUri),
441 qToAnyStringViewIgnoringNull(prefix));
442}
443
444void QXmlStreamWriter::writeDefaultNamespace(const QString &namespaceUri)
445{
446 writeDefaultNamespace(qToAnyStringViewIgnoringNull(namespaceUri));
447}
448
449void QXmlStreamWriter::writeProcessingInstruction(const QString &target, const QString &data)
450{
451 writeProcessingInstruction(qToAnyStringViewIgnoringNull(target),
452 qToAnyStringViewIgnoringNull(data));
453}
454
455void QXmlStreamWriter::writeStartDocument(const QString &version)
456{
457 writeStartDocument(qToAnyStringViewIgnoringNull(version));
458}
459
460void QXmlStreamWriter::writeStartDocument(const QString &version, bool standalone)
461{
462 writeStartDocument(qToAnyStringViewIgnoringNull(version),
463 standalone);
464}
465
466void QXmlStreamWriter::writeStartElement(const QString &qualifiedName)
467{
468 writeStartElement(qToAnyStringViewIgnoringNull(qualifiedName));
469}
470
471void QXmlStreamWriter::writeStartElement(const QString &namespaceUri, const QString &name)
472{
473 writeStartElement(qToAnyStringViewIgnoringNull(namespaceUri),
474 qToAnyStringViewIgnoringNull(name));
475}
476
477#endif // QT_CONFIG(xmlstreamwriter)
478
479// inlined API
480#include "qfloat16.h"
481#include "qstring.h"
482
483// #include "qotherheader.h"
484// // implement removed functions from qotherheader.h
485// order sections alphabetically to reduce chances of merge conflicts
486
487#endif // QT_CORE_REMOVED_SINCE(6, 5)
488
489#if QT_CORE_REMOVED_SINCE(6, 6)
490
491#include "qmessageauthenticationcode.h"
492
493QMessageAuthenticationCode::QMessageAuthenticationCode(QCryptographicHash::Algorithm method,
494 const QByteArray &key)
495 : QMessageAuthenticationCode(method, qToByteArrayViewIgnoringNull(key)) {}
496
497void QMessageAuthenticationCode::setKey(const QByteArray &key)
498{
499 setKey(qToByteArrayViewIgnoringNull(key));
500}
501
502void QMessageAuthenticationCode::addData(const QByteArray &data)
503{
504 addData(qToByteArrayViewIgnoringNull(data));
505}
506
507QByteArray QMessageAuthenticationCode::hash(const QByteArray &msg, const QByteArray &key,
508 QCryptographicHash::Algorithm method)
509{
510 return hash(qToByteArrayViewIgnoringNull(msg),
511 qToByteArrayViewIgnoringNull(key), method);
512}
513
514#include "qobject.h" // inlined API
515
516#include "qrunnable.h"
517
518QRunnable *QRunnable::create(std::function<void()> functionToRun)
519{
520 return QRunnable::create<std::function<void()>>(std::move(functionToRun));
521}
522
523#include "qstring.h"
524
525qsizetype QString::toUcs4_helper(const ushort *uc, qsizetype length, uint *out)
526{
527 return toUcs4_helper(reinterpret_cast<const char16_t *>(uc), length,
528 reinterpret_cast<char32_t *>(out));
529}
530
531#if QT_CONFIG(thread)
532#include "qreadwritelock.h"
533
534bool QReadWriteLock::tryLockForRead()
535{
536 return tryLockForRead(0);
537}
538
539bool QReadWriteLock::tryLockForWrite()
540{
541 return tryLockForWrite(0);
542}
543
544#include "qthreadpool.h"
545#include "private/qthreadpool_p.h"
546
547void QThreadPool::start(std::function<void()> functionToRun, int priority)
548{
549 if (!functionToRun)
550 return;
551 start(QRunnable::create(std::move(functionToRun)), priority);
552}
553
554bool QThreadPool::tryStart(std::function<void()> functionToRun)
555{
556 if (!functionToRun)
557 return false;
558
559 Q_D(QThreadPool);
560 QMutexLocker locker(&d->mutex);
561 if (!d->allThreads.isEmpty() && d->areAllThreadsActive())
562 return false;
563
564 QRunnable *runnable = QRunnable::create(std::move(functionToRun));
565 if (d->tryStart(runnable))
566 return true;
567 delete runnable;
568 return false;
569}
570
571void QThreadPool::startOnReservedThread(std::function<void()> functionToRun)
572{
573 if (!functionToRun)
574 return releaseThread();
575
576 startOnReservedThread(QRunnable::create(std::move(functionToRun)));
577}
578
579#endif // QT_CONFIG(thread)
580
581#if QT_CONFIG(xmlstream)
582
583#include "qxmlstream.h"
584
585QStringView QXmlStreamAttributes::value(const QString &namespaceUri, const QString &name) const
586{
587 return value(qToAnyStringViewIgnoringNull(namespaceUri), qToAnyStringViewIgnoringNull(name));
588}
589
590QStringView QXmlStreamAttributes::value(const QString &namespaceUri, QLatin1StringView name) const
591{
592 return value(qToAnyStringViewIgnoringNull(namespaceUri), QAnyStringView(name));
593}
594
595QStringView QXmlStreamAttributes::value(QLatin1StringView namespaceUri, QLatin1StringView name) const
596{
597 return value(QAnyStringView(namespaceUri), QAnyStringView(name));
598}
599
600QStringView QXmlStreamAttributes::value(const QString &qualifiedName) const
601{
602 return value(qToAnyStringViewIgnoringNull(qualifiedName));
603}
604
605QStringView QXmlStreamAttributes::value(QLatin1StringView qualifiedName) const
606{
607 return value(QAnyStringView(qualifiedName));
608}
609
610#endif // xmlstream
611
612// inlined API
613#if QT_CONFIG(thread)
614#include "qmutex.h"
615#include "qreadwritelock.h"
616#include "qsemaphore.h"
617#endif
618
619// #include "qotherheader.h"
620// // implement removed functions from qotherheader.h
621// order sections alphabetically to reduce chances of merge conflicts
622
623#endif // QT_CORE_REMOVED_SINCE(6, 6)
624
625#if QT_CORE_REMOVED_SINCE(6, 7)
626
627#include "qbitarray.h"
628
629QBitArray QBitArray::operator~() const
630{
631 return QBitArray(*this).inverted_inplace();
632}
633
634#include "qbytearray.h"
635
636QByteArray QByteArray::left(qsizetype len) const
637{
638 if (len >= size())
639 return *this;
640 if (len < 0)
641 len = 0;
642 return QByteArray(data(), len);
643}
644
645QByteArray QByteArray::right(qsizetype len) const
646{
647 if (len >= size())
648 return *this;
649 if (len < 0)
650 len = 0;
651 return QByteArray(end() - len, len);
652}
653
654QByteArray QByteArray::mid(qsizetype pos, qsizetype len) const
655{
656 qsizetype p = pos;
657 qsizetype l = len;
658 using namespace QtPrivate;
659 switch (QContainerImplHelper::mid(size(), &p, &l)) {
660 case QContainerImplHelper::Null:
661 return QByteArray();
662 case QContainerImplHelper::Empty:
663 {
664 return QByteArray(DataPointer::fromRawData(&_empty, 0));
665 }
666 case QContainerImplHelper::Full:
667 return *this;
668 case QContainerImplHelper::Subset:
669 return QByteArray(d.data() + p, l);
670 }
671 Q_UNREACHABLE_RETURN(QByteArray());
672}
673
674#ifdef Q_CC_MSVC
675// previously inline methods, only needed for MSVC compat
676QByteArray QByteArray::first(qsizetype n) const
677{ return sliced(0, n); }
678QByteArray QByteArray::last(qsizetype n) const
679{ return sliced(size() - n, n); }
680QByteArray QByteArray::sliced(qsizetype pos) const
681{ return sliced(pos, size() - pos); }
682QByteArray QByteArray::sliced(qsizetype pos, qsizetype n) const
683{ verify(pos, n); return QByteArray(d.data() + pos, n); }
684QByteArray QByteArray::chopped(qsizetype n) const
685{ return sliced(0, size() - n); }
686#endif
687
688#include "qcborstreamreader.h"
689
690QCborError QCborStreamReader::lastError()
691{
692 return std::as_const(*this).lastError();
693}
694
695#include "qdatetime.h" // also inlined API
696
697QDateTime::QDateTime(QDate date, QTime time, const QTimeZone &timeZone)
698 : QDateTime(date, time, timeZone, TransitionResolution::LegacyBehavior) {}
699QDateTime::QDateTime(QDate date, QTime time)
700 : QDateTime(date, time, TransitionResolution::LegacyBehavior) {}
701void QDateTime::setDate(QDate date) { setDate(date, TransitionResolution::LegacyBehavior); }
702void QDateTime::setTime(QTime time) { setTime(time, TransitionResolution::LegacyBehavior); }
703void QDateTime::setTimeZone(const QTimeZone &toZone)
704{
705 setTimeZone(toZone, TransitionResolution::LegacyBehavior);
706}
707
708bool QDateTime::precedes(const QDateTime &other) const
709{
710 return compareThreeWay(*this, other) < 0;
711}
712
713#include "qdatastream.h"
714
715QDataStream &QDataStream::writeBytes(const char *s, uint len)
716{
717 return writeBytes(s, qint64(len));
718}
719
720int QDataStream::skipRawData(int len)
721{
722 return int(skipRawData(qint64(len)));
723}
724
725int QDataStream::readBlock(char *data, int len)
726{
727 return int(readBlock(data, qint64(len)));
728}
729
730int QDataStream::readRawData(char *s, int len)
731{
732 return int(readRawData(s, qint64(len)));
733}
734
735int QDataStream::writeRawData(const char *s, int len)
736{
737 return writeRawData(s, qint64(len));
738}
739
740#if defined(Q_OS_ANDROID)
741
742#include "qjniobject.h"
743
744jclass QJniObject::loadClass(const QByteArray &className, JNIEnv *env, bool /*binEncoded*/)
745{
746 return QJniObject::loadClass(className, env);
747}
748
749QByteArray QJniObject::toBinaryEncClassName(const QByteArray &className)
750{
751 return QByteArray(className).replace('/', '.');
752}
753
754void QJniObject::callVoidMethodV(JNIEnv *env, jmethodID id, va_list args) const
755{
756 env->CallVoidMethodV(javaObject(), id, args);
757}
758
759#endif // Q_OS_ANDROID
760
761#include "qlocale.h"
762
763QStringList QLocale::uiLanguages() const
764{
765 return uiLanguages(TagSeparator::Dash);
766}
767
768QString QLocale::name() const
769{
770 return name(TagSeparator::Underscore);
771}
772
773QString QLocale::bcp47Name() const
774{
775 return bcp47Name(TagSeparator::Dash);
776}
777
778#if QT_CONFIG(datestring)
779
780QDate QLocale::toDate(const QString &string, FormatType format) const
781{
782 return toDate(string, dateFormat(format), DefaultTwoDigitBaseYear);
783}
784
785QDate QLocale::toDate(const QString &string, FormatType format, QCalendar cal) const
786{
787 return toDate(string, dateFormat(format), cal, DefaultTwoDigitBaseYear);
788}
789
790QDateTime QLocale::toDateTime(const QString &string, FormatType format) const
791{
792 return toDateTime(string, dateTimeFormat(format), DefaultTwoDigitBaseYear);
793}
794
795QDateTime QLocale::toDateTime(const QString &string, FormatType format, QCalendar cal) const
796{
797 return toDateTime(string, dateTimeFormat(format), cal, DefaultTwoDigitBaseYear);
798}
799
800QDate QLocale::toDate(const QString &string, const QString &format) const
801{
802 return toDate(string, format, QCalendar(), DefaultTwoDigitBaseYear);
803}
804
805QDate QLocale::toDate(const QString &string, const QString &format, QCalendar cal) const
806{
807 return toDate(string, format, cal, DefaultTwoDigitBaseYear);
808}
809
810QDateTime QLocale::toDateTime(const QString &string, const QString &format) const
811{
812 return toDateTime(string, format, QCalendar(), DefaultTwoDigitBaseYear);
813}
814
815QDateTime QLocale::toDateTime(const QString &string, const QString &format, QCalendar cal) const
816{
817 return toDateTime(string, format, cal, DefaultTwoDigitBaseYear);
818}
819
820#endif // datestring
821
822#include "qobject.h"
823
824void qt_qFindChildren_helper(const QObject *parent, const QMetaObject &mo,
825 QList<void*> *list, Qt::FindChildOptions options)
826{
827 qt_qFindChildren_helper(parent, QAnyStringView(), mo, list, options);
828}
829
830void qt_qFindChildren_helper(const QObject *parent, const QString &name, const QMetaObject &mo,
831 QList<void*> *list, Qt::FindChildOptions options)
832{
833 qt_qFindChildren_helper(parent, QAnyStringView{name}, mo, list, options);
834}
835
836QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo,
837 Qt::FindChildOptions options)
838{
839 return qt_qFindChild_helper(parent, QAnyStringView{name}, mo, options);
840}
841
842void QObject::moveToThread(QThread *targetThread)
843{
844 moveToThread(targetThread, QT6_CALL_NEW_OVERLOAD);
845}
846
847#include "qobjectdefs.h"
848
849bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *slot, Qt::ConnectionType type, void *ret)
850{
851 return invokeMethodImpl(object, slot, type, 1, &ret, nullptr, nullptr);
852}
853
854#include "qstring.h"
855
856QString QString::left(qsizetype n) const
857{
858 if (size_t(n) >= size_t(size()))
859 return *this;
860 return QString((const QChar*) d.data(), n);
861}
862
863QString QString::right(qsizetype n) const
864{
865 if (size_t(n) >= size_t(size()))
866 return *this;
867 return QString(constData() + size() - n, n);
868}
869
870QString QString::mid(qsizetype position, qsizetype n) const
871{
872 qsizetype p = position;
873 qsizetype l = n;
874 using namespace QtPrivate;
875 switch (QContainerImplHelper::mid(size(), &p, &l)) {
876 case QContainerImplHelper::Null:
877 return QString();
878 case QContainerImplHelper::Empty:
879 return QString(DataPointer::fromRawData(&_empty, 0));
880 case QContainerImplHelper::Full:
881 return *this;
882 case QContainerImplHelper::Subset:
883 return QString(constData() + p, l);
884 }
885 Q_UNREACHABLE_RETURN(QString());
886}
887
888#ifdef Q_CC_MSVC
889// previously inline methods, only needed for MSVC compat
890QString QString::first(qsizetype n) const
891{ return sliced(0, n); }
892QString QString::last(qsizetype n) const
893{ return sliced(size() - n, n); }
894QString QString::sliced(qsizetype pos) const
895{ return sliced(pos, size() - pos); }
896QString QString::sliced(qsizetype pos, qsizetype n) const
897{ verify(pos, n); return QString(begin() + pos, n); }
898QString QString::chopped(qsizetype n) const
899{ return sliced(0, size() - n); }
900#endif
901
902#include "qtimezone.h"
903
904bool QTimeZone::operator==(const QTimeZone &other) const
905{
906 return comparesEqual(*this, other);
907}
908
909bool QTimeZone::operator!=(const QTimeZone &other) const
910{
911 return !comparesEqual(*this, other);
912}
913
914#include "qurl.h"
915
916QUrl QUrl::fromEncoded(const QByteArray &input, ParsingMode mode)
917{
918 return QUrl::fromEncoded(QByteArrayView(input), mode);
919}
920
921
922// #include "qotherheader.h"
923// // implement removed functions from qotherheader.h
924// order sections alphabetically to reduce chances of merge conflicts
925
926#endif // QT_CORE_REMOVED_SINCE(6, 7)
927
928#if QT_CORE_REMOVED_SINCE(6, 8)
929#include "qabstractitemmodel.h"
930
931bool QPersistentModelIndex::operator<(const QPersistentModelIndex &other) const noexcept
932{
933 return is_lt(compareThreeWay(*this, other));
934}
935
936bool QPersistentModelIndex::operator==(const QPersistentModelIndex &other) const noexcept
937{
938 return comparesEqual(*this, other);
939}
940
941bool QPersistentModelIndex::operator==(const QModelIndex &other) const noexcept
942{
943 return comparesEqual(*this, other);
944}
945
946bool QPersistentModelIndex::operator!=(const QModelIndex &other) const noexcept
947{
948 return !comparesEqual(*this, other);
949}
950
951#include "qbitarray.h" // inlined API
952
953#include "qbytearray.h" // inlined API
954
955QT_BEGIN_NAMESPACE
956namespace QtPrivate {
957Q_CORE_EXPORT qsizetype lastIndexOf(QByteArrayView haystack, qsizetype from, char needle) noexcept
958{
959 return lastIndexOf(haystack, from, uchar(needle));
960}
961}
962QT_END_NAMESPACE
963
964#include "qcborarray.h" // inlined API
965
966#include "qcbormap.h" // inlined API
967
968#include "qcborvalue.h" // inlined API
969
970#include "qdatastream.h" // inlined API
971
972QDataStream &QDataStream::operator<<(bool i)
973{
974 return (*this << qint8(i));
975}
976
977#include "qdebug.h"
978
979Q_CORE_EXPORT void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, int value)
980{
981 qt_QMetaEnum_flagDebugOperator(debug, sizeofT, uint(value));
982}
983
984#include "qdir.h" // inlined API
985
986bool QDir::operator==(const QDir &dir) const
987{
988 return comparesEqual(*this, dir);
989}
990
991#if QT_CONFIG(easingcurve)
992#include "qeasingcurve.h"
993
994bool QEasingCurve::operator==(const QEasingCurve &other) const
995{
996 return comparesEqual(*this, other);
997}
998#endif // QT_CONFIG(easingcurve)
999
1000#include "qfileinfo.h" // inlined API
1001
1002bool QFileInfo::operator==(const QFileInfo &fileinfo) const
1003{
1004 return comparesEqual(*this, fileinfo);
1005}
1006
1007#if QT_CONFIG(itemmodel)
1008#include "qitemselectionmodel.h" // inlined API
1009#endif // itemmodel
1010
1011#include "qjsonarray.h"
1012
1013bool QJsonArray::operator==(const QJsonArray &other) const
1014{
1015 return comparesEqual(*this, other);
1016}
1017
1018bool QJsonArray::operator!=(const QJsonArray &other) const
1019{
1020 return !comparesEqual(*this, other);
1021}
1022
1023#include "qjsondocument.h"
1024
1025bool QJsonDocument::operator==(const QJsonDocument &other) const
1026{
1027 return comparesEqual(*this, other);
1028}
1029
1030#include "qjsonobject.h"
1031
1032bool QJsonObject::operator==(const QJsonObject &other) const
1033{
1034 return comparesEqual(*this, other);
1035}
1036
1037
1038bool QJsonObject::operator!=(const QJsonObject &other) const
1039{
1040 return !comparesEqual(*this, other);
1041}
1042
1043#include "qjsonvalue.h"
1044
1045bool QJsonValue::operator==(const QJsonValue &other) const
1046{
1047 return comparesEqual(*this, other);
1048}
1049
1050bool QJsonValue::operator!=(const QJsonValue &other) const
1051{
1052 return !comparesEqual(*this, other);
1053}
1054
1055#include "qline.h" // inlined API
1056
1057#if QT_CONFIG(mimetype)
1058#include "qmimetype.h"
1059
1060bool QMimeType::operator==(const QMimeType &other) const
1061{
1062 return comparesEqual(*this, other);
1063}
1064#endif // QT_CONFIG(mimetype)
1065
1066#include "qobject.h"
1067#include "qnumeric.h"
1068
1069int QObject::startTimer(std::chrono::milliseconds time, Qt::TimerType timerType)
1070{
1071 using namespace std::chrono;
1072 using ratio = std::ratio_divide<std::milli, std::nano>;
1073 nanoseconds::rep r;
1074 if (qMulOverflow<ratio::num>(time.count(), &r)) {
1075 qWarning("QObject::startTimer(std::chrono::milliseconds): "
1076 "'time' arg overflowed when converted to nanoseconds.");
1077 r = nanoseconds::max().count();
1078 }
1079 return startTimer(nanoseconds{r}, timerType);
1080}
1081
1082#if QT_CONFIG(processenvironment)
1083#include "qprocess.h" // inlined API
1084
1085bool QProcessEnvironment::operator==(const QProcessEnvironment &other) const
1086{
1087 return comparesEqual(*this, other);
1088}
1089#endif // QT_CONFIG(processenvironment)
1090
1091#if QT_CONFIG(regularexpression)
1092#include "qregularexpression.h"
1093
1094bool QRegularExpressionMatch::hasCaptured(QStringView name) const
1095{
1096 return hasCaptured(QAnyStringView(name));
1097}
1098
1099QString QRegularExpressionMatch::captured(QStringView name) const
1100{
1101 return captured(QAnyStringView(name));
1102}
1103
1104QStringView QRegularExpressionMatch::capturedView(QStringView name) const
1105{
1106 return capturedView(QAnyStringView(name));
1107}
1108
1109qsizetype QRegularExpressionMatch::capturedStart(QStringView name) const
1110{
1111 return capturedStart(QAnyStringView(name));
1112}
1113
1114qsizetype QRegularExpressionMatch::capturedLength(QStringView name) const
1115{
1116 return capturedLength(QAnyStringView(name));
1117}
1118
1119qsizetype QRegularExpressionMatch::capturedEnd(QStringView name) const
1120{
1121 return capturedEnd(QAnyStringView(name));
1122}
1123
1124bool QRegularExpression::operator==(const QRegularExpression &other) const
1125{
1126 return comparesEqual(*this, other);
1127}
1128#endif // QT_CONFIG(regularexpression)
1129
1130#if QT_CONFIG(future)
1131#include "qresultstore.h"
1132
1133bool QtPrivate::ResultIteratorBase::operator==(const QtPrivate::ResultIteratorBase &other) const
1134{
1135 return comparesEqual(*this, other);
1136}
1137
1138bool QtPrivate::ResultIteratorBase::operator!=(const QtPrivate::ResultIteratorBase &other) const
1139{
1140 return !comparesEqual(*this, other);
1141}
1142#endif // QT_CONFIG(future)
1143
1144#include "qstring.h" // inlined API
1145
1146#include "qstringconverter.h"
1147
1148QStringConverter::QStringConverter(const char *name, Flags f)
1149 : QStringConverter(QAnyStringView{name}, f)
1150{}
1151
1152auto QStringConverter::encodingForName(const char *name) noexcept -> std::optional<Encoding>
1153{
1154 return encodingForName(QAnyStringView{name});
1155}
1156
1157#if QT_CONFIG(thread)
1158# include "qthreadpool.h" // inlined API
1159#endif
1160
1161#include "qtimer.h" // inlined API
1162
1163void QTimer::singleShot(std::chrono::milliseconds interval, Qt::TimerType timerType,
1164 const QObject *receiver, const char *member)
1165{
1166 singleShot(from_msecs(interval), timerType, receiver, member);
1167}
1168
1169void QTimer::singleShotImpl(std::chrono::milliseconds interval, Qt::TimerType timerType,
1170 const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj)
1171{
1172 QtPrivate::SlotObjUniquePtr slot(slotObj); // don't leak if from_msecs throws
1173 const auto ns = from_msecs(interval);
1174 singleShotImpl(ns, timerType, receiver, slot.release());
1175}
1176
1177#include "qurl.h"
1178
1179bool QUrl::operator<(const QUrl &url) const
1180{
1181 return is_lt(compareThreeWay(*this, url));
1182}
1183
1184bool QUrl::operator==(const QUrl &url) const
1185{
1186 return comparesEqual(*this, url);
1187}
1188
1189bool QUrl::operator!=(const QUrl &url) const
1190{
1191 return !comparesEqual(*this, url);
1192}
1193
1194#include "qurlquery.h"
1195
1196bool QUrlQuery::operator==(const QUrlQuery &other) const
1197{
1198 return comparesEqual(*this, other);
1199}
1200
1201#include "qbasictimer.h"
1202
1203void QBasicTimer::start(std::chrono::milliseconds duration, QObject *object)
1204{
1205 start(std::chrono::nanoseconds(duration), object);
1206}
1207
1208void QBasicTimer::start(std::chrono::milliseconds duration, Qt::TimerType timerType, QObject *obj)
1209{
1210 start(std::chrono::nanoseconds(duration), timerType, obj);
1211}
1212
1213#include "quuid.h"
1214
1215bool QUuid::operator<(const QUuid &other) const noexcept
1216{
1217 return is_lt(compareThreeWay(*this, other));
1218}
1219
1220bool QUuid::operator>(const QUuid &other) const noexcept
1221{
1222 return is_gt(compareThreeWay(*this, other));
1223}
1224
1225QUuid QUuid::createUuidV3(const QUuid &ns, const QByteArray &baseData) noexcept
1226{
1227 return createUuidV3(ns, qToByteArrayViewIgnoringNull(baseData));
1228}
1229
1230QUuid QUuid::createUuidV5(const QUuid &ns, const QByteArray &baseData) noexcept
1231{
1232 return createUuidV5(ns, qToByteArrayViewIgnoringNull(baseData));
1233}
1234
1235#if QT_CONFIG(xmlstream)
1236#include "qxmlstream.h" // inlined API
1237#endif // QT_CONFIG(xmlstream)
1238
1239// #include "qotherheader.h"
1240// // implement removed functions from qotherheader.h
1241// order sections alphabetically to reduce chances of merge conflicts
1242
1243#endif // QT_CORE_REMOVED_SINCE(6, 8)
1244
1245#if QT_CORE_REMOVED_SINCE(6, 9)
1246
1247#include "qchar.h" // inlined API
1248
1249
1250#include "qexceptionhandling.h"
1251
1252Q_NORETURN void qTerminate() noexcept
1253{
1254 std::terminate();
1255}
1256
1257
1258#include "qmetatype.h"
1259
1260bool QMetaType::isRegistered() const
1261{
1262 return isRegistered(QT6_CALL_NEW_OVERLOAD);
1263}
1264
1265bool QMetaType::isValid() const
1266{
1267 return isValid(QT6_CALL_NEW_OVERLOAD);
1268}
1269
1270
1271#include "qmetaobject.h"
1272
1273const char *QMetaEnum::valueToKey(int value) const
1274{
1275 return valueToKey(quint64(uint(value)));
1276}
1277
1278QByteArray QMetaEnum::valueToKeys(int value) const
1279{
1280 return valueToKeys(quint64(uint(value)));
1281}
1282
1283
1284#include "qmutex.h"
1285
1286#if QT_CONFIG(thread)
1287void QBasicMutex::destroyInternal(QMutexPrivate *d)
1288{
1289 destroyInternal(static_cast<void *>(d));
1290}
1291#endif
1292
1293
1294#include "qobject.h"
1295
1296#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
1297QMetaObject *QObjectData::dynamicMetaObject() const
1298{
1299 // ### keep in sync with the master version in qobject.cpp
1300 return metaObject->toDynamicMetaObject(q_ptr);
1301}
1302#endif // Q_COMPILER_MANGLES_RETURN_TYPE
1303
1304
1305#include "qstring.h"
1306
1307QString QString::arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const
1308{
1309 return arg_impl(a, fieldWidth, base, fillChar);
1310}
1311
1312QString QString::arg(qulonglong a, int fieldWidth, int base, QChar fillChar) const
1313{
1314 return arg_impl(a, fieldWidth, base, fillChar);
1315}
1316
1317QString QString::arg(double a, int fieldWidth, char format, int precision, QChar fillChar) const
1318{
1319 return arg_impl(a, fieldWidth, format, precision, fillChar);
1320}
1321
1322QString QString::arg(char a, int fieldWidth, QChar fillChar) const
1323{
1324 return arg_impl(QAnyStringView(a), fieldWidth, fillChar);
1325}
1326
1327QString QString::arg(QChar a, int fieldWidth, QChar fillChar) const
1328{
1329 return arg_impl(QAnyStringView{a}, fieldWidth, fillChar);
1330}
1331
1332QString QString::arg(const QString &a, int fieldWidth, QChar fillChar) const
1333{
1334 return arg_impl(qToAnyStringViewIgnoringNull(a), fieldWidth, fillChar);
1335}
1336
1337QString QString::arg(QStringView a, int fieldWidth, QChar fillChar) const
1338{
1339 return arg_impl(QAnyStringView(a), fieldWidth, fillChar);
1340}
1341
1342QString QString::arg(QLatin1StringView a, int fieldWidth, QChar fillChar) const
1343{
1344 return arg(QAnyStringView(a), fieldWidth, fillChar);
1345}
1346
1347QString QtPrivate::argToQString(QStringView pattern, size_t n, const ArgBase **args)
1348{
1349 return argToQString(QAnyStringView{pattern}, n, args);
1350}
1351
1352QString QtPrivate::argToQString(QLatin1StringView pattern, size_t n, const ArgBase **args)
1353{
1354 return argToQString(QAnyStringView{pattern}, n, args);
1355}
1356
1357
1358#include "quuid.h"
1359
1360bool QUuid::isNull() const noexcept
1361{
1362 return isNull(QT6_CALL_NEW_OVERLOAD);
1363}
1364
1365QUuid::Variant QUuid::variant() const noexcept
1366{
1367 return variant(QT6_CALL_NEW_OVERLOAD);
1368}
1369
1370QUuid::Version QUuid::version() const noexcept
1371{
1372 return version(QT6_CALL_NEW_OVERLOAD);
1373}
1374
1375// #include "qotherheader.h"
1376// // implement removed functions from qotherheader.h
1377// order sections alphabetically to reduce chances of merge conflicts
1378
1379#endif // QT_CORE_REMOVED_SINCE(6, 9)
1380
1381#if QT_CORE_REMOVED_SINCE(6, 10)
1382
1383#include "qcborstreamwriter.h" // Q_WEAK_OVERLOAD added
1384
1385#include "qcoreapplication.h"
1386
1387#if QT_CONFIG(permissions)
1388void QCoreApplication::requestPermission(const QPermission &requestedPermission,
1389 QtPrivate::QSlotObjectBase *slotObjRaw, const QObject *context)
1390{
1391 return requestPermissionImpl(requestedPermission, slotObjRaw, context);
1392}
1393#endif
1394
1395#include "qdir.h"
1396
1397bool QDir::mkdir(const QString &dirName) const
1398{
1399 return mkdir(dirName, std::nullopt);
1400}
1401
1402bool QDir::mkdir(const QString &dirName, QFile::Permissions permissions) const
1403{
1404 return mkdir(dirName, std::optional{permissions});
1405}
1406
1407bool QDir::mkpath(const QString &dirPath) const
1408{
1409 return mkpath(dirPath, std::nullopt);
1410}
1411
1412#if QT_CONFIG(future)
1413#include "qfuture.h" // for ContinuationWrapper
1414#include "qfutureinterface.h"
1415
1416void QtPrivate::watchContinuationImpl(const QObject *context,
1417 QtPrivate::QSlotObjectBase *slotObj,
1418 QFutureInterfaceBase &fi)
1419{
1420 Q_ASSERT(context);
1421 Q_ASSERT(slotObj);
1422
1423 auto slot = QtPrivate::SlotObjUniquePtr(slotObj);
1424
1425 // That is now a double-inderection, because the setContinuation() overload
1426 // also uses QSlotObjectBase approach. But that's a solution for backwards
1427 // compatibility, so should be fine.
1428 // We pass a default-constructed QVariant() and an Unknown type, because
1429 // that's effectively the same as passing a nullptr continuationData, and
1430 // that's what the old code was doing.
1431 fi.setContinuation(context, QtPrivate::ContinuationWrapper([slot = std::move(slot)]()
1432 {
1433 void *args[] = { nullptr }; // for `void` return value
1434 slot->call(nullptr, args);
1435 }), QVariant(), QFutureInterfaceBase::ContinuationType::Unknown);
1436}
1437
1438void QFutureInterfaceBase::setContinuation(std::function<void(const QFutureInterfaceBase &)> func)
1439{
1440 setContinuation(std::move(func), nullptr);
1441}
1442
1443void QFutureInterfaceBase::setContinuation(std::function<void(const QFutureInterfaceBase &)> func,
1444 QFutureInterfaceBasePrivate *continuationFutureData)
1445{
1446 // Backwards compatibility - the continuation data was used for
1447 // then-continuations
1448 setContinuation(std::move(func), continuationFutureData, ContinuationType::Then);
1449}
1450#endif // QT_CONFIG(future)
1451
1452#include "qlogging.h"
1453
1454QNoDebug QMessageLogger::noDebug() const noexcept
1455{
1456 return QNoDebug();
1457}
1458
1459#include "qstring.h" // inlined API
1460
1461// #include "qotherheader.h"
1462// // implement removed functions from qotherheader.h
1463// order sections alphabetically to reduce chances of merge conflicts
1464
1465#endif // QT_CORE_REMOVED_SINCE(6, 10)