summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Remove usages of Q_OS_WINCEJoerg Bornemann2019-05-233-12/+2
| | | | | | | | | | | This platform is history. Change-Id: Iddfab008a509f4828c321730414c8204055cf7af Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Update outdated comment in QEventDispatcherWin32::processEventsJoerg Bornemann2019-05-231-1/+1
| | | | | | | | | | | | | The reason for the explicit qt_GetMessageHook call is not related to Windows CE anymore. It is a work-around used by the Direct2D integration. Change-Id: I489665741fc673ab9d29b35a0c02c51f2a9e9288 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Fix qdoc warnings for Qt 5.14Friedemann Kleint2019-05-214-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/corelib/tools/qstring.cpp:9505:clang found diagnostics parsing \fn int QLatin1String::indexOf(QLatin1String l1, int from Qt::CaseSensitivity cs) const error: expected ')' error: out-of-line definition of 'indexOf' does not match any declaration in 'QLatin1String' src/corelib/tools/qstringview.cpp:723:clang found diagnostics parsing \fn qsizetype QStringView::indexOf(QLatin1String l1, qsizetype from Qt::CaseSensitivity cs) const error: expected ')' error: out-of-line definition of 'indexOf' does not match any declaration in 'QStringView' src/corelib/tools/qstringview.cpp:822:Unknown command '\t' src/corelib/tools/qstringview.cpp:825:Unknown command '\t' src/corelib/tools/qstringview.cpp:826:Unknown command '\t' src/corelib/tools/qstringview.cpp:831:Unknown command '\t' src/corelib/global/qnamespace.qdoc:2448:Undocumented enum item 'MarkdownText' in Qt::TextFormat src/corelib/tools/qstringmatcher.cpp:183:No such parameter 'pattern' in QStringMatcher::QStringMatcher() src/network/ssl/qsslerror.cpp:58:Undocumented enum item 'CertificateStatusUnknown' in QSslError::SslError src/gui/kernel/qevent.cpp:5321:Undocumented parameter 'screenOrientation' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/kernel/qevent.cpp:5321:Undocumented parameter 'screen' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/kernel/qevent.cpp:5321:No such parameter 'orientation' in QScreenOrientationChangeEvent::QScreenOrientationChangeEvent() src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockCodeLanguage' in QTextFormat::Property src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockQuoteLevel' in QTextFormat::Property src/gui/text/qtextformat.cpp:532:Undocumented enum item 'BlockMarker' in QTextFormat::Property src/gui/text/qtextdocument.cpp:3294:Undocumented parameter 'features' in QTextDocument::toMarkdown() src/gui/painting/qcolorspace.cpp:659:Undocumented parameter 'colorSpace1' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:Undocumented parameter 'colorSpace2' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:No such parameter 'colorspace1' in QColorSpace::operator!=() src/gui/painting/qcolorspace.cpp:659:No such parameter 'colorspace2' in QColorSpace::operator!=() examples/widgets/doc/src/icons.qdoc:269:Command '\snippet (//! [43])' failed at end of file 'widgets/icons/iconpreviewarea.cpp' src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogRetryButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogYesToAllButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogIgnoreButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogNoToAllButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogAbortButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_RestoreDefaultsButton' in QStyle::StandardPixmap src/widgets/styles/qstyle.cpp:2026:Undocumented enum item 'SP_DialogSaveAllButton' in QStyle::StandardPixmap src/testlib/qtestcase.qdoc:439:Undocumented parameter 'TestClass' in QTest::QTEST_HIGHDPI_SCALING_MAIN src/testlib/qtestcase.qdoc:452:Undocumented parameter 'TestClass' in QTest::QTEST_NO_HIGHDPI_SCALING_MAIN Change-Id: Ib0e9bf81c5caaa6b1fc644ac92085af47c600e0e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Long live Qt::SplitBehavior!Marc Mutz2019-05-215-0/+85
| | | | | | | | | | | | | | | | | | | | | | | The is a copy of the QString::SplitBehavior enum, but scoped in the Qt namespace instead of inside QString, where it creates problems using it elsewhere (QStringView, in particular). Overload all QString{,Ref} functions taking QString::SplitBehavior with Qt::SplitBehavior. Make Qt::SplitBehavior a QFlags for easier future extensions (e.g. a hint to use Boyer-Moore searching). Added tests in QStringApiSymmetry. [ChangeLog][QtCore] Added new Qt::SplitBehavior. [ChangeLog][QtCore][QString/QStringRef] The split functions now optionally take Qt::SplitBehavior. Change-Id: I43a1f8d6b22f09af3709a0b4fb46fca61f9d1d1f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStandardDirs: fix quadratic loopMarc Mutz2019-05-211-8/+4
| | | | | | | | | | | | | | | Instead of a bad copy of remove_if, with quadratic complexity, use an ok copy of copy_if, with linear complexity. Port to QStringRef as a drive-by. Change-Id: I47fde73b33305385835b0012f6d332e973470789 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QFileSystemWatcher: fix quadratic loop by porting away from QMutableListIteratorMarc Mutz2019-05-211-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | QMutableListIterator::remove() is linear, so called in a loop, the loop potentially becomes quadratic. Fix by porting to std::remove_if. In this case, since the old code unconditionally detached, anyway, we use remove_copy_if to build a new list. That's still more efficient than the old code, even if nothing is removed. It also prepares the code for when Java-style iterators will be deprecated. Since the same code appears in two different functions, do an Extract Method into a file-static function. Lastly, restore NRVO for most compilers by returning the same object from all return statements of the function. Change-Id: I6909c6483d8f7acfd1bf381828f020038b04e431 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QFileSystemWatcherEngines: port some Java-style iterators to ranged-forMarc Mutz2019-05-214-53/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Java-style iterators are scheduled to be deprecated. The general pattern used in the patch is that instead of copying an input list, then iterating over the copy with some calls to it.remove() (which leads to quadratic-complexity loops), we simply copy conditionally (a la remove_copy_if instead of remove_if). To make clearer what's going on, rename the outgoing list to 'unhandled'. To avoid having to touch too much of the loops' structure, which sometimes is quite convoluted, use qScopeGuard to do the append to 'unhandled', unless the original code removed the element. Saves a surprising almost 5KiB in text size on GCC 9.1 optimized AMD64 Linux builds. Change-Id: Ifd861de9aa48d66b420858606998dd08a8401e03 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Add private qt_make_unique as a drop-in for C++14 std::make_uniqueMarc Mutz2019-05-212-0/+72
| | | | | | | | | | | | | | | | | | | | | | | The original is much more subtle, so don't try to be a 100% replacement. Most users will be able to use std::make_unique these days. This is just a minimal implementation to enable using the functionality in the implementation of Qt libraries. In particular, it does not attempt to deal with arrays. It is therefore not proposed as public API. It is placed in a new private header, since the only header in QtCore that already includes <memory> is sharedpointer_impl.h, and that did not seem to be a good place to add it. It is probably too much of a compilation-time drain to add <memory> to qglobal.h... Change-Id: Ie206ef7ae9beb36c63aef4ec46dbde6c73e0d9f5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCharRef/QByteRef: warn when triggering the resizing operator= behaviorGiuseppe D'Angelo2019-05-195-12/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The whole reason of QCharRef/QByteRef existence is to have a magic operator=. This operator= delays the actual detach up to the moment something is written into the Ref, thus avoiding spurious detaches to the underlying string/byte array. operator= has also an extra feature, it allows this code to succeed: QString s("abc"); s[10] = 'z'; assert(s == "abc z"); This last behavior is *extremely* surprising. The problem with all of this is that this extra convenience is outweighted by the massive pessimization in the codegen for operator[]; by the maintenance burden (QChar APIs need to be mirrored in QCharRef, etc.), and, for the automatic resize, by the fact that it's an super-niche use case. Cherry on top, std::basic_string does not do that, and no Qt or std container does that. In other words: any other container-like class exhibits UB for out of bounds access. We can't just go and change behavior, though. This is something coming all the way back from Qt 2 (maybe even Qt 1), which means we can't deprecate it at short notice. This patch simply adds a warning in debug builds in case the special resizing behavior is triggered. While at it, removes some code duplication in QByteRef. [ChangeLog][QtCore][QString] The behavior of operator[] to allow implicit resizing of the string has been deprecated, and will be removed in a future version of Qt. [ChangeLog][QtCore][QByteArray] The behavior of operator[] to allow implicit detaching and resizing of the byte array has been deprecated, and will be removed in a future version of Qt. Change-Id: I3b5c5191167f12a606bcf6e513e6f304b220d675 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix compilation error on compilers not supporting [[nodiscard]]Jędrzej Nowacki2019-05-211-4/+4
| | | | | | | | | | | | | | | | | | __warn_unused_result__ and [[nodiscard]] both are masked by Q_REQUIRED_RESULT but there are some minor differences between them. In general [[nodiscard]] is more flexible while __warn_unused_result__ can cause warnings in some contexts, for example: error #2621: attribute "__warn_unused_result__" does not apply here error #3058: GNU attributes on a template redeclaration have no effect That is a fix for regression caused by b91e6f6f40864d54903d707d7f19a9732188b670. Change-Id: Icf11b832f31e714a88536828051f4b7f348cdb36 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix build without features.timezone on macOSTasuku Suzuki2019-05-211-2/+0
| | | | | | | | It is no longer needed after bd78f57463c381203099d7939c9d37cba0341713 Change-Id: I73aceb10eab7c9fdc7d0dfbe89012df7d0110205 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* rtems: Disable features which RTEMS does not supportMikhail Svetkin2019-05-141-3/+3
| | | | | | | | | | | | | | | | | | | | | build: - shared - use_gold_linker - large file support QtCore: - systemsaphore - process - processenvironment QtGui: - clipboard - multiprocess Change-Id: I641b37d0b603bbe6f0a839019f458f8138c73d34 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Qt 6: unexport QCharRef / QByteRefGiuseppe D'Angelo2019-05-182-3/+10
| | | | | | | They're fully inlined classes. Change-Id: Id9e5f1a1a0b3d8ee49ba45ad2157ffa38fe265cd Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QFileSystemWatcher: lock autotest code away into a cold sectionMarc Mutz2019-05-211-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | The code contained a sizeable chunk of string parsing along with qDebug()s in the normal path of execution. That code, however, was only used for Qt's own autotests. The idea of this patch is, then, to not only move the autotest case into the cold text section (using Q_UNLIKELY), but also to completely exclude it, when QT_BUILD_INTERNAL is not set. Unfortunately, the structure of the function did not really lend itself to #ifdefing that part of the code out (production code was in the middle of non-production code), so I transformed the engine selection code into a lambda, replacing assignment with returns, and swapping the branches of the central if around to yield a single block of code that can be excluded from compilation with just one #ifdef. As a consequence, the runtime code is almost unaffected, and the function is much easier to read now. Since the test-specific code is only compiled into Qt now in developer builds, guard the tests that rely on this behavior with the same macro. Change-Id: I9fd1c57020a13cef4cd1b1674ed2d3ab9424d7cd Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Disable copies in QObjectData / QObjectUserDataGiuseppe D'Angelo2019-05-182-0/+15
| | | | | | | They're meant to be subclassed, so we need to avoid slicing. Change-Id: I384b65478f728c69aaf1edbc985b3fb4150191fe Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QScopeGuard: some cleanupsMarc Mutz2019-05-211-3/+2
| | | | | | | | | | | | | | Use qExchange() in the move ctor and pass the function object by rvalue ref. This saves one move construction and doesn't produce unexpected results. The qScopeGuard free function should take the function object by value, because it decays and because we can't create an rvalure reference in a deduced context. But once we're inside qScopeGuard, the extra object isn't needed anymore, so optimize it away. Change-Id: I94cbc45f9bf6ca086e100efd922a0b4643a81671 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QStateMachine: handle parallel child mode for state machinesErik Verbruggen2019-05-163-8/+43
| | | | | | | | | | | | | | | | Setting the childMode property to ParallelStates will result in an invalid state machine. This is never checked (worse, we explicitly allow it and have a constructor to set it), but it results in findLCCA failing, which then results in a failing assert or crash. This fix in this patch is to handle this case separately. The proper fix would be to remove completely the ability to set the childMode on a QStateMachine, but that will have to wait until Qt6. Fixes: QTBUG-49975 Change-Id: I43692309c4d438ee1a9bc55fa4f65f8bce8e0a59 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Tidy up in qdatetime.cppEdward Welbourne2019-05-151-18/+7
| | | | | | | | | | Break a line before a close-brace. Added blank lines. Remove some duplicate blank lines and spurious \fn directives. Fixed placement of & between type and parameter name in the function declarations that made these last redundant (these are the WS-only changes). Change-Id: I7ee06a7cbb4f9cb275d5ad87246d8fbc9c9b6668 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Cleanup the fallout of QWeakPointer::data() deprecationGiuseppe D'Angelo2019-05-172-4/+19
| | | | | | | | | | | | | | | | | There are still users of QWeakPointer::data(), which under certain compilers will make headersclean fail. So this patch: * ports data() to a private internalData() function and calls it from all the usage points; * adds cleanup notes for Qt 6, once some of the deprecated machinery around storing unmanaged QObjects in QWeakPointers can get removed. Change-Id: Id3bcbd23374c18a2026861c08a4dcba1670673c1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QtCore: mark obsolete enumerations as deprecatedChristian Ehrlicher2019-05-171-11/+25
| | | | | | | | | | | | | | | | | | | | | The following enumerations were obsolete for a log time but not marked as deprecated: - WA_NoBackground - WA_MacNoClickThrough - WA_MacBrushedMetal - WA_MacMetalStyle - WA_MSWindowsUseDirect3D - WA_MacFrameworkScaled - AA_MSWindowsUseDirect3DByDefault - AA_X11InitThreads - ImMicroFocus mark them as deprecated and remove the usage inside QtBase so they can be removed with Qt6 Change-Id: Ia087a7e1d0ff1945286895be6425a6cceaa483fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Deprecate QWeakPointer::data()Giuseppe D'Angelo2019-05-163-7/+6
| | | | | | | | | | | It's a dangerous API to have. Upgrade to a shared pointer if accessing the raw pointer is required. [ChangeLog][QtCore][QWeakPointer] The data() function has been deprecated. Change-Id: Ie5d34f4fb500b3cfa14d2c0b1b08484df072129c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add some examples to qExchange() docsMarc Mutz2019-05-161-0/+39
| | | | | | Change-Id: I758782f6566ab94006aedacc9988ec4eb09a14c6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Liang Qi2019-05-157-16/+42
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-157-16/+42
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qfloat16.cpp src/corelib/global/qfloat16.h src/plugins/platforms/windows/qwindowswindow.cpp Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
| | * Add 'well-formated' JSON string valuesMichal Klocek2019-05-141-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for surrogate code points U+D800 through U+DFFF, represent them with JSON escape sequences. https://github.com/tc39/proposal-well-formed-stringify Change-Id: I84fea53a8ef400beebefdba10ea82dc510fe7dda Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into ↵Liang Qi2019-05-134-9/+31
| | |\ | | | | | | | | | | | | refs/staging/5.13
| | | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-124-9/+31
| | | |\ | | | | | | | | | | | | | | | Change-Id: I0c00ffe0eabebc919f22d6faa4bf958b288e8fd9
| | | | * QSharedPointer: fix threadsafety docsGiuseppe D'Angelo2019-05-111-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Try and explain better the situation around QSharedPointer: it's reentrant, not thread safe. Change-Id: Ief9d28be8ea3fbaa6014cb6b999626db1bab52ca Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | | * Work around VS2015/17 bitset + qfloat16.h compiler bugKeith Kyzivat2019-05-102-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][Global] Added the QT_NO_FLOAT16_OPERATORS macro in order to work around a Microsoft <= VS2017 compiler bug that is exposed when using std::bitset along with any Qt header that includes <qfloat16.h>. This is fixed in MSVC 2019[1], but the workaround is needed for earlier versions. In this case, cl.exe fails with C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(270): error C2666: 'operator /': 10 overloads have similar conversions C:\Qt\5.12.0\msvc2017_64\include\QtCore/qsize.h(364): note: could be 'const QSizeF operator /(const QSizeF &,qreal)' C:\Qt\5.12.0\msvc2017_64\include\QtCore/qsize.h(194): note: or 'const QSize operator /(const QSize &,qreal)' c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(427): note: or 'QMarginsF operator /(const QMarginsF &,qreal)' c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(213): note: or 'QMargins operator /(const QMargins &,qreal)' c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(207): note: or 'QMargins operator /(const QMargins &,int)' C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(205): note: or 'double operator /(int,qfloat16) noexcept' C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(205): note: or 'double operator /(qfloat16,int) noexcept' C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(195): note: or 'float operator /(float,qfloat16) noexcept' C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(195): note: or 'float operator /(qfloat16,float) noexcept' C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(194): note: or 'double operator /(double,qfloat16) noexcept' C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(194): note: or 'double operator /(qfloat16,double) noexcept' C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(193): note: or 'long double operator /(long double,qfloat16) noexcept' C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(193): note: or 'long double operator /(qfloat16,long double) noexcept' C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(176): note: or 'qfloat16 operator /(qfloat16,qfloat16) noexcept' C:\Qt\5.12.0\msvc2017_64\include\QtCore/qpoint.h(402): note: or 'const QPointF operator /(const QPointF &,qreal)' C:\Qt\5.12.0\msvc2017_64\include\QtCore/qpoint.h(206): note: or 'const QPoint operator /(const QPoint &,qreal)' C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(270): note: or 'built-in C++ operator/(::size_t, )' C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(270): note: while trying to match the argument list '(::size_t, )' C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(266): note: while compiling class template member function 'std::bitset<8> &std::bitset<8>::set(::size_t,bool)' C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(39): note: see reference to function template instantiation 'std::bitset<8> &std::bitset<8>::set(::size_t,bool)' being compiled ..\Qt5.12.0-C2666\main.cpp(7): note: see reference to class template instantiation 'std::bitset<8>' being compiled Invoke this workaround by defining the macro QT_NO_FLOAT16_OPERATORS in user code prior to the inclusion of Qt includes in a translation unit. Arithmetic operators from qfloat16 will then not be present in that compilation unit. [1] https://developercommunity.visualstudio.com/content/problem/406329/compiler-error-c2666-when-using-stdbitset-and-cust.html Task-number: QTBUG-72073 Change-Id: I58f8400bf933ad781d4213731695e20e0c482166 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | | | * Update CLDR version in attributionEdward Welbourne2019-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to 43abe86e. Change-Id: I2442304c9c79bcb1932fb173b8d993a242d79f4b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| | * | | doc: clang reported two fake declarations to be the sameMartin Smith2019-05-132-3/+3
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These declarations are provided for qdoc, but clang says they are the same: template <typename Functor> QMetaObject::Connection callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection); template <typename PointerToMemberFunction> QMetaObject::Connection callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection); clang accepts this one, but is it ok for the documentation? template <typename MemberFunction> QMetaObject::Connection callOnTimeout(const QObject *receiver, MemberFunction *slot, Qt::ConnectionType connectionType = Qt::AutoConnection); Change-Id: I9d63b1bccfa8d73dbc17ab70c4415eb7891fbbe2 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | / / QContiguousCache: add noexceptGiuseppe D'Angelo2019-05-151-2/+2
|/ / / | | | | | | | | | | | | Change-Id: I069842fe705d2e73222ffb095792d7e3e518cfd9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QSharedData: code tidiesGiuseppe D'Angelo2019-05-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add noexcept and honor the RO3 to silence warnings. In theory this could also be constexpred, but there might still be compilers we support that do not have constexpr initialization for atomics... Change-Id: Ibb94a2f4392908451cf7985d48f999581f03398d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QSharedData: unexport in Qt 6Giuseppe D'Angelo2019-05-141-1/+5
| | | | | | | | | | | | | | | | | | | | | It's fully inlined anyhow. Change-Id: I8cb78ad6f75d3cc3b27cf91a3ba271cf312c9555 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QByteData: use int to return the number of managed QByteArraysGiuseppe D'Angelo2019-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internal QByteArrays are kept in a QList, so we can use int to get the count. This matches what operator[] takes, and gets rid of a bunch of warnings when iterating over a QByteData using a plain int as a index variable. Change-Id: Ib44d4101612135b976979a8464442e94706f8736 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Short live qExchange()!Marc Mutz2019-05-142-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a 1:1 replacement for std::exchange, and should be removed once Qt fully depends on C++14. It's too versatile a tool to miss it, so provide a copy. [ChangeLog][QtCore][QtGlobal] Added qExchange(), a drop-in for C++14's std::exchange() Change-Id: I31c4f1141e7a99f99ea65eb36ddf9d68b7847337 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QTypeInfo: move QLinkedlist declaration to qlinkedlist.hMarc Mutz2019-05-142-1/+3
| | | | | | | | | | | | | | | | | | | | | This is in preparation of deprecating QLinkedList. Change-Id: Id5018b7fbc89f8b76b86e97cd09d18b4b8cb6234 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix build without features.itemmodelTasuku Suzuki2019-05-142-0/+4
| | | | | | | | | | | | | | | | | | | | | The macro needed to avoid generating headers_*.o from the header files. Change-Id: I4fc5ec2432661493e337e1779d79373dedff0132 Reviewed-by: David Faure <david.faure@kdab.com>
* | | QDataStream: move QLinkedlist operators to qlinkedlist.hMarc Mutz2019-05-142-13/+15
| | | | | | | | | | | | | | | | | | | | | This is in preparation of deprecating QLinkedList. Change-Id: I7540b784736a48cf4857d1969440d35ec64457e2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QPointer: fix swap()Giuseppe D'Angelo2019-05-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make it noexcept and add an overload as a free function. [ChangeLog][QtCore][QPointer] Added a free swap function. Change-Id: I50744b9bae6a52db71b2da39e310619b3a0d6510 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-1327-3857/+4142
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-0911-3745/+4050
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlocale_data_p.h (Regenerated by running the scripts in util/local_database/) src/gui/opengl/qopengltextureuploader.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
| | * Define Q_OS_WINDOWS, make it an alias to Q_OS_WINSergio Martins2019-05-082-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As seen in several occasions, both in user code and in Qt proper, people make these mistakes. What makes it harder to spot is that it doesn't look like a typo, and feels natural (natural as Q_OS_LINUX instead of Q_OS_LIN feels). There's been a P1 in qtdeclarative/ and currently there's a Q_OS_WINDOWS usage in qtwebengine. This is a recurring problem, no matter how much people test and review these errors will happen, so the alias is justified. Change-Id: If6943b52e17f0c8b238c36bb1f7834802123f12a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Fix integer overflows in QDeadlineTimerKonstantin Shegunov2019-05-082-60/+383
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the deadline is far in the future, the conversions to nanoseconds or internal arithmetic may overflow and give an invalid object, thus the deadline may end up in the past. Added a test to the testlib selftest for sleep. [ChangeLog][QtCore][QDeadlineTimer] Fixed integer overflows leading to immediate timeouts. Task-number: QTBUG-69750 Change-Id: I9814eccdf9f9b3add9ca66ec3e27e10cd5ad54a8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Windows: Add debug output for message WM_DPICHANGEDFriedemann Kleint2019-05-081-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add it to the name lookup and add verbose formatting to the debug operator. Task-number: QTBUG-73014 Change-Id: I31ee31bc28ef563fdbc0adedcea03546ced5faad Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| | * Update locale data to CLDR v35.1Edward Welbourne2019-05-072-3623/+3645
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The formatting of times in Norwegian has reverted to using dots in place of colons, as it did before v31 (commit 82deb0ad1), so reverted the tests to their state before that. Change-Id: I8a09ce253731bb0f0f3caca117f06ad568940a81 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Document how to use CMake on Qt Core, Qt GUI's central pagesKai Koehne2019-05-074-71/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add documentation on how to use a module from CMake, alongside the existing documentation about qmake. Separate generic info from module-specific examples, to make it possible to use one include file in all modules. While at it, also remove the mentioning of the central include; it is not something we should actively advocate anymore. Instead, the documentation of every class gives the correct include to use. Task-number: QTBUG-73058 Change-Id: I6b3c0e5ea218dd9c06a491c8fb799a7fcf42dd92 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| * | Doc: replace even more null/0/nullptr with \nullptr macroChristian Ehrlicher2019-05-0816-112/+92
| | | | | | | | | | | | | | | | | | | | | | | | Try to replace all wordings like '.. to 0' with '.. to \nullptr'. Also checked for 'null pointer' and similar. Change-Id: I73341f59ba51e0798e816a8b1a532c7c7374b74a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QSharedPointer/QWeakPointer: fix swap()Giuseppe D'Angelo2019-05-111-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | Do not specialize std::swap, just add swap in Qt's namespace. Also add swap() for QWeakPointer, and sprinkle noexcept. Change-Id: Ifb06c214f1865d42f3f2cddf5f980aede6bde185 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Deprecate QQueue::swap(i, j)Lars Knoll2019-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | QList::swapItemsAt() is the replacement. Change-Id: Id0f194f9b63fd34c612f15e7952c33564f90120c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>