summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QInputMethodEvent::Attribute: add ctor that doesn't take a QVariantMarc Mutz2016-02-204-10/+19
| | | | | | | | | | | Many callers passed QVariant() as the last ctor argument. Micro-optimize by providing an overload that default- constructs the variant in-place. Change-Id: I9aab40c6e5a025c9a502c706e4cc7b10879ac418 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Takao Fujiwara <takao.fujiwara1@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Move __cpp_constexpr check inside Q_COMPILER_CONSTEXPR checkJames McDonnell2016-02-201-10/+12
| | | | | | | | | | | | Q_COMPILER_CONSTEXPR can be undefined (or not defined at all) to indicate that constexpr should not be used regardless of the compiler's ability to support it. This is done for QNX because some C library floating point functions used in the Dinkumware C++ library aren't constexpr functions; i.e., the library doesn't have proper constexpr support even though the compiler does. Change-Id: I16918bbceac1e20b67c6ddbda28df3d9758bab83 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLatin1String: add at()/op[]/mid()/right()/left()Marc Mutz2016-02-193-4/+86
| | | | | | | | | | | | | | | | QLatin1String can be used as a string-view-like type. When attempting to do so in uic, mid() and at() were found to be missing. Added the others for completeness. Use the new functions in uic, for which they were originally conceived. [ChangeLog][QtCore][QLatin1String] Added at(), operator[](), mid(), right(), left(). Change-Id: I4cfe3e9ed1157dedee754b2012d9678fe72b161e Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* uic: optimize string handling in WriteInitialization::acceptWidget()Marc Mutz2016-02-191-20/+22
| | | | | | | | | | | | | | | | | | | | | Instead of building QStringLists out of statically-known US-ASCII strings, use C arrays of QLatin1String instead. QLatin1String is constexpr, so these tables, while causing relocations, do not require runtime initialization. Using QStringBuilder, these QLatin1Strings are almost a drop-in replacement for the QStrings used before. Effects on optimized GCC 5.3 Linux AMD64 builds: $ size bin/uic-* text data bss dec hex filename 567104 31776 56 598936 92398 bin/uic-00-before 565829 31944 24 597797 91f25 bin/uic-01-after Change-Id: I469c62b0e8966731d7ac2fa092f4b4cd8ddb79f1 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.7' into devSimon Hausmann2016-02-1958-1099/+2008
|\ | | | | | | Change-Id: I7bee7df50af3d607a349b68103cd2c67791281fb
| * Windows QPA: Fix warnings as shown by Qt Creator's Clang based code model.Friedemann Kleint2016-02-181-18/+19
| | | | | | | | | | | | | | | | | | Fix warnings in file qwindowswindow.cpp. Remaining part of a refactoring done in the 5.6 branch. Task-number: QTBUG-50804 Change-Id: I4d7b423e0802ac39109c30c0de615664d3ee9216 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * Fix typos in qOverload documentationPeter Kümmel2016-02-171-7/+7
| | | | | | | | | | | | Change-Id: I92f99623f659543934c52961307b0b53c8520948 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QDirModel: replace an inefficient QList with QVectorMarc Mutz2016-02-171-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SavedPersistent is larger than a void*, so holding it in QLists is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by marking it movable and holding it in a QVector instead. Take advantage of rvalue-enabled QVector::push_back(); optimize element construction by using aggregate initialization. Change-Id: I4fd88879aa13e6536d59d164b3c33fbc2fead77f Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * Merge "Merge dev into 5.7" into refs/staging/5.7Oswald Buddenhagen2016-02-1762-257/+479
| |\
| | * Merge dev into 5.7Oswald Buddenhagen2016-02-1762-257/+479
| | |\ | | | | | | | | | | | | Change-Id: I5c60b4d9fd8355ddd49a01e21861f36afbbf889b
| * | | bearer plugins: fix uses of inefficient QListsMarc Mutz2016-02-172-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These types are larger than a void*, so holding them in QLists is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by marking them movable, and holding in a QVector instead. Change-Id: I78774fc78d787241aaadc4f819b6d229e6200f46 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | | QtPrintSupport: convert some index-based into C++11 range-for loopsMarc Mutz2016-02-175-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also reserve a QList in QPrinter::supportedPaperSources(). Change-Id: I94d24b81d7adcad2b28d36efdbef5a8726412f1a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | | QSslSocket (OpenSSL): replace QList<QPair> by QVector<Struct>Marc Mutz2016-02-172-25/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A QList<QPair<int,int>> is one of the most dangerous ones, because it fundamentally changes memory layout, and therefore performance and invariants, when going from 32-bit platforms (array list) to 64-bit (vector-like). Port to QVector instead, which has a consistent design across all platforms. Also port from QPair to a simple struct { code, depth }, because member names such as 'first' and 'second' have no semantic value and make code using them very hard to understand. Change-Id: I86c95d78dbb2e82ec222d6eae8ba11568e3ff0af Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | | QSslSocket (OpenSSL): use QMutexLockerMarc Mutz2016-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... instead of naked QMutex::(un)lock(). Change-Id: I9927e60286231bfc254d99cc88c39301b31df336 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | | QtSql: eradicate remaining Q_FOREACH loopsMarc Mutz2016-02-173-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I86afe7104d506b840130517ae8066588fab2d745 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * | | QOCIDriver: optimize string handling in tables()Marc Mutz2016-02-171-31/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Instead of a QStringList, use a const char 2D array to hold the system user names. Don't remove the current user from that list, skip it duing processing. - Extract Method make_where_clause, optimize it and cache its result. Instead of creating a QStringList and join()ing it at the end (sometimes twice), append to the result QString directly. Reserve the max size of the result string, which is statically known. - Keep the query select statements in QLatin1String. They are only used in QStringBuilder expressions. Change-Id: I0593d2812da671a541d49a6136f3ff3d784c63d5 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | | mimetypes: Declare some types as sharedMarc Mutz2016-02-173-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's private API, so we can. As a consequence, had to add nothrow member-swap and, in QMimeGlobPattern, remove the user-defined empty destructor to un-inhibit the (nothrow) move special member functions. Change-Id: If5bb72db3c823c7b0e372f9bec99c7242d11839b Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | | Remove QMimeMagicRule's pimplMarc Mutz2016-02-172-151/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It didn't make the class implicitly shared, but required an additional heap allocation on construction and copy, as it used 'only' QScopedPointer. As it's private API the pimpl is also not needed for BC reasons. So inline the data members, and some trivial accessors. As a by-product of removing the copy special member functions, we gain nothrow move special member functions. Interestingly, the memory layout of a QList<QMimeMagicRule> (replacing which is the topic of a future patch) doesn't change due to this change, because the type that formerly fit QList very well now is too large. But copying the type outside QList now no longer allocates memory. Saves more than 2.5KiB in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: Ie3588cb5693227da6f1bfa196db924e075a750b3 Reviewed-by: David Faure <david.faure@kdab.com>
| * | | QShortcutMap: re-use an existing bool variableMarc Mutz2016-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... instead of re-evaluating its expression. More readable. Change-Id: I18c6ab3bbc4c5a14328f9910fab991f6cad5549d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * | | QDaemonThread: replace a function pointer with a lambdaMarc Mutz2016-02-171-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Saves around 0.5KiB in text size on optimized GCC 5.3 Linux AMD 64 builds. Change-Id: Iaf2664e670a96136031bac67e4012d4f7324eb47 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | | QDialogButtonBox: replace a QList copy + pop_front() with mid(1)Marc Mutz2016-02-171-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplifies the code and is also more efficient, because it copies less data. Change-Id: I9ad0c372fb4fa6f5818d9d6cb7b7cf35935f8565 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * | | Say hello to Android ServicesBogDan Vatra2016-02-1720-760/+1533
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset enables running a QCoreApplication from within an Android Service. The Android Application running can now have a QtActivity or a QtService, but having both in the same process is not supported. This patch was based on Cory Slep's patch [ChangeLog][Android] Qt can now be used to easily create Android Services. Task-number: QTBUG-37221 Change-Id: I0fd693daaa85b991940ffe9cc41c483022677199 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * | | Disable XCTest support in QtTestLibTor Arne Vestbø2016-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In recent Xcode versions it doesn't work as expected, and caused build failures in downstream modules, so we disable it until the cause can be investigated further. Change-Id: Ie54c7256a10d73610ec7e481b9d665b75e396365 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * | | QStandardItemModel: Reset the flags on clear()Stephen Kelly2016-02-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass modeltest after clear(). Otherwise it fails because more flags than Qt::ItemIsDropEnabled get returned for the QModelIndex(). Change-Id: I8f11515cc7dc9383f528f785312ffb77b3c2699d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | | QDate: mark getDate() as const.Anton Kudryavtsev2016-02-172-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method does not modify the object. Can't change the API, so overload and mark the old function for removal in Qt 6. Change-Id: I4aee2bc19209646adc21388375aedd20a09129d0 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | | Add attribute Qt::AA_DontUseNativeDialogs.Friedemann Kleint2016-02-175-9/+17
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | The attribute can be set to suppress native dialogs for example for testing purposes. Task-number: QTBUG-51074 Change-Id: I35611e07e00b7a060f22b49d6ab6f3b8627f8aca Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
| * | QDateTimeParser: de-duplicate calls and cache resultsAnton Kudryavtsev2016-02-161-19/+26
| | | | | | | | | | | | | | | | | | Change-Id: I2e95456146b6ce646e244e962082f2967bcaed42 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | Improve sql allocated cache reuseEric Lemanissier2016-02-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | This change avoids unnecessary allocation of QSqlCachedResult cache. Change-Id: Ief592ab05b50f5e328490c504af088ec74d1938f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * | Add QStyleHints::setTabFocusBehavior() for testing purposesJ-P Nurmi2016-02-162-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we've been dependent on the focus behavior setting in OS X system preferences. This change allows us to start testing both behaviors on any platform. Change-Id: I9ce004f8b9479f8e722a387b795de16edb166a07 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
| * | Reduce allocations in QSQLiteDriver::open()'s connection options parsingMarc Mutz2016-02-151-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use splitRef() instead of split(), avoiding small temporary QStrings. - Don't remove all spaces before splitting, trim strings at the QStringRef level later, where needed. This will reject nonsense strings like QSQL_ LITE _BUSY_ TI MEOUT= 1 2 3 that were previously (wrongly) accepted. - Use C++11 range-for loop. Change-Id: I875c4cf47b7a283ba55783f70c903bb9947e1cd7 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * | Fix crash when using .NoActionBar theme.BogDan Vatra2016-02-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | m_activity.getActionBar() returns null when a .NoActionBar theme is declared in AndroidManifest.xml file Change-Id: I671891d03913209c3f9f34a6f4dd8894c20de5c2 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
| * | Cache results of multiple render target supportSean Harmer2016-02-141-2/+3
| | | | | | | | | | | | | | | Change-Id: I9e706690d4d2ddaae6c84b0e24de7698704e862d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * | Provide optimised version of QOpenGLFramebufferObject::blitFramebufferSean Harmer2016-02-142-3/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Profiling shows that the call to glGetIntegerv() in this function that queries for the currently bound framebuffer is very expensive. It's the top hit on the CPU when profiling a Qt3D application using a Scene3D Qt Quick 2 item. The reason it is so expensive is that this call forces the OpenGL driver to propagate the OpenGL state through all of the queued commands in order to answer the query. It may also induce a pipeline stall depending upon the driver implementation. As this function gets called on the hot path every frame whenever using a Scene3D item and may also be called in plain Qt Quick when using ShaderEffect items; the layer property of QQuickItem; or when updating the Qt Quick glyph cache texture on Core profile contexts, it is very much worthy of optimization. This commit adds an overload of the blitFramebuffer() call that allows the caller to provide a policy that can either: * keep the existing behavior of restoring the previous framebuffer binding, * restore the default framebuffer, or * don't restore anything and let the caller be responsible for it. This will allow consumers such as Qt Quick and Qt 3D to use the optimised code path. The existing overloads of blitFramebuffer() retain the current behavior by calling with the policy to restore the previous framebuffer binding. Upon making this change, the cost of blitFramebuffer() is massively reduced. A follow up commit will optimize this further. Change-Id: I417abb7da916ae5088f6817e4eff8ea02c8c5803 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | | Factor out usage of a private symbol by the iOS platform plugin.Jake Petroules2016-02-193-5/+11
| |/ |/| | | | | | | | | | | | | This fixes a link error due to symbol visibility when the iOS platform plugin is built as a shared library. Change-Id: I0b454c5c5033c6b598cede11ce5e3a85e5704c4a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Microoptimize QObject::activate.Milian Wolff2016-02-161-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes temporary variables that are not used in all cases. This reduces the instruction count per iteration for the corresponding benchmark by 1 or 2. Before: ********* Start testing of QObjectBenchmark ********* Config: Using QtTest library 5.7.0, Qt 5.7.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.0) PASS : QObjectBenchmark::initTestCase() PASS : QObjectBenchmark::signal_slot_benchmark(simple function) RESULT : QObjectBenchmark::signal_slot_benchmark():"simple function": 21.0065466 instructions per iteration (total: 210,065,466, iterations: 10000000) PASS : QObjectBenchmark::signal_slot_benchmark(single signal/slot) RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/slot": 405.0829559 instructions per iteration (total: 4,050,829,559, iterations: 10000000) PASS : QObjectBenchmark::signal_slot_benchmark(multi signal/slot) RESULT : QObjectBenchmark::signal_slot_benchmark():"multi signal/slot": 405.0812465 instructions per iteration (total: 4,050,812,465, iterations: 10000000) PASS : QObjectBenchmark::signal_slot_benchmark(unconnected signal) RESULT : QObjectBenchmark::signal_slot_benchmark():"unconnected signal": 104.0147348 instructions per iteration (total: 1,040,147,349, iterations: 10000000) PASS : QObjectBenchmark::signal_slot_benchmark(single signal/ptr) RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/ptr": 369.1021099 instructions per iteration (total: 3,691,021,100, iterations: 10000000) PASS : QObjectBenchmark::signal_slot_benchmark(functor) RESULT : QObjectBenchmark::signal_slot_benchmark():"functor": 370.0982862 instructions per iteration (total: 3,700,982,862, iterations: 10000000) PASS : QObjectBenchmark::cleanupTestCase() Totals: 8 passed, 0 failed, 0 skipped, 0 blacklisted, 6036ms ********* Finished testing of QObjectBenchmark ********* After: ********* Start testing of QObjectBenchmark ********* Config: Using QtTest library 5.7.0, Qt 5.7.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.0) PASS : QObjectBenchmark::initTestCase() PASS : QObjectBenchmark::signal_slot_benchmark(simple function) RESULT : QObjectBenchmark::signal_slot_benchmark():"simple function": 21.0061664 instructions per iteration (total: 210,061,664, iterations: 10000000) PASS : QObjectBenchmark::signal_slot_benchmark(single signal/slot) RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/slot": 403.0829161 instructions per iteration (total: 4,030,829,162, iterations: 10000000) PASS : QObjectBenchmark::signal_slot_benchmark(multi signal/slot) RESULT : QObjectBenchmark::signal_slot_benchmark():"multi signal/slot": 403.0836305 instructions per iteration (total: 4,030,836,305, iterations: 10000000) PASS : QObjectBenchmark::signal_slot_benchmark(unconnected signal) RESULT : QObjectBenchmark::signal_slot_benchmark():"unconnected signal": 104.0150038 instructions per iteration (total: 1,040,150,039, iterations: 10000000) PASS : QObjectBenchmark::signal_slot_benchmark(single signal/ptr) RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/ptr": 368.0981987 instructions per iteration (total: 3,680,981,988, iterations: 10000000) PASS : QObjectBenchmark::signal_slot_benchmark(functor) RESULT : QObjectBenchmark::signal_slot_benchmark():"functor": 369.1179429 instructions per iteration (total: 3,691,179,429, iterations: 10000000) PASS : QObjectBenchmark::cleanupTestCase() Totals: 8 passed, 0 failed, 0 skipped, 0 blacklisted, 5975ms ********* Finished testing of QObjectBenchmark ********* Change-Id: Iba3bffbca5b58109816c8b1a7dea0796b18c8785 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Share code between const and non-const QMetaObject::cast variants.Milian Wolff2016-02-161-8/+2
| | | | | | | | | | | | Change-Id: I7aad8e5060bb17ebc04fdb137dad3b6d167895a8 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QIcon::fromTheme(): add support for absolute paths.David Faure2016-02-151-0/+3
| | | | | | | | | | | | | | | | | | This allows methods that return an icon name, to sometimes also return an icon full path (e.g. because the icon was dynamically generated and stored into a local cache on disk) Change-Id: Ib01c3955f4b64236463846241d9814b2d0686634 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QHttpNetworkConnectionPrivate: de-duplicate calls in if-else chainsAnton Kudryavtsev2016-02-151-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and loops. Every QNetworkConfiguration::bearerType() call produces lock/unlock of mutex. Fix: cache result. Every QHttpNetworkRequest::contentLength() call contains internal loop. Fix: cache result. Also cache results of QNonContiguousByteDevice::size() and QHostAddress::protocol(). Change-Id: I01124648b1972f480905433d9b3551c2246e1bde Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Add qOverload to select overloaded functionsPeter Kümmel2016-02-154-0/+132
| | | | | | | | | | | | | | | | [ChangeLog][QtCore][Global] qOverload added to select overloaded functions. Change-Id: I7c9b1b054e6631eca0b5594db59e1202ef552c33 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Use QVector instead of QList for sizeof(T) > sizeof(void*)Sérgio Martins2016-02-143-3/+3
| | | | | | | | | | | | | | | | | | | | caught with static analyzer which only warns for trivial cases: - Container must be local - Container isn't passed to any function, assigned to another container or assigned to. Change-Id: I3f3aa73c128a56f067fa8745990977445a495ac4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Introduce QHash::equal_range()Sérgio Martins2016-02-142-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | Similar to QMap::equal_range(). Will allow to easily fix inefficient code such as: foreach (auto value, hash.values(key)) { ... } [ChangeLog][QtCore][QHash] Added QHash::equal_range() Change-Id: I6e19e25de632e897ad83d3141d9d07f0313f7200 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QtWidgets: use new QRect::transposed()Marc Mutz2016-02-139-14/+11
| | | | | | | | | | | | Change-Id: Idfed0ae6b80e301fd32206b2e6d68054460b76de Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QRect(F): add transposed()Marc Mutz2016-02-132-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | I didn't add a transpose(), because r = r.transposed() is perfectly capable of filling that role, and just as efficient. Existing API mistakes are no excuse to create more of them. [ChangeLog][QtCore][QRect/QRectF] Added transposed(). Change-Id: Ic38721e9028496fc9b50f4d4cef2e7a60532eed8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QRegion: add move ctorMarc Mutz2016-02-132-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | After this change, this was the distribution of calls in QtGui and QtWidgets when the patch was developed for 5.4: QtGui QtWidgets move 23 63 copy 23 36 Change-Id: If3f536e52fc242c585e7fa0662049c0657efcc9c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Use QFlags::setFlag where prudent in qtbaseAndre Somers2016-02-1225-185/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFlags::setFlag is most useful to replace explicit constructs like if (condition) { someFlags |= TheConditionFlag; } else { someFlags &= ~TheConditionFlag; } with someFlags.setFlag(TheConditionFlag, condition); Change-Id: Ie4586681c83e0af812d5bbf14965aad51941a960 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Fix for deferredDelete() bug when calling the glib loop directlyPaolo Angelelli2016-02-126-19/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes sure that all events posted using Qt on top of the GLib event loop have the loopLevel counter incremented. This is done since Qt depends on the fact that all deleteLater() calls are issued within the scope of some signal handler (in other words, triggered by the chain sendEvent() -> notifyInternal2()). There is a side effect though: in the conditions affected by this patch, that is deleteLater()s issued within a glib event handler for example, manually calling processEvents() or sendPostedEvents() with or without the QEvent::DeferredDelete flag has the same effect, and deferred deleted events are always processed. While this is not a currently working feature which the patch breaks, this side effect seems to be difficult to avoid without separating sendPostedEvents() and processEvents() into a public and a private method, in order to detect when they are manually called. Such change could perhaps be done for Qt6. An autotest for QTBUG-36434 is also included. Autotesting for QTBUG-32859 seems to be more challenging in this respect, due to its dependency on GLib. Task-number: QTBUG-18434 Task-number: QTBUG-32859 Task-number: QTBUG-36434 Change-Id: Ib89175aa27c9e38bca68ae254d182b2cd21cf7e9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QTextFrame::iterator: restore nothrow move special membersMarc Mutz2016-02-122-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The user-defined copy assignment and copy constructors inhibit the move special member functions. We cannot do something about it in Qt 5, because the class is exported (which it shouldn't be), and because making it trivially-copyable might change how it is passed to functions by value, so we need to supply all the missing member functions manually. Change-Id: Ic710b449f6abd386449fa6df71e8bc9bd0f98d2b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QXmlStream*: make nothrow move assignable and -constructibleMarc Mutz2016-02-121-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, we cannot rely on Q_DECL_EQ_DEFAULT, so I needed to code the special member functions by hand. The 'reserved' field is pretty useless, since the existing ctors didn't initialize it, but just in case someone finds a way how to store information in there, deal with the field in the usual way: set to nullptr in the move ctor and swap in the move assignment operator. Also schedule all this for removal again come Qt 6 (then without the reserved field). This amends a83be780aecd78bf8b2b76dab722097f74663d74, which only dealt with QXmlStreamAttribute. Change-Id: I6898e5d0423c9519f7c07d23e2c6d2700508151e Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QBitmap: restore nothrow move special membersMarc Mutz2016-02-122-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user-defined dtor inhibits the move special member functions. We cannot do something about it in Qt 5, because the class is exported (which it shouldn't be), and because it's polymorphic (which it also shouldn't be), so we need to supply all the missing member functions manually. Add a note to remove the inheritance from QPixmap in Qt 6. Change-Id: I86a1a3fe7b84247b3e604cb008aa17bb673c8468 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Cocoa integration - suppress excessive dragginUpdated messagesTimur Pocheptsov2016-02-121-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our abstract item views are using a timer before starting autoscroll. Constant dragginUpdated (re)starts this timer again and again and it actually never times out (== no autoscroll). It looks like a bug in Cocoa since 10.11, they test: respondsToSelector:@selector(wantsPeriodicDraggingUpdated:) with ':' at the end, though they need a method without parameters; as a result QTBUG-32761 was re-introduced. Let's make them happy and respond to this selector also (never gets called actually). Change-Id: I3b7bb0a455124f84c97fc350f69486bf0fc5d5fc Task-number: QTBUG-32761 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>