summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* QCommandLineOption: Q_DECL_NOTHROW -> Q_DECL_NOEXCEPTMarc Mutz2015-06-281-1/+1
| | | | | | | | | | In IsInvalidName::operator(), marked as _NOTHROW, we're calling qWarning(), which, of course, _can_ throw. We don't care in that case, but then we musn't use _NOTHROW, which causes UB on MSVC, but _NOEXCEPT, which causes std::terminate to be called. Change-Id: I18f74546ea3b388495fdb173d3abd9a162fb78a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSqlIndex: replace QList<bool> with QVector<bool>Marc Mutz2015-06-282-1/+7
| | | | | | | | | | | | | | | | | QList<bool> uses from 400% (32-bit platforms) to 800% (64-bit) more per-element memory than QVector<bool>. This change is binary compatible, since QList and QVector have the same size, and the QList field was not referenced from inline functions. This includes all relevant special member functions, since they are all out-of-line (and move assignment and move constructor are disabled by used-defined copy assignment and copy constructors, resp.). The header is unchanged from Qt 5.0, so there were also no past inline users of the member. Change-Id: I3a94ddc73a4f388031dfd4fce3fedccc507a39c7 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Also add support for linked OpenSSL without SSL v2 & v3 supportDaniel Molkentin2015-06-282-0/+20
| | | | | | | | So far, this was only supported for dlopen mode. This adds symmetric defines for the linking case. Change-Id: I9cbfa18e04d041dde0cbd833929782cada9eb812 Reviewed-by: Richard J. Moore <rich@kde.org>
* tst_formlayout: Fix top level widget leaks.Friedemann Kleint2015-06-271-198/+189
| | | | | | | | | | | Instantiate widgets on stack and add cleanup function for the check. Change all functions instantiating a QFormLayout without widget on the stack to use a toplevel widget and pointer variables since otherwise, the labels automatically created by a call like QFormLayout::addRow("bla", widget) leak. Change-Id: I72a7a9c3175b5793a9450c6fcb970012ccd2274b Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* tst_qboxlayout: Fix top level widget leaks.Friedemann Kleint2015-06-271-63/+36
| | | | | | | | Instantiate widgets on stack and add cleanup function for the check. Change-Id: Ia527c228f9173d1b5aeba94ba4e14e1beba60731 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* tst_gridlayout: Fix visible top level widget leaks.Friedemann Kleint2015-06-271-85/+75
| | | | | | | | | | | | | | | | | Gather member variables testWidget, testLayout, w1..w3 and sp used in getItemPosition() and itemAtPosition() in Helper class ItemTestWidget. Remove member variables m_grid, m_toplevel and instantiate the top level widget on the stack in minMaxSize(). Remove empty slots and functions. Add a cleanup() test checking that no visible top levels are leaked with explanatory comment about data driven tests. Change-Id: Ia30120d78144dab3b7c73864c6fbcef606cb19d3 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* QSharedPointer: destroy LHS on move assignmentMarc Mutz2015-06-271-1/+2
| | | | | | | | | | | | | | | | | Howard Hinnant is right: just swapping may keep a resource alive too long. The problem with replacing swap(other) was that the naïve approach: clear(); swap(other); is not safe for self-assignment. Taking a cue from the default std::swap() implementation, and the copy-swap idiom, a self-assignment-safe version is QSharedPointer moved(std::move(other)); swap(moved); which is to what I changed the implementation now. Change-Id: I589fdae50ae22b95350db8250b02d983dc8487a6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* network: Use QList::reserve(), reduces reallocations.Sérgio Martins2015-06-274-3/+11
| | | | | | Change-Id: Ie0e8cbd28802826206d7e92584b5d56bb844fb09 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Use QList::reserve(), reduces reallocationsSérgio Martins2015-06-2712-12/+38
| | | | | Change-Id: I9f218bdd65a97ad9c867b695f3ba27ab64a54d2a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QList: Introduce constFirst() and constEnd()Sérgio Martins2015-06-273-2/+160
| | | | | | | | | | Allows to easily prevent detaching in common code like: getList().first() [ChangeLog][QtCore][QList] Added the convenience constFirst and constLast functions. Task-number: QTBUG-46026 Change-Id: I51ecb51fe91fc7d993ad35b5c7392f4da88e5f7b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add support for driver_description and os.release in GPU blacklistsLaszlo Agocs2015-06-265-38/+142
| | | | | | | | | | | | | | | | | | | | os.version is the kernel version which is just not very useful or easy to use for us. Instead, introduce a string that allows easy differentiation between Windows 7 and 8. From the adapter identifier the driver description is often helpful too, especially in virtual machines. These allow writing rules like: { "description": "Use WARP in some Win 8 and 8.1 VMs", "os": { "type": "win", "release": [ "8", "8.1" ] }, "driver_description": "VMware SVGA 3D", "features": [ "disable_desktopgl", "disable_d3d9", "disable_d3d11" ] } Change-Id: I196f6b44d7bb9e42ef47f61f4c28d8aa79afb7c4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QSortFilterProxyModel: Keep invalid index updated on source model sortDaiwei Li2015-06-252-0/+48
| | | | | | | | | | | If we have a filter applied that removes all entries, the source model is sorted, and then we remove the filter, QSortFilterProxyModel never emits rowsInserted. This is because it doesn't have the correct source mapping and doesn't update when the filter is removed. Change-Id: I447b2d150e509b128d27f4dabc4e081ca4ef037f Task-number: QTBUG-46282 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Micro-optimize QKeySequence datastream operator (I)Marc Mutz2015-06-241-8/+7
| | | | | | | | | Instead of creating a QList with the keys with one of two statically known sizes, stream the contents itself. Apart from QDataStream, this no longer allocates any memory. Change-Id: I5ed814b186dcaf8cc7dedcc520928aefab01f009 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStateMachine: remove unused qHash(QPointer<T>)Marc Mutz2015-06-241-4/+0
| | | | | Change-Id: Idae3621d1a3cb961e2d46fd58208829651382c11 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QMdiArea: don't hold QPointers in QListMarc Mutz2015-06-241-2/+2
| | | | | | | | | | | QPointer is larger than a void*, so holding them in a QList 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. Change-Id: I3cdd4914658b6fe025ad379007502b4223e126cd Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QPicture: don't hold images in QListMarc Mutz2015-06-241-1/+1
| | | | | | | | | | | QImage is larger than a void*, so holding them in a QList 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. Change-Id: I153995d691692f7317cab31b95a00d679f31c0af Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QPicture: don't hold pixmaps in QListMarc Mutz2015-06-241-1/+2
| | | | | | | | | | | QPixmap is larger than a void*, so holding them in a QList 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. Change-Id: I82bb9a88e7030e566f39421cd78babcf01bce285 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QZip*: mark various types movable and primitiveMarc Mutz2015-06-242-0/+10
| | | | | | | | ... even if they are not (currently) held in Qt containers (though FileInfo is). Change-Id: Id14d4af89fed8bcefdbb9b28d11c1c43fccf7190 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QtGui: don't hold QPainterPath in QListMarc Mutz2015-06-242-4/+4
| | | | | | | | | | QPainterPath isn't marked movable , so holding them in a QList 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. Change-Id: Id4dae8037401c52fd57a2274e45399a9b70beb69 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QAbstractTransition: don't hold QPointers in QListMarc Mutz2015-06-243-3/+4
| | | | | | | | | | QPointer is larger than a void*, so holding them in a QList 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. Change-Id: I52e83a26eda06fb9826e9c4773a7a0b84b0f59c7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QMacStyle: replace a QSet<QPointer> with QVector<QPointer>Marc Mutz2015-06-242-10/+5
| | | | | | | | | | | | | | Holding a mutable item in a QSet violates QSet invariants, namely that in bucket N, all items have hash % size == N. If a value gets reset to nullptr by external means, that invariant no longer holds. The code works by pure luck. Replace the set with a vector, which doesn't care whether elements change under the hood, and will also outperform the typical QSet use due to better locality of reference. Change-Id: Ied7940e82525fd0da9f74dfb0bc36a320b45d172 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* tst_qzip: remove unused init()/cleanup() functionsMarc Mutz2015-06-241-11/+0
| | | | | Change-Id: I3502e8e20a4496051554dc6fb92ea9bd347cc0f7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* widgets: Use QList::reserve(), reduces reallocations.Sérgio Martins2015-06-2317-41/+117
| | | | | Change-Id: I49cc03f365c77f142f62c8e77505ec09723a44d9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* dbus: Use QList::reserve(), reduces reallocations.Sérgio Martins2015-06-233-2/+10
| | | | | | Change-Id: I5d60220c4d3014067a45a3d3553f0523c9fc7c74 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace QVERIFY with QCOMPARE in QRingBuffer autotestAlex Trotsenko2015-06-231-23/+23
| | | | | | | | Gives more information to user in case of failure. Also, fix the order of parameters for some QCOMPARE's. Change-Id: I3ea91f9602d4d32ac79027b6093caea749633c01 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "Handle context loss in window surface creation too"Laszlo Agocs2015-06-231-2/+1
| | | | | | | | | | This reverts commit e4f5278a4f308297bdcf12c04c8b4600a1294ef7. Revert this for now until we figure out what exactly is needed for the Windows 7 CI virtual machines. Change-Id: Ibd5578eac1d172785fac5e94c4c5c7508f8ddb79 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Revert "windows: Disable D3D9/11 with ANGLE in VMs"Laszlo Agocs2015-06-236-45/+5
| | | | | | | | | | | | This reverts commit a6000e2b6679d91c9dab44e49b485de6816372bc. Temporarily remove this to unblock the qtdeclarative dev CI. While Windows 8 VMs are fixed by this patch, Windows 7 has different problems. Change-Id: I45ef064ed953cc4b7bbf19657300d4fc43d82452 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QTextureGlyphCache: add some qMove()Marc Mutz2015-06-221-2/+2
| | | | | | Change-Id: I1965f4de0f1bf9efdb15d07142f882897e163cc5 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Force Visual C++ math.h to define the M_ constantsThiago Macieira2015-06-221-0/+10
| | | | | | | | | | | | | | | That header defines those constants outside of the math.h include guard, so if someone #define'd _USE_MATH_DEFINES and #include'd math.h later, they would get VC++ warnings about constants like M_PI being redefined with different values (ours have parentheses, VS2010's math.h don't). Instead, let's define _USE_MATH_DEFINES ourselves so we get the M_* macros from math.h. That way, we won't redefine them outselves. Task-number: QTBUG-45935 Change-Id: Idf715b895bac4d56b4afffff13db2c98ba8345c2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Replace #ifdefs with qmake feature checks.Ulf Hermann2015-06-2234-110/+14
| | | | | | | | This prevents the building of dysfunctional plugins that don't define a loader function, or won't compile at all. Change-Id: Ib62edb8db4a8917effa05292cb702bb4022f552c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Don't try to resolve symbols for xcb if QT_NO_LIBRARY is setUlf Hermann2015-06-223-6/+8
| | | | | Change-Id: I4bd5d8534abd9a585a4a641d01931de687eeae77 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Define openssl symbol resolution warning function only if necessaryUlf Hermann2015-06-221-0/+3
| | | | | | | | Without library support we don't try to load any symbols and the function is unused. This results in a compiler warning. Change-Id: I82ad46a478debe48cf9a8311f5e5ec299baa1af8 Reviewed-by: Richard J. Moore <rich@kde.org>
* gui: Add several QList::reserve() calls.Sérgio Martins2015-06-2217-16/+40
| | | | | | | Reduces reallocations. Change-Id: I0db16726f413a67b76a73fabd013f910ab5f5109 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QMap: use constrained templates instead of static-ifsMarc Mutz2015-06-221-29/+25
| | | | | | | | | Avoids warnings about constant expressions in ifs. Task-number: QTBUG-46649 Change-Id: I56adf8e80091330d2e97327df7751e57411fbd70 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* doc: Fix qdoc errors in qstring.cppMartin Smith2015-06-221-3/+3
| | | | | | | | Fixed a few qdoc errors. Change-Id: I9ede1c1d3b22e9613978e31722c8140ae966194e Task-number: QTBUG-46796 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* doc: Add missing comment delimiterMartin Smith2015-06-221-0/+1
| | | | | | | | | This prevents qdoc from getting lost and reporting extraneous errors. Change-Id: I8edf11dec67c39d7aa314fe6748acf6df4e646c8 Task-number: QTBUG-46794 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* Export gamma setting and metadata in QImageReaderAllan Sandfeld Jensen2015-06-223-9/+49
| | | | | | | | | | | | The PNG image plugin has the capability of applying gamma correction to read PNGs, but doesn't do so by default, and we export no way of accessing this through the qimagereader API. This patch adds the ability to read the PNG file gamma, and overriding decoded gamma to get gamma correction. Change-Id: Iaf9eaac0827516db6bc02247c58026270cd1f610 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Core: Fix QProcess::errorString() outputKai Koehne2015-06-221-0/+1
| | | | | | | | Fix regression introduced in commit 5147f73ac301d. Change-Id: I336e13d5127c5e6e2f9e7afdfa7956fc89533766 Reviewed-by: Marcel Krems <m.krems@software-vision.eu> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Handle context loss in window surface creation tooLaszlo Agocs2015-06-221-1/+2
| | | | | | | | | | While this is not what the EGL spec says, we can get EGL_CONTEXT_LOST in eglCreateWindowSurface too with ANGLE. Handle it the same way like we do for eglMakeCurrent and eglSwapBuffers (no warning, just return the error code silently since we may recover from this). Change-Id: I6b6c57ffd4fca23e1a14a90ef7b18b33f4c96fd2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QIcon: don't use a QList<QImage>Marc Mutz2015-06-221-2/+2
| | | | | | | | | | | QImage is larger than a void*, so holding them in a QList is needlessly inefficient. Use QVector instead. Change-Id: Ifcc9eca18a87e29327586506e3a3bb7874c8b3a7 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QTextDocumentLayout: don't hold QPointers in QListMarc Mutz2015-06-221-1/+1
| | | | | | | | | | | QPointer is larger than a void*, so holding them in a QList 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. Change-Id: I104d11cc530c9c1579e82bf4e28e3353c00b34b4 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* qdoc: mark Location::StackEntry as movable and Location as complexMarc Mutz2015-06-221-0/+3
| | | | | | | | | Location is self-referential, so explicitly mark it as Q_COMPLEX_TYPE. Location::StackEntry is held in QVector, by way of QStack. Change-Id: I4d9001b55b86f0387ae41b93da17d06fb2857ee4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* QtIcoHandler: don't hold images in QListMarc Mutz2015-06-221-7/+9
| | | | | | | | | | | | | QImage is larger than a void*, so holding them in a QList 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. Also added a reserve() call. Change-Id: I36388f2efbc6ca025f123c30bc7f1dd312bf4ab2 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* qdoc: don't hold Location in QLists, don't even copy itMarc Mutz2015-06-221-5/+2
| | | | | | | | | | | | Location is a self-referential type that is very expensive to copy. So don't. Instead, just remember the iterator, and use value()->location() (which returns a reference, so doesn't copy). Change-Id: I9a2b72b05b8051e793cf67179a0195f2f3551a10 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* QTextureGlyphCache: don't use a QList<QImage>Marc Mutz2015-06-221-8/+11
| | | | | | | | | | | | | | QImage is larger than a void*, so holding them in a QList is needlessly inefficient. In this case, the maximum size of the container is a small compile-time constant, so the best container to hold those QImages is a C array, even though it will default-construct all 12 QImages before even starting the loop, since the QImage constructor does not allocate memory. Change-Id: I83ca65aa1ca51c400ca696202d24cfaeab505a5b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* fix "install target not created" for WinRt buildsJoerg Bornemann2015-06-221-1/+4
| | | | | | | | | | | | | Commit 3ce99adf replaced DEPLOYMENT with INSTALLS and introduced the "install target not created" warning when running qmake on WinRt projects. The code path in qt.prf that was responsible for filling the DEPLOYMENT variable was never functional in Qt5. We're turning the code path off until this is properly fixed. Change-Id: If836ef648f9fb601b7597d39e3d00665d4cf01b0 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* qdoc: don't hold QQmlJS::AST::SourceLocation in QListsMarc Mutz2015-06-219-36/+39
| | | | | | | | | | | | QQmlJS::AST::SourceLocation wasn't marked as movable, and it is larger than void*, so QList<SourceLocation> is horribly inefficient. Fix by marking as movable primitive and holding in QVector instead. The same fix probably is required in QtDeclarative, too. Change-Id: I4e0d2cd32b7e03205d59cbc9900287f77045154a Reviewed-by: Martin Smith <martin.smith@digia.com>
* QGestureManager: fix expensive iteration over QHash::keys()Marc Mutz2015-06-211-3/+4
| | | | | | | | | | | | | ... with iteration over the hash itself. gesturesByType is a local variable, so there's no way functions called in the loop can modify it. This dividing operation would greatly benefit from a splice operation in QHash... Change-Id: Ifd241d2da9c6998c2ad0b08294fca84d5b188d0f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QtTest: don't hold QBenchmarkResults in QListMarc Mutz2015-06-212-3/+5
| | | | | | | | | | | | | QBenchmarkResult is larger than a void*, so holding them in a QList 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. Also saves ~1.2KiB of text size on GCC 4.9 optimized C++11 AMD64 Linux builds. Change-Id: I0c99e591bb9b4405aa1bb78ec095dcaf9277993f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QGestureManager: fix expensive iteration over QHash::keys()Marc Mutz2015-06-211-3/+3
| | | | | | | | | | ... with iteration over the hash itself. gesturesByType is a local variable, so there's no way functions called in the loop can modify it. Change-Id: I5971c404f4ae8473d4926b68eb7a9c60801f208d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>