summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Remove extra semicolon from QConcatenable<const char16_t *>::sizeMichael Brüning2019-08-131-1/+1
| | | | | | | Reduces the number of warnings when building a bit. Change-Id: I18e9a95a211736f18876405ba3d866f704e4dbe0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QTextCodec: port to QRecursiveMutexMarc Mutz2019-08-131-12/+17
| | | | | | | | | | | | | | | | | Write a local mutex locker for DRY. Use qt_unique_lock(Mutex*) because we do not intend to add a QRecursiveMutexLocker and by Qt 6, the current work-around where QMutexLocker works for QRecursiveMutex, too, will be gone. Could have used qt_scoped_lock, because no premature unlock() calls are present, but it turns out the code attempts to take the mutex after it's destroyed by Q_GLOBAL_STATIC, so we need QMutexLocker compat, thus qt_unique_lock(Mutex*) instead of qt_scoped_lock(Mutex&). Need to use decltype and using because auto doesn't work for NSDMs. Change-Id: I8b0f8a3067f0a412279d075cb959105e485789cd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QResource: port from QMutexLocker to qt_scoped_lockMarc Mutz2019-08-131-13/+13
| | | | | Change-Id: I483e4765ef83d13e81bb830c9f48421410c5718b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Merge remote-tracking branch 'origin/5.13' into dev"Liang Qi2019-08-139-23/+42
|\
| * Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-08-139-23/+42
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/win32-clang-msvc/qmake.conf src/corelib/tools/qlist.h src/gui/painting/qcompositionfunctions.cpp src/gui/painting/qtriangulator_p.h src/gui/text/qfontengine_p.h src/network/kernel/qhostinfo_p.h src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: Ib8a0308cf77224c4fbdcf56778fdac4a43e37798
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-08-123-11/+13
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/arch/write_info.pri Repair architecture config test for the WASM_OBJECT_FILES=1 build mode configure.pri tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp Done-With: Jörg Bornemann <joerg.bornemann@qt.io> Change-Id: I9e12088356eb5bc65b53211cd7a8e330cccd1bb4
| | | * Fix integer overflow in QCryptographicHash's SHA-3 supportThiago Macieira2019-08-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because 256 MB * 8 = 2 Gbit, but length*8 is a signed integer overflow, hence UB. Can't really autotest this. Not all systems where we're going to test can allocate 256 MB of RAM. [ChangeLog][QtCore][QCryptographicHash] Fixed a bug that caused the SHA-3 and Keccak algorithms to crash if passed 256 MB of data or more. Fixes: QTBUG-77362 Change-Id: Iec9c051acd73484c8d94fffd15b91f4b1450f5d7 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | | * Fix sign change warningSimon Hausmann2019-08-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The conversion from int to uint is deliberate here, so let's cast and avoid a warning for users compiling with warnings enabled. Change-Id: I7136d6161ace735be49f8d987338f6d401a5c78a Fixes: QTBUG-77245 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * QBitArray: fix fromBits() and actually test itThiago Macieira2019-08-081-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I initially added it, it was ony for QCborValue, but I never added the tests. Turns out there were two bugs: [ChangeLog][QtCore][QBitArray] Fixed two bugs that caused QBitArrays created using fromBits() not to compare equal to the equivalent QBitArray created using other methods if the size was zero or not a multiple of 4. If the size modulus 8 was 5, 6, or 7, the data was actually incorrect. Fixes: QTBUG-77285 Change-Id: Ife213d861bb14c1787e1fffd15b70573d162042c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * | QList: fix some integer cast warnings from 64- to 32-bitThiago Macieira2019-08-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not tested because we're not promising to fix them all. Just those two that were reported. Fixes: QTBUG-77391 Change-Id: Iec9c051acd73484c8d94fffd15b91f5e6348635d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * | QBitArray: change modulo 8 with bitwise-AND 7Thiago Macieira2019-08-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They're the same only for unsigned values. Modulo of negative numbers since C++11 has an expected behavior and generates more code: %rax = %rax & 7: andl $7, %eax %rax = %rax % 8 with GCC: cqto shrq $61, %rdx addq %rdx, %rax andl $7, %eax subq %rdx, %rax [read as ((%rax + (%rax < 0 ? 7 : 0)) & 7) - (%rax < 0 ? 7 : 0))] With Clang: movq %rax, %rcx sarq $63, %rcx shrq $61, %rcx addq %rax, %rcx andq $-8, %rcx subq %rcx, %rax Change-Id: Ife213d861bb14c1787e1fffd15b83b004be7eba0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-083-4/+9
| | |\| | | | | | | | | | | | | Change-Id: I4c0fd501db974fb8339944b8df845336776d80a9
| | | * QMutexPool: fix memory order of atomic operationsMarc Mutz2019-08-052-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The array of QAtomicPointer<QMutex> can be initialized using relaxed stores of nullptr, since nullptr is the whole data. But once we store an actual QMutex pointer in the array, we need to publish the indirect data thus created. We did this, with testAndSetRelease(); what was missing was a corresponding acquire fence on load, without which there is no happens-before relationship between the writes performed by the QMutex ctor and the reads performed by a subsequent mutex.lock(), say, on the same data. Fix by adding acquire fences to all loads. That includes the dtor, since mutexes may have been created in different threads, and never been imported into this_thread before the dtor is running. As a drive-by, return a new'ed QMutex that was successfully installed directly to the caller, without again going through a load-acquire. Fixes: QTBUG-59164 Change-Id: Ia25d205b1127c8c4de0979cef997d1a88123c5c3 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 65b8f59e045bb41fef99b1a44f462115de65064a) (cherry picked from commit da38f0d691d9d7eacfac5fbcbd47b887bd59bd39)
| | | * Fix race condition on qt_create_tls() on WindowsThiago Macieira2019-08-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If this function is called by multiple threads, more than one could reach the mutex locking and call TlsAlloc(), but only the last one would save the data. The others would be leaked and, worse, be used by those other threads. [ChangeLog][QtCore][QObject] Fixed a resource leak caused by a race condition if multiple QObjects were created at the same time, for the first time in an application, from multiple threads (implies threads not started with QThread). Fixes: QTBUG-77238 Change-Id: Ife213d861bb14c1787e1fffd15b63a5818bcc807 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * | Fix two examples in QUrl::toLocalFile() documentationAndreas Hartmetz2019-08-071-2/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: Ib17844e1dd696a41815bdf58924ff40d684884a8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-08-053-4/+19
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/unix/unixmake2.cpp src/plugins/platforms/cocoa/qcocoawindow.mm Change-Id: Iba7aa7324f35543e0297a3680956420058cd3630
| | | * macOS: Add system detection and version defines for macOS Catalina (10.15)Tor Arne Vestbø2019-08-013-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I127efe752ebb70825f1b31f0d64c4293d1c71820 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | | Fix return valueLars Knoll2019-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method actually returns a boolean. Change-Id: I5887ad23e19be9a9c87c7858d81891378fd23cc9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | Inline QMetaObjectPrivate::signalOffset()Lars Knoll2019-08-132-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This saves one more function call in activate(). before after string based connect: 2436 2380 pointer based connect: 3265 3160 not connected: 400 307 disconnected: 489 404 5 slots connected: 4515 4522 Change-Id: I4789c7400497c2aa08886ea964af5e5e4703eeab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | QChar: add FormFeed (FF) special characterThiago Macieira2019-08-122-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QChar] Added FormFeed (FF) special character. Fixes: QTBUG-77089 Change-Id: I1024ee42da0c4323953afffd15b245a508f545f0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Short live qt_unique_lock/qt_scoped_lock! (until C++17)Marc Mutz2019-08-132-0/+120
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that QRecursiveMutex is getting split off of QMutex, QMutexLocker will stop working on QRecursiveMutex once the split has been finalized in Qt 6. Even today, QMutexLocker contains casts from QBasicMutex to QMutex that some reviewers are uncomfortable with. One way to carry QMutexLocker forward is to template it on the mutex type, possibly with aliases like QBasicMutexLocker and QRecursiveMutexLocker. C++17 code would then not require a port, thanks to CTAD. But we have the problem now, and we can't template QMutexLocker in Qt 5. The alternative is to look at std and realize that they have surpassed QMutexLocker in expressiveness already. A scoped_lock cannot be unlocked again, a unique_lock can be moved around. QMutexLocker doesn't do either. The only "problem" is that the std lock classes are already templates, but we can't, yet, rely on C++17 CTAD to make them look as if they weren't. So, prepare for a future with C++17 CTAD by writing factory functions, qt_scoped_lock and qt_unique_lock, which will later port mechanically to their C++17 equivalents (mostly). The functions are added to a new private qlocking_p.h becauee we don't want to make them public. These are for use in Qt's own implementation, or for users that don't care about compatibility and will not mind them to be removed once we depend on C++17. Originally, I planned to use qmutex_p.h instead, but that header is not self-contained and causes build errors when we started to include it into libraries other than QtCore. Regarding the return value of qt_scoped_lock: Ideally, we'd like to return a std::scoped_lock, but two things stand in the way: First, scoped_lock was only added in C++17 (we fall back to lock_guard if scoped_lock is not available). Second, returning one from a function requires C++17 guaranteed copy elision, because neither scoped_lock not lock_guard have a copy ctor. In order for code not to come to depend on a particular lock class, we return any of lock_guard, unique_lock or scoped_guard, depending on what the compiler supports, and therefore wrap the functions in the unnamed namespace to avoid running into ODR if (private) headers are used from different projects (autotests, e.g.). By the time we can drop them, however, qt_*_lock will be semantically 100% identical to their replacements. Port some initial users. Change-Id: I2a208ef2a4a533ee8e675812273986460e6b4d00 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | CMake: Add documentation for qt5_import_plugins()Alexandru Croitor2019-08-122-0/+80
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-38913 Change-Id: If4a51e695864ab658fb5223fd8c2162b14a267c8 Reviewed-by: Kavindra Palaraja <kpalaraja@luxoft.com>
* | | CMake: Add support for auto-importing plugins in CMakeKyle Edwards2019-08-121-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds transitive dependencies to the plugins, so that a sane set of default plugins get auto-imported when linking against a module. It also provides a new function, qt5_import_plugins(), which allows you to override the set of plugins that get imported. The decision of whether or not to import a specific plugin is based on several custom target properties and a very clever generator expression. Note that this change only imports plugins on static Qt builds. It does nothing on shared Qt builds, as the shared libraries already have their own plugin import mechanism. [ChangeLog][CMake] Added ability to auto-import non-qml plugins on CMake builds Task-number: QTBUG-38913 Task-number: QTBUG-76562 Change-Id: I2d6c8908b521cf6ba1ebbbc33a87cb7ddd9935cf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Deprecate QStringViewLiteralMarc Mutz2019-08-103-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a macro, we can't directly deprecate it, but need to make it call something deprecated. That is a new ctor with a new enum type added. The type might be useful for other such ventures, so put it into qglobal.h Remove the QT_NO_UNICODE_LITERAL protection, as it's always false these days, and QT_UNICODE_LITERAL is unconditionally #defined a 20 lines above. [ChangeLog][QtCore][QStringView] Deprecated the (undocumented) QStringViewLiteral macro. Just use u"" or QStringView(u"") instead. Change-Id: I9141320225037e1bc6b7f920bf01a9d0144fdac2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Refactor memory allocation for arguments of QMetaCallEventsVolker Hilsheimer2019-08-103-82/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two cases: In a BlockingQueuedConnection, QMetaCallEvent doesn't allocate memory and instead passes already existing pointers through. A QSemaphore is used to serialize data access between threads. So the constructor taking a QSemaphore can be simplified to only accept an existing arg array. In a QueuedConnection, QMetaCallEvent needs to make deep copies of the arguments, and memory needs to be allocated based on the number of arguments. The previous code put the burden of memory allocation on the code generating the event, while the memory was free'd by ~QMetaCallEvent. Instead, make it QMetaCallEvent's responsibility to allocate and free the memory as needed, and adjust the code generating QMetaCallEvents. We can allocate the memory for types and pointers to arguments in a single block, starting with the space for the array of void*, followed by the space for the array of integers to avoid byte alignment issues. By pre-allocating the space that's needed by three arguments, we can avoid all mallocs for the majority of QMetaCallEvents. Until this change has propagated through qt5.git, we need to keep the old API that is still used by QtDeclarative around. Once QtDeclarative has migrated to the new API, it can be removed. Change-Id: Id7359ffc14897237ea9672dabae9ef199a821907 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Give some TLC to QAppleRefCountedMarc Mutz2019-08-091-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add conditional noexcept to move special member functions - use qExchange() in the move ctor implementation (turns a copy into a move) - separate the default ctor from the ctor that acquires a resource, then - overload the latter for rvalue payloads Change-Id: I6816143a94fe6a74cf0d02569b83a752a8da3089 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Minor QSet doc cleanupAlex Blasche2019-08-081-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | C++11 is a requirement since Qt 5.7. There is no point in highlighting the condition anymore. Change-Id: I0f7d6044db2528d3b5264c324cf71156ec833775 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QDateTimePrivate: inherit QSharedData and other cleanupsMarc Mutz2019-08-072-14/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't manage the ref-count yourself, as this requires the code to use the QAtomic copy ctor, which we want to remove going forward. Using QSharedData, we can let the compiler write the code for us. Since 'ref' this way moves to the first spot in the list of effective members, creating a 4B hole between itself and 'msecs', swap 'status' and 'msecs' to fill the hole: offset: 0 8 16 24 | | | | without v v v v adj.mnt: |*R*| | msecs | S | U | TZ.... before: | msecs | S | U |*R*| | TZ... after: |*R*| S | msecs | U | | TZ.... This keeps the padding out of the critical first word, which improves latency. That said, for accessing the members the old layout surely was optimal. This layout optimizes copies and pessimizes access to 'msecs' on 32-bit platforms without the Critical Word First optimization. Requires adjustments to tst_toolsupport and the qhooks version. Also default members using NSDMI, consequently drop the manual default ctor. Change-Id: I3c48e68694ad29b28a13aa47ea0f283fae52edd7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QPoint/F: add transposed()Marc Mutz2019-08-072-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For symmetry with QSize and QRect and because there were some users in Qt. Port those users. [ChangeLog][QtCore][QPoint/QPointF] Added transposed(). Change-Id: If4f23dbcf7d67983a6b1885e0d1d538115b49e2b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QVector/QList/QLinkedList/QVarLengthArray/QSet: add missing deduction guidesMarc Mutz2019-08-075-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends 2e1763d83a1dacfc5b747934fb77fa7cec7bfe47. The new range ctors need deduction guides, since the compiler can't deduce the value_type from a pair of iterators. Change-Id: I3ec1e5f91305b317c443b6a70246be416b55bad9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Simplify QDate::weekNumber() by looking at the right day of the weekEdward Welbourne2019-08-071-27/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | The Thursday in the same week has the same week-number and determines the right year to use for the week. So calculate its week-number and save a whole lot of complications. Change-Id: I9c28267e6083afdd04a15245e1609c64beb82b37 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Thou Shalt Not Specialize std Function TemplatesMarc Mutz2019-08-033-27/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (or forward-declare std types) (with apologies to Mr Walter Brown) This applies the changes to our other smart pointers that a0c4b6f34546bdd22167a76a0540d37e9a37c0cf applied to QSharedPointer, with the same rationale: wg21.link/p0551. It also fixes a fwd declaration of std::function, including <functional> instead. Rationale: wg21.link/p684r0. Change-Id: If275af91f6eac15eb418b200ac7d08ba084a6130 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Un-deprecate QSignalMapperSona Kurazyan2019-08-012-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the comments on QTBUG-73407 and the last comments on 29bcbeab90210da80234529905d17280374f9684, it seems like there are still use-cases when QSignalMapper is useful. Change-Id: I8402286cb8a395a4601cda8a4cdda51f19aef073 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QResource: consistently cache resourceList()Marc Mutz2019-08-011-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each call to reourceList() uses atomic operations to check whether resourceGLobalData has not expired, yet. Some functions already cached the value, but then went on to use the function directly afterwards. In some cases, this was due to the cached value being a pointer-to-const and the function later deciding to mutate the list. But all the code is safe from detaches, so this distinction need not be made. Standardize on caching, and using the cached value, except in functions which call it only once. Change-Id: I79780b990da539bf7beaa8104e13cb8187f84812 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-011-1/+1
|\| | | | | | | | | | | Change-Id: I4505ec6fe17a1aa2c8d1e6576234d06a34eb9f99
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-311-1/+1
| |\| | | | | | | | | | Change-Id: Ifbaa4877051d93bcb0d58eed35bfe8dffa5634a3
| | * qfsfileengine_p.h: Un-inline processOpenModeFlagsOliver Wolff2019-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | An inlined exported function does not make sense and will cause a warning. Fixes: QTBUG-77242 Change-Id: I016b93d6b39c4db82148fdc5a8a92bc9d5751885 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* | | QSortFilterProxyModel: avoid some unnecessary copiesChristian Ehrlicher2019-07-311-34/+30
| | | | | | | | | | | | | | | | | | | | | | | | Clean up QSortFilterProxyModel by using const refs instead copies and range-based for loops instead plain loops Change-Id: Ic1250f33e7c311a9e1d3c19cc5dc7a9578423e74 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev"Liang Qi2019-07-303-21/+40
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-303-21/+40
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/win32/mingw_make.cpp Change-Id: I2f790bc8572bd22fea01edf7ca74595b29f063eb
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-302-19/+36
| | |\| | | | | | | | | | | | | Change-Id: Ibdbd88e11cd03d5ce558e67ad8e9a21436e7ef89
| | | * Move processOpenModeFlags out of QFSFileEngineOliver Wolff2019-07-292-19/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same logic is needed for QWinRTFileEngine. To be able to reuse the code, it was moved out of the class. Task-number: QTBUG-77095 Change-Id: If52b2fc8a0f3056d32fc693775565a1c3803b7d4 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-291-2/+4
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qresource.cpp Change-Id: I54917f72444a621bd08aeaa15f5d17415993144d
| | | * QResource: fix nullptr-check gone tautologicalMarc Mutz2019-07-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends 136c5b9338f71775eb42528cfc7c23b2b4e5dff9. Before that change, each of the three members was a separate Q_GLOBAL_STATIC, so checking resourceList() for nullptr was the correct thing to do to find out whether the static was already destroyed. After the change, the resourceList() function will never return nullptr. Either resourceGlobalData.isDestroyed(), in which case dereferencing it asserts, or it isn't, in which case resourceList() returns a valid pointer. An explicit isDestroyed() check was added to the unregister function, but the register one was also checking resourceList() for nullptr, and this was left unprotected. Add the check and remove the now-tautological checks for nullptr resourceList(). Change-Id: I41fe66939ce858a77802b8af04c1de6e4fafe048 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | QEasingCurve: reduce code duplication in setCurveShape()Marc Mutz2019-07-301-19/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of creating an explicit QEasingCurve object in each switched-over case, extract the conversion between the enums involved into a helper and just call setEasingCurve() with the result (implicitly converted to QEasingCurve). Saves 0.5KiB in text size on optimized AMD64 Linux GCC 9.1 builds. Change-Id: I81b5d7199d9dd99ba3735c910a50e371e0b99838 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | QEasingCurve: remove a default case labelMarc Mutz2019-07-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A default: case label turns off compiler warnings for missing enumeration values, which we'd like to have, so remove it. Change-Id: I96247a7fc46e91a29591a907e52841a90df62f10 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Fix removal of QJsonObject properties when assigning undefinedSimon Hausmann2019-07-301-1/+4
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 8010e906d3612aface0daccde41d1a65fca04b0c accidentally ended up removing the removal-on-undefined-insertion check by calling insertAt instead of insert, which had it. This patch moves the check back into setValueAt. Change-Id: Ic381e284d3da37e31c4eb29f79dfab9c55c2e3e9 Fixes: QTBUG-77204 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QStringView: clean up storage_typeMarc Mutz2019-07-292-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all supported compilers support char16_t, we don't need the storage_type == wchar_t hack for MSVC anymore. Remove it. Adapt docs. Change-Id: I55df6c8a9fa5a9c7e6f53ba89f3850956b369061 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | | qstringalgorithms.h: add pure, noexcept, constexprMarc Mutz2019-07-293-7/+8
| | | | | | | | | | | | | | | | | | | | | ... where they were missing. Change-Id: I58c32e57675b5d5ee500722933ef4a356a679e46 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QStandardPaths: don't build a QHash just to look up one keyMarc Mutz2019-07-291-41/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code parses a file, looking for XDG_*_DIR entries and stores each one's key and raw value in a QHash. After parsing, it, however, looked up exactly once, by a key it could have known all along. So, move the key computation before the opening of the file, and look for the correct key directly, consciously striving to continue to find, as the old code implicitly did, the last entry, since man 5 user-dirs.dirs explains: > The format of user-dirs.dirs is designed to allow direct sourcing of > this file in shell scripts. Which means last one wins. Port to QStringView API of QRegularExpression, too. Change-Id: Ie92b689b5b9221df918c67b96f2f6a09827e7b1e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>