summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Windows QPA: Fix clang warnings about repetitive type namesFriedemann Kleint2019-06-1329-96/+96
| | | | | | | | | | Fix warning like: warning: use auto when initializing with new/reinterpret_cast to avoid duplicating the type name [modernize-use-auto] Change-Id: Ieb7f052919173f6923e68de9f9e849dee45e36e7 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Add VulkanMemoryAllocatorLaszlo Agocs2019-06-126-0/+17242
| | | | | | | | | | | | | | | | | | | | | | | | The Vulkan backend of QRhi relies on vk_mem_alloc.h from AMD in order to get a stable, performant, and tested GPU memory allocator. It is not unthinkable that we will move away from this in the future, especially considering that a potential future D3D12 backend may need a similar solution, but until then this will do. Change-Id: I198a898f216d0795b4bf339ccea80b0cd2efbabc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Introduce the Qt graphics abstraction as private QtGui helpersLaszlo Agocs2019-06-13139-1/+38489
| | | | | | | | | | | | | | | | | | | | | | Comes with backends for Vulkan, Metal, Direct3D 11.1, and OpenGL (ES). All APIs are private for now. Shader conditioning (i.e. generating a QRhiShader in memory or on disk from some shader source code) is done via the tools and APIs provided by qt-labs/qtshadertools. The OpenGL support follows the cross-platform tradition of requiring ES 2.0 only, while optionally using some (ES) 3.x features. It can operate in core profile contexts as well. Task-number: QTBUG-70287 Change-Id: I246f2e36d562e404012c05db2aa72487108aa7cc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Avoid uninitialized texture data in image glyph cacheLaszlo Agocs2019-05-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem becomes visible with styled native text materials in Quick, but only in certain cases: the regions not used by glyphs in the QImage are undefined (if they are 0 there's no problem) - but the whole code path is only used when the fbo readback workaround is enabled. When these conditions met, the styled text materials may sample locations with uninitialized data in the texture, showing small artifacts around the glyphs when shifting is involved in the styling. The non-image based GL glyph cache handles this by an explicit upload with all 0's when creating the texture - the QImage code path should do the same then. Change-Id: I818ee19f87c6a147e42cd3ead39645da4d0fef11 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix parallel lex/yacc invocation for debug_and_release buildsJoerg Bornemann2019-06-063-40/+71
| | | | | | | | | | | | | | | | [ChangeLog][qmake] Introduced the variables LEX_DIR and YACC_DIR which determine the location of lex/yacc output. Fixed parallel execution of lex/yacc for debug_and_release builds. Fixes: QTBUG-65730 Change-Id: I68c8260a95609e11bb5205a91aff2c098ed7009c Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* De-duplicate elements of QMAKE_DIR_REPLACE[_SANE]Joerg Bornemann2019-06-061-1/+1
| | | | | | | | | | | | | | Elements that appear in QMAKE_DIR_REPLACE_SANE must appear in QMAKE_DIR_REPLACE to be considered due to the algorithm used in exclusive_builds_post.prf. Change-Id: Ibce7e6c988b3e8a141075890a2f547eb34090b3a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove a few usages of deprecated APIShawn Rutledge2019-06-134-4/+7
| | | | | | Change-Id: I94bad0b8d3891c6b4a55178836cfff2a4312e330 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* tests: remove the last uses of Java-style iteratorsMarc Mutz2019-06-136-34/+23
| | | | | | | | | | | ... except where they are actually the component under test. Java-style iterators are scheduled for deprecation. Change-Id: If4399f7f74c5ffc0f7e65205e422edfa1d908ee8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove the last uses of Java-style iterators in QtCoreMarc Mutz2019-05-232-12/+11
| | | | | | | | | | | | | | | | | | | | They are going to be deprecated. Add a strategic break. This was a pre-existing problem: the comment claims that h is invalid (though I personally don't see it), but then goes on to check the loop condition (which, in the mutable Java iterator case, involves calling h.cend()). We now cache the end iterator, so if there ever was a problem, it's probably a lesser one now, but it's still not kosher, and a debug version of QHash would find it, so break out explicitly. Saves ~200b in text size on optimized GCC 9.1 Linux AMD64 builds, ie. ~100b per loop. Change-Id: I7684485b55fb23a8cf882f89621ebb75a0e607b5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QDebug: add nothrow move special member functionsMarc Mutz2019-06-062-23/+22
| | | | | | | | | | | | | | | | | | This requires making QDebugStateSaver hold QDebug::Stream directly, not QDebug by reference, as the referenced object will have been moved from when ~QDebugStateSaver executes. The stream object, however, will still be around. Change-Id: I0ca2eb60cb9b68ea3835d9a9ff5e295d9b1c5fb5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Use QSaveFile in MainWindow examplesFriedemann Kleint2019-06-124-35/+60
| | | | | | | | | | | | | | | | | QSaveFile should preferably be used by editor applications to catch write errors. Task-number: QTBUG-60635 Change-Id: Ia609435871b56b45714c3dd3d32bbc85b5cb4dd5 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QEvdev: use printf-style qCDebug()/qWarning()Marc Mutz2019-06-117-51/+52
| | | | | | | | | | | | | Also use qUtf16Printable() and qErrnoWarning (removing explicit errno, where present). Saves 6.6KiB in text size on optimized Linux AMD64 GCC 9.1 build across all .so's that link to QtInputSupport.a. Change-Id: I1def2cfabd2eed65390099cd1d06f8061a9355be Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* SecureUDPServer example: use std::unique_ptr instead of QSharedPointerMarc Mutz2019-05-152-16/+15
| | | | | | | | | | | | | | | | The only reason the code used QSharedPointer is that it used QVector to hold a collection of them, and QVector infamously cannot hold move-only types such as std::unique_ptr. Fix by using std::vector<std::unique_ptr> instead. Also, pass the objeccts into non-sink functions by raw pointer instead of shared_ptr. As a drive-by, replace clear-following-iterate by the for-exchanged pattern. Change-Id: I605fbb98af840c1b93eab9e65c07defd6e7b39e1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Make QColor a literal typeGiuseppe D'Angelo2019-06-122-22/+27
| | | | | | | | | | | | | | | | | | Extracted from the SVG names patch. It basically just requires adding a constexpr constructor to the inner union, then sprinkling constexpr on the existing ones. Do minor refactorings as drive-by. Change-Id: I60e7a1c9068def3507cb07440450e51673269f84 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* rcc: Avoid needless use of macrohjk2019-05-282-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strlen on literals gets typically optimized out nowadays. Adjust callee side to handle the off-by-one between sizeof(literal) and strlen(). Change-Id: I1551f69a160922681d66024701ba1bd8f6dc03bf Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QWeakPointer: use an alternative work-round for internalData() usersMarc Mutz2019-06-113-13/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous work-around fails, probably because of cross-dependencies. E.g. we have this in QtScXml: In file included from /home/qt/work/install/include/QtCore/qsharedpointer.h:48:0, from ../../src/scxml/qscxmltabledata_p.h:55, from ../../src/scxml/qscxmltabledata.cpp:40: /home/qt/work/install/include/QtCore/qsharedpointer_impl.h:687:12: error: ‘QPointer’ does not name a type; did you mean ‘pointer’? friend QPointer<X> ^~~~~~~~ pointer /home/qt/work/install/include/QtCore/qsharedpointer_impl.h:689:23: error: ‘QSmartPointerConvertFunctor’ in namespace ‘QtPrivate’ does not name a template type friend QtPrivate::QSmartPointerConvertFunctor<QWeakPointer>; ^~~~~~~~~~~~~~~~~~~~~~~~~~~ To fix, grand friendship only to a non-template class with a templated static method that returns internalData(). This fixes most users, except in qmetatype.h, which does not include qsharedpointer.h. In order to use the non-template class in there, we need to delay its name lookup to instantiation time. We do this by artificially making it a dependent name, by using a class template that inherits from our befrieded class. Change-Id: I12b427f1fe9503df819ea5436d780972d6402e68 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* QMetaType: fix an is_pod test that C++11 brokeMarc Mutz2019-06-121-7/+1
| | | | | | | | | | | | | | | | C++11 allows non-POD-types in unions, so the test didn't test anything. Use a static_assert over std::is_pod instead. Change-Id: Ida7ef0551ae6ae07357a987a409294d2a386be2f Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Q_ARRAY_LITERAL: fix the checks on the payload's datatypeGiuseppe D'Angelo2019-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The check was a misnomer -- non-POD types can go in unions since C++11. And we may want them, e.g. types without a trivial default constructor. What we really want is to check for a literal type (so that the array payload can be built entirely at compile time, and put in .rodata). So, amend the check. Also, make the dummy array constexpr, to be sure that we are indeed building the payload using constexpr constructors. That would make the first check redundant, but the fact that we're still using a macro for constexpr makes me think that not all compilers support it, so I'm leaving the first check in... Change-Id: I9f1473aa74dff5b6b6535ae4cd8325451c0b18e6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QAtomic: introduce loadRelaxed() / storeRelaxed()Giuseppe D'Angelo2019-06-105-20/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Plain load() / store() have already relaxed semantics. This can be surprising -- std::atomic::load()/store() are actually sequentially consistent -- and introduce a pain point if someone wants to move from Qt atomics to std:: atomics. So just add a suffix to the functions to clarify what's the memory ordering involved with them. The Ops::load / ::store are temporarily left in, because other modules depends on them. We need to port those modules away, then they can go (it's private API anyhow). Similarly, not deprecating anything yet, except for marking obsolete in the docs; there's a lot of code around using load() / store() that needs to be ported first. [ChangeLog][QtCore][QAtomicInteger] Added loadRelaxed() and storeRelaxed(), to be used as replacements of load() / store(). [ChangeLog][QtCore][QAtomicPointer] Added loadRelaxed() and storeRelaxed(), to be used as replacements of load() / store(). Change-Id: Iab0a78885050379e3740f0b039ba2bef28ce3bd2 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rtems: Enable Thread local storage supportMikhail Svetkin2019-06-061-0/+3
| | | | | | | | | | | Change-Id: If2ecf440fda9270688be60273e57d4b765bbdec2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rearrange date parsing in anticipation of calendar workEdward Welbourne2019-06-071-34/+29
| | | | | | | | | | | | | The calendar APIs shall need fromShortMonthName() to know its year number; so rearrange the date parsing that uses it to ensure the year number is known in time. In the process, pass &ok to toInt() also for the calls that get a day number (where failure's 0 return is an adequate check for failed parse), just to be on the safe side. Change-Id: Id09c40da9f7e70e68be440e9805a3d30a80977c6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move away from using 0 as a pointer constantAllan Sandfeld Jensen2019-06-0760-490/+502
| | | | | | | | | Cleans up most of corelib to use nullptr or default enums where appropriate. Change-Id: Ifcaac14ecdaaee730f87f10941db3ce407d71ef9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Enable warnings_are_errors builds for MSVC 2017Allan Sandfeld Jensen2019-06-071-2/+2
| | | | | | | | Also remove it from versions no longer supported. Change-Id: I03a911a349527a81846e1820f95d775fe3943450 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qtlite: Fix build with -no-feature-texthtmlparserMikhail Svetkin2019-06-111-1/+1
| | | | | | Change-Id: I3ffd4612884f57c2d0ff8e9c9c10d0805dd72f6f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* rtems: Fix detection bad file descriptorMikhail Svetkin2019-06-051-0/+9
| | | | | | | | | | | | | | | | | | | RTEMS does not support poll/select and etc for files and fcntl(fd, F_GETFD) can not say that. Change-Id: If5ad160cd81e347fac72d2bafcb5b5bb815ed059 Reviewed-by: Ryan Chu <ryan.chu@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use insert instead of insertMulti when operating on a QMultiHashLars Knoll2018-12-032-2/+2
| | | | | | | Change-Id: I96ebf6954d0a137f9f6f9632cdad6e18750519fe Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Brush up tst_QUrlFriedemann Kleint2019-06-111-7/+8
| | | | | | | | | | Fix clang-tidy warnings: - Use range-based for and streamline some code - Use nullptr Change-Id: Iad43490d0e968baa76d54d3bf81558a48b19cdbd Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
* Deprecate QLatin1LiteralGiuseppe D'Angelo2019-06-101-1/+3
| | | | | | | | | | | | | | It's an undocumented typedef for QLatin1String. [ChangeLog][QtCore][QLatin1Literal] The undocumented QLatin1Literal type alias for QLatin1String is now deprecated. Use QLatin1String instead. Change-Id: I05eba8b857454e59b9b9d7b07c42fe6fc9c77fec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix Vulkan yes OpenGL no buildsLaszlo Agocs2019-06-112-0/+4
| | | | | | | | | | | | | | | The format conversion relies on the QOpenGLTexture header that has its body ifdefed out with -no-opengl. However, Qt, in a very forward looking manner, allows having Vulkan support even when OpenGL is disabled. Assuming that the format conversion will not be used in -no-opengl builds, put the entire function inside a #if QT_CONFIG(opengl). Change-Id: I772e12129729d69b81159669d239ea3945a42e5a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Remove QLatin1Literal usagesGiuseppe D'Angelo2019-06-1013-65/+65
| | | | | | | | | | | | | That's an undocumented Qt 4/3/2 remnant, start remove usages. Fix incorrect include header in qclass_lib_map.h as a drive-by. Change-Id: I939be2621bc03e5c75f7e3f152546d3af6d37b91 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rtems: Disable fork feature and fix compilation in corelib/ioMikhail Svetkin2019-06-063-3/+8
| | | | | | | | | | | | | | | | RTEMS does not support fork. RTEMS has LOCK_EX and LOCK_NB defines but does not have flock. Change-Id: I2b1774435bc972f53596f4163ec410b9d22aca4a Reviewed-by: Ryan Chu <ryan.chu@qt.io>
* Simplify {to,from}Std{List,Vector}Giuseppe D'Angelo2019-06-102-12/+5
| | | | | | | | | Use the newly-added range constructors. Change-Id: I7f1d2699d88656fb7dddd11a9d781d810d45b0b4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix deprecation warningsChristian Ehrlicher2019-05-271-55/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix deprecation warnings - replace qFindChild/Children() with QObject::findChild/Children() and replace some 0 with nullptr. Change-Id: If2f01d12fa91d09d98a61f73b0449a6773ac93db Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QInputDeviceManager: replace a QMap<enum,int> with a ↵Marc Mutz2019-06-063-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::array<int,#enum-values> QInputDeviceManager::DeviceType is a (non-flag) enum with all of five values. Using a self-rebalancing rb-tree to map these to an int is overkill. An array can do the job just as well and better, given the enum values are consecutive, and even if some don't make sense (like Unknown), the waste caused by unused array slots is more than compensated by the lack of any memory allocations. Even more so as the array API is 1:1 identical with the map's for the use-case at hand. Saves 1.2KiB in text size on optimized Linux AMD64 GCC 9.1 builds. Change-Id: I1bfa115ac75e2f7d9a4bd9a0e3f3241bf68c9989 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix a minor grammar glitch in new string / byte-array doc noteEdward Welbourne2019-06-042-2/+2
| | | | | | | | | | | | | | | | Amends 8845caa057cfcf54f7d46621adb3393c13747ffb. Change-Id: I4bf09b9c1fff52815de58070fbe4ff0c08eff53f Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDistanceField: add missing copy assignment operatorMarc Mutz2019-06-062-0/+4
| | | | | | | | | | | | | | As found by GCC, while compiling qt5/qttools/src/distancefieldgenerator/mainwindow.cpp. Change-Id: I155c0b8b09bd12c12af0bd69e19747485be960e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rtems: Disable sys/sem.h includeMikhail Svetkin2019-06-061-1/+1
| | | | | | | | | | | | RTEMS does not have sys/sem.h Change-Id: I9fe5c5244a4205521493885b39fa0051abcc4539 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rtems: Fix build sha3 (undef ALIGN)Mikhail Svetkin2019-06-061-0/+4
| | | | | | | | | | ALIGN macro exists in RTEMS system headers and in sha3 library. Change-Id: I00cbb5be5598a6a6ca1f011f199da62d658ef9d5 Reviewed-by: Ryan Chu <ryan.chu@qt.io>
* QLatin1Char: add comparison operators with charMarc Mutz2019-06-031-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | When QT_NO_CAST_FROM_ASCII is in effect, `char == QLatinChar` no longer compiles, because the QChar(char) ctor has become private. Fix by supplying the missing mixed-type operators. [ChangeLog][QtCore][QLatin1Char] Comparison against char now works even in QT_NO_CAST_FROM_ASCII builds. Change-Id: I86f5ec8e2ddfcda72f5928086cb298bd00b42544 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix deprecation warnings in tst_QUrlFriedemann Kleint2019-05-291-71/+58
| | | | | | | | | | | | | | | | | Change-Id: I8b1877c57d0bd061908d83c0feacfb4a4d4c3868 Reviewed-by: David Faure <david.faure@kdab.com>
* Windows QPA: Fix clang warnings about using typedefFriedemann Kleint2019-05-249-17/+17
| | | | | | | | | | | | | | | | | | | | | | | Replace by using (except for function pointers). Change-Id: I0dfe03c22f9f87155003d13a6376381623df7217 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* vulkan: Add debug message filteringLaszlo Agocs2019-05-286-5/+72
| | | | | | | | | | | | | | | | [ChangeLog][QtGui] Added support for filtering Vulkan debug messages in QVulkanInstance. This is especially useful for processing or suppressing messages from the validation layers. Change-Id: Idf0d7889085948daf5b1a53d2a9b11081e967609 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Separate out the time, zone, date code from corelib/tools/Edward Welbourne2019-06-0650-45/+59
| | | | | | | | | | We'll be adding calendar code here as well, and tools/ was getting rather crowded, so it looks like time to move out a reasonably coherent sub-bundle of it all. Change-Id: I7e8030f38c31aa307f519dd918a43fc44baa6aa1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix warnings & deprs in tst_qcoreapplication and tst_qguiapplicationShawn Rutledge2019-06-053-26/+27
| | | | | | | | | | | | | | | | | | | | | | It's perhaps best to ensure that functions we are deprecating shall no longer be used in tests. Also, fix the "0 as nullptr" warnings. Change-Id: I2f22c9b9482e80fa120bcd728ec269198a36678f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QTextMarkdownWriter: write fenced code blocks with language declarationShawn Rutledge2019-06-049-26/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MD4C now makes it possible to detect indented and fenced code blocks: https://github.com/mity/md4c/issues/81 Fenced code blocks have the advantages of being easier to write by hand, and having an "info string" following the opening fence, which is commonly used to declare the language. Also, the HTML parser now recognizes tags of the form <pre class="language-foo"> which is one convention for declaring the programming language (as opposed to human language, for which the lang attribute would be used): https://stackoverflow.com/questions/5134242/semantics-standards-and-using-the-lang-attribute-for-source-code-in-markup So it's possible to read HTML and write markdown without losing this information. It's also possible to read markdown with any type of code block: fenced with ``` or ~~~, or indented, and rewrite it the same way. Change-Id: I33c2bf7d7b66c8f3ba5bdd41ab32572f09349c47 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Do not "fixify" the content of extra compiler input variables twiceJoerg Bornemann2019-06-041-1/+0
| | | | | | | | | | | | | | | | | MakefileGenerator::initOutPaths should only do that: init out paths. It's not supposed to modify the content of input variables for extra compilers. Those get "fixed" in MakefileGenerator::init below the "do the path fixifying" comment. The first "fixifying" would turn an absolute path in SOURCES (input variable for the moc_source extra compiler) into a path relative to the output directory. The second "fixifying" would mess everything up. Fixes: QTBUG-76097 Change-Id: I8c50ef33d097dba4a1db76144c70b0677beffb6c Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QGestureManager: clean up cleanupCachedGestures()Marc Mutz2019-06-041-22/+18
| | | | | | | | | | | | | | | | | | | | | | | | | - use logarithmic QMap::find() instead of iterate-and-compare-with-key (linear) - don't convert a QList to a QSet just to use QSet -=, just iterate over QSet::remove(): QSet::subtract() doesn't do anything more fancy, either (saves memory allocations) - replace Q_FOREACH with ranged-for, avoid copies Change-Id: I451f034767b079efa9ee19e2c1fe7dc4af2d9bea Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QSharedNetworkSessionManager: clean upMarc Mutz2019-05-282-23/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | Under no circumstance must Qt code define a non-public qHash() overload of a public Qt type. If you can't provide a public qHash() for the type, you can't use QHash. Period. This is because if we don't provide a qHash() function, the user will have to provide one, and then we have an ODR violation, iow: UB. So, port away from QHash and qHash and use std::unordered_map, which allows to pass a custom hash function - just what we needed. Also fix other issues of the code: - Use a function object as the deleter of the QSharedPointer, to allow inlining the function call. - Avoid double lookup in case of a cache miss. - Don't use direct initialization syntax for pointer variables. That's just ... weird. Change-Id: Ica8bff728c1bd1cbb2fb43aa03a99bcb7ac2f7cc Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QFile: fix coding style violationMarc Mutz2019-06-021-1/+2
| | | | | | | | | | | | | | | | | | Amends dd8131e3b25a4ac60eb55022b69b374f0b9a476c. Change-Id: Ic7d440816ee7bada49740f15919e404860dd8ac7 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix definition of QT_DEPRECATED_SINCEKai Koehne2019-06-041-1/+1
| | | | | | | | | | | | Otherwise any use of QT_DEPRECATED_SINCE will cause a warning: src/corelib/global/qglobal.h:382:77: error: expected unqualified-id before ‘)’ token This amends 220028d37c Change-Id: Ifa2be1dd8852e4aac0db83b0b4ae15d2f666c550 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>