Commit Graph

24004 Commits

Author SHA1 Message Date
Marc Mutz
d0b659f183 QPicture: don't hold pixmaps in QList
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>
2015-06-24 13:22:36 +00:00
Marc Mutz
1f46321717 QZip*: mark various types movable and primitive
... 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>
2015-06-24 13:22:09 +00:00
Marc Mutz
eb47c18081 QtGui: don't hold QPainterPath in QList
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>
2015-06-24 13:21:40 +00:00
Marc Mutz
aa79adef6f QAbstractTransition: don't hold QPointers in QList
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>
2015-06-24 13:15:05 +00:00
Marc Mutz
931f9c23ee QMacStyle: replace a QSet<QPointer> with QVector<QPointer>
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>
2015-06-24 13:14:35 +00:00
Marc Mutz
5b6fd71d3a tst_qzip: remove unused init()/cleanup() functions
Change-Id: I3502e8e20a4496051554dc6fb92ea9bd347cc0f7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-24 12:57:20 +00:00
Sérgio Martins
fece7cdb5d widgets: Use QList::reserve(), reduces reallocations.
Change-Id: I49cc03f365c77f142f62c8e77505ec09723a44d9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-23 15:35:59 +00:00
Sérgio Martins
a4d3af9614 dbus: Use QList::reserve(), reduces reallocations.
Change-Id: I5d60220c4d3014067a45a3d3553f0523c9fc7c74
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-23 12:46:36 +00:00
Alex Trotsenko
19e63a207f Replace QVERIFY with QCOMPARE in QRingBuffer autotest
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>
2015-06-23 05:59:13 +00:00
Laszlo Agocs
4c99d785bc Revert "Handle context loss in window surface creation too"
This reverts commit e4f5278a4f.

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>
2015-06-23 04:08:47 +00:00
Laszlo Agocs
d40647922b Revert "windows: Disable D3D9/11 with ANGLE in VMs"
This reverts commit a6000e2b66.

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>
2015-06-23 04:08:41 +00:00
Marc Mutz
9e139ce099 QTextureGlyphCache: add some qMove()
Change-Id: I1965f4de0f1bf9efdb15d07142f882897e163cc5
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-06-22 22:20:47 +00:00
Thiago Macieira
4dc597d96c Force Visual C++ math.h to define the M_ constants
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>
2015-06-22 15:13:13 +00:00
Ulf Hermann
68e31e4ab9 Replace #ifdefs with qmake feature checks.
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>
2015-06-22 14:21:25 +00:00
Ulf Hermann
b93d1f6b1f Don't try to resolve symbols for xcb if QT_NO_LIBRARY is set
Change-Id: I4bd5d8534abd9a585a4a641d01931de687eeae77
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-06-22 14:21:11 +00:00
Ulf Hermann
b57387f6f8 Define openssl symbol resolution warning function only if necessary
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>
2015-06-22 14:21:04 +00:00
Sérgio Martins
eca8f1bf98 gui: Add several QList::reserve() calls.
Reduces reallocations.

Change-Id: I0db16726f413a67b76a73fabd013f910ab5f5109
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-22 14:03:39 +00:00
Marc Mutz
307f551291 QMap: use constrained templates instead of static-ifs
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>
2015-06-22 13:08:07 +00:00
Martin Smith
5fe93057b2 doc: Fix qdoc errors in qstring.cpp
Fixed a few qdoc errors.

Change-Id: I9ede1c1d3b22e9613978e31722c8140ae966194e
Task-number: QTBUG-46796
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2015-06-22 13:03:42 +00:00
Martin Smith
470461da5e doc: Add missing comment delimiter
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>
2015-06-22 12:46:23 +00:00
Allan Sandfeld Jensen
e0139718bb Export gamma setting and metadata in QImageReader
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>
2015-06-22 12:22:37 +00:00
Kai Koehne
c29383769a Core: Fix QProcess::errorString() output
Fix regression introduced in commit 5147f73ac3.

Change-Id: I336e13d5127c5e6e2f9e7afdfa7956fc89533766
Reviewed-by: Marcel Krems <m.krems@software-vision.eu>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-22 12:04:45 +00:00
Laszlo Agocs
e4f5278a4f Handle context loss in window surface creation too
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>
2015-06-22 12:02:45 +00:00
Marc Mutz
9e6a61447c QIcon: don't use a QList<QImage>
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>
2015-06-22 10:55:58 +00:00
Marc Mutz
3e6f36175a QTextDocumentLayout: don't hold QPointers in QList
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>
2015-06-22 10:45:11 +00:00
Marc Mutz
838478ccca qdoc: mark Location::StackEntry as movable and Location as complex
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>
2015-06-22 10:43:34 +00:00
Marc Mutz
426d9b9c3e QtIcoHandler: don't hold images in QList
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>
2015-06-22 10:43:17 +00:00
Marc Mutz
831a7e06c0 qdoc: don't hold Location in QLists, don't even copy it
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>
2015-06-22 10:43:11 +00:00
Marc Mutz
792f68adea QTextureGlyphCache: don't use a QList<QImage>
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>
2015-06-22 10:43:04 +00:00
Joerg Bornemann
346c756dea fix "install target not created" for WinRt builds
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>
2015-06-22 07:53:12 +00:00
Marc Mutz
2422251ee5 qdoc: don't hold QQmlJS::AST::SourceLocation in QLists
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>
2015-06-21 13:42:49 +00:00
Marc Mutz
08e0963e08 QGestureManager: fix expensive iteration over QHash::keys()
... 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>
2015-06-21 13:42:39 +00:00
Marc Mutz
e475017753 QtTest: don't hold QBenchmarkResults in QList
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>
2015-06-21 11:46:59 +00:00
Marc Mutz
3045ac99f2 QGestureManager: fix expensive iteration over QHash::keys()
... 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>
2015-06-21 11:44:31 +00:00
Marc Mutz
8a25f888e9 QMdiSubWindow: fix O(n+nlogn) loop to O(n)
No further comment.

Change-Id: I2056b97281b5775d59c0ef9b4a5cbf03943a7d6b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-21 11:43:58 +00:00
Marc Mutz
cb60c5c66a qdoc: fix one of the most expensive loops in Qt
QQmlJS::Engine::comments() returns a QList<QQmlJ::AST::SourceLocation> by value.
The QList is horribly inefficient, but that will be topic of a separate patch.

The loop in QmlMarkupVisitor did not store the result of comments() in a local
variable, it called engine->comments() whenever it referenced it, which was
_three_ times per loop iteration. Two of those references applied op[] to
the rvalue engine->comments(), which, being mutable, detaches. _Twice_ per
loop, with a QList that heap-allocates its elements!.

And that was followed by a similar loop.

Fix by using a local const copy of the list to iterate over.

The loop termination condition also looks fishy (j is used to index into
the comments, but is not checked against comments.size()), but apparently
qdoc works fine with it so far, so don't try to fix.

The copy of QQmlJS in QtDeclarative is not affected by this (qdoc-specific
code).

Change-Id: I133c35dc9293609dfb8ad633e2d82399223b508b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-21 11:43:52 +00:00
Simon Hausmann
55655abfaf Insignifify qfileinfo on Windows, like QDir
Change-Id: I46595b2802321fa799fd6b0e91ab2cbcbb0193f5
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:26:14 +00:00
Simon Hausmann
e817ab43c2 Extend flakeyness of tst_QDBusAbstractAdaptor::overloadedSignalEmission(int)
This isn't specific to an Ubuntu version, unfortunately. It also fails
on OpenSuSE occasionally and other Ubuntu versions.

Change-Id: I6a1ca55a198270f1a1e8a9916e9f768762211550
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:26:10 +00:00
Simon Hausmann
fd9cf9e800 Blacklist flakey tst_QTimeLine::duration test on Windows
Change-Id: Ib9f901da5675a6eb86b90c5137afb66245c395a4
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:26:06 +00:00
Simon Hausmann
ba9bbf596f Improve debug output of tst_QTimeLine::frameRate()
When the test fails, show the actual signals spy count.

Change-Id: Id7312bfbfb6531404a9df73234031f13295c80ea
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:26:02 +00:00
Simon Hausmann
23cb449885 Extend tst_QPauseAnimation::pauseAndPropertyAnimations blacklist
Unfortunately it's flakey all over ;(

Change-Id: I1395af8a3186b3bc65cd79a60ae434dd9689d6e5
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:25:58 +00:00
Simon Hausmann
c2c9751c55 Blacklist tst_QPropertyAnimation::startBackwardWithoutEndValue on Windows
It's flakey with 'current > 42' sometimes succeeding and sometimes failing.

Change-Id: I86f52b0d0cecd345ed6c5852c822d12eae6acb26
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:25:54 +00:00
Simon Hausmann
88c98f38fe Extend the scope of QTBUG-30943
The failure of this test is not architecture specific but rather
Windows specific. It is failing on either type of Windows machine at random
intervals.

Change-Id: Ie3ab1d868053b22ee5b0d965a8cd6b923985b019
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:25:43 +00:00
Simon Hausmann
bc5581f228 Blacklist socks bind test on Windows
The test is very flakey.

Change-Id: I6cb7ee7989169d077104883a02bb9240bafabe38
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:25:39 +00:00
Simon Hausmann
7a04670e53 Blacklist tryAcquireWithTimeout
All variants of the tests are timing out randomly on all platforms :(

Change-Id: I9244602a8d06fd07d3cc99b2fb8fdf6e07e92cf2
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:25:35 +00:00
Simon Hausmann
b373d183de Insignifify qdiriterator test
Crashes on Windows in release builds :(

Change-Id: I6802af510046de414ba5b6c6fb4c4c2c90703a3d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 15:25:31 +00:00
Marc Mutz
886eac5213 QHttpNetworkHeaderPrivate: use QList<QByteArray>::join()
...instead of coding the loop by hand.

Change-Id: Ieaa066de1ff8552b737cf27cf0d4236efb7296eb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-20 11:40:07 +00:00
Marc Mutz
e173403971 QAbstractItemView: convert some assignments into RVO'ed initializations
Change-Id: If4b612460166675e91906a49e03de8ad4c50739f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-20 11:39:48 +00:00
Simon Hausmann
0e39aeaffb Prospective fix to unbreak qtdeclarative tests
Since commit a6000e2b66 tests run in the
CI now disable D3D11 and are intended to fall back to warp. This
causes additional output, which confuses tests in qtdeclarative
that look closely at the output of processes. So let's make these
debug messages instead of warnings.

Change-Id: I91d2f88c66e2e7368c8cbbfb3aec7ad0c47b8bee
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-20 09:56:22 +00:00
Kai Koehne
5147f73ac3 Core: Consolidate QProcess error reporting
Introduce two methods to set set error and errorString, and optionally
emit the error() signal. This also fixes two places where errorString
hasn't been set previously.

Change-Id: Ib7c27ff2daff898745e8e20ff8f11eaae568697f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-20 09:48:46 +00:00