Commit Graph

23975 Commits

Author SHA1 Message Date
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
Alex Trotsenko
5c0ff27d9b Simplify QIODevice::readAll()
The previous implementation performed reading in two steps:

 - flush the internal buffer
 - request the rest of the data by calling the read() function

It would resize the result buffer separately at each step, even if its
total size was known in advance. This is important for random-access
devices, which may have big chunks of cached data. Also, possible
failures during the second step would cause a loss of result data from
the first stage. This patch eliminates the initial flush, which improves
performance and prevents data loss.

Change-Id: I3da4c24ee33dca6afc4ba519d078b86068de43b9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-20 08:56:14 +00:00
Marc Mutz
657e8ffb9e QSettings: replace a QMap with a QList
The QMap<QString, QString> was only used to create a sorted,
unique list of keys. The associativeness was never used (the
value was always the null QString).

Better to use a QStringList instead and sort-unique the
whole thing at the end.

Saves ~1.6K in text size on Linux AMD64 GCC 4.9 release C++11
builds, and a tremendous amount of heap allocations.

Change-Id: Idf749dd8924b3894e436aa1cee0304002b898975
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-20 04:39:15 +00:00
Marc Mutz
669487fe95 QCommandLineOption: prevent aggressive inlining
There is a good chance that in every program, command line options
that have only one name and those that have multiple names are
used. Make better use of the icache by not inlining the Private
ctors into the QCommandLineOption ones.

Saves 400B in text size on Linux GCC 4.9 C++11 release
builds.

Change-Id: I6247d4a2330c5fff75d06f5a40223d972b267e85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-20 04:39:05 +00:00
Marc Mutz
90da7ba49c QFontSubset: mark local types movable and hold in QVector, not QList
Virtually all of these types are too large to fit into a QList.

Change-Id: If55496ef3fb26d6531e9ef1bb1558887d9077a3b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-20 04:38:40 +00:00
Marc Mutz
452ece9c02 Remove quadratic behavior in QFontDatabase::writingSystems()
Looping over QList::contains() constitutes O(N²) behavior,
the more so as this QList is horribly inefficient since
WritingSystem is not a Q_MOVABLE_TYPE.

Since the range of possible unique values in the result
is severly limited (by virtue of being enumerated values),
use a bitmask to remember which WritingSystems were
encountered, then, after releaseing the mutex again, use
that bitmask to populate the QList.

Change-Id: I1d12eb487513ec17faa6f38942f8b681819dc0e8
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-19 18:37:30 +00:00
Laszlo Agocs
a6000e2b66 windows: Disable D3D9/11 with ANGLE in VMs
By adding support for the driver description, we can detect if
we are in VMware. In this case D3D9 and 11 get disabled, so only
the software-based options are in use.

This allows running autotests like tst_qopengl, tst_qopenglwidget,
tst_qgl, etc. in the Qt CI system. There OpenGL 2.x is not available,
so ANGLE is the only option. D3D11 is not an option, so it picks D3D9
by default. However, this results in mystic failures. The stable solution
seems to be to use WARP. This can be achieved by setting disable_d3d9 in
the built-in GPU blacklist.

Change-Id: I937c4b3fa82fc1a2d524b4eb712732722df2070c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-06-19 17:52:19 +00:00
Marc Mutz
2de01c8388 Move-enable QPixmapCache::Key
The default constructor already sets the d-pointer to nullptr,
so the move constructor does not introduce a new state.

Change-Id: Icd47952bdf76d2106992d6babea40d68f18d067e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-19 17:49:15 +00:00
Marc Mutz
9ab45763d7 QSpdyProtocolHandler: don't create QLists of key and value just to iterate over
Just iterate over the QMultiMap directly. Also, now that we use
iterators, the remove operation becomes amortized O(1) instead
of O(logN). The loop could be even O(N) (clean, not amortized)
if QMap had range-erase.

Change-Id: I0cf3511adc3a558e551ddd91e47dabcab376001a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-19 16:30:03 +00:00
Ulf Hermann
8558289780 QtNetwork: fix warnings when compiling with QT_NO_BEARERMANAGEMENT
Resolving d- and q-pointers in code branches where we don't use them is
wasteful and leads to compile warnings.

Change-Id: Ib5dadd247acfe48722121e0e95ffcac61e7a2e09
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-19 16:29:58 +00:00
Marc Mutz
fedb442db3 QCommandLineOption: optimize ctors
...by moving common code into the Private ctor,
and catering for C++11 move semantics a bit.

Saves ~1.5KiB in text size on Linux GCC 4.9 C++11 release
builds.

Change-Id: I52ed7e47f76b69500a871844c0920e27fe51a127
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-19 16:29:50 +00:00
Marc Mutz
8133b80e63 QCUPSSupport: clear the job-hold-until option if jobHoldToString() is empty
This changes the behavior of the code such that the option, once set,
can also be unset again.

Change-Id: I739f77ae1f1336806aac548f6a797ed6b2770235
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-19 16:29:46 +00:00
Marc Mutz
eb5654788b Micro-optimize QSettingsPrivate::processChild() and its users
...by using QStringRef instead of QString, avoiding one
memory allocation in the case of spec != AllKeys and
key containing a '/'.

Also calls one less non-inline function, since
QStringRef::truncated() is inline.

Change-Id: Id5eb203006a3857508c5d3f4b729cde1a5170d58
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-19 16:29:41 +00:00
Marc Mutz
e2d83802a0 QPixmapCache: remove unused Q_TEST_QPIXMAPCACHE-only function
Unused by tst_qpixmapcache.cpp and everything else, and
uses an inefficient QList, so remove.

Change-Id: Ia410ed19db9bb3db97460b21bc2fd9d53c95a73d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-19 16:29:24 +00:00
Sérgio Martins
bc977f690f Use Q_GLOBAL_STATIC for QThreadStorage<QGuiGLThreadContext *>
QThreadStorage isn't a trivial type.

Change-Id: Iedc3c16320fd025a0ccf627eac43a85ebd02aa5e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-06-19 16:25:33 +00:00
Sérgio Martins
8f5dceee3c qprinter: Remove superfluous iteration and memory allocation
Instead of iterating through a QList that was constructed
after iterating through all of QSet's elements just iterate
through QSet's elements.

Change-Id: Ie502017976536b14ea9170af550a2d7156443391
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-19 16:25:14 +00:00
Marc Mutz
24ef5d2263 QStringRef: add truncate()
Missing part of QString API.

[ChangeLog][QtCore][QStringRef] Added truncate(int).

Change-Id: I49e218daf8f47fcd3dad131155e0abc8e2a133e5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-19 05:41:41 +00:00
Marc Mutz
302cc32dee QMap: add const equal_range() overload
... to prevent detaching.

[ChangeLog][QtCore][QMap] Added const equal_range() overload.

Change-Id: I4b39abb8ad41ba6eaa8f9a9a74ed74ed10337dd3
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-06-19 05:41:33 +00:00
Marc Mutz
6f530fe4d6 QVector: add move(int,int) for QList compat
Change-Id: I67948621313f2e7c69abe7ef95ee82ca64c6512a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-18 19:58:58 +00:00
Ulf Hermann
5867e0a7ab Don't build CUPS related code if QT_NO_CUPS is set.
Various related classes aren't built in this case, so the build fails
if we try to build the plugin or the widget.

Change-Id: Ia3f8651f172bc3c4c643fb2521601683b403eadc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2015-06-18 14:52:21 +00:00
Friedemann Kleint
c0eafb9d75 QMenu/QToolBar: Add overloads of addAction() using Qt 5 signals and slots.
Add documentation dummies and templates, add tests verifying
compilation.

Change-Id: Ide336b28bc069cfd17848ce3a17fd428e36ed65b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-18 14:42:24 +00:00
Alex Trotsenko
a851868e63 QIODevice::atEnd(): fix debug message output
For sequential devices, duplicated bytesAvailable() calls can produce
different results. To avoid a wrong output, print exactly the same
value as would be returned.

Change-Id: I02615dd7375516f7b263eea56bfcf15e2889e6e3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-06-18 07:04:11 +00:00
Marc Mutz
895dbac454 QException: fix exception specification
Some broken compilers (known broken: GCC 4.7; known good: GCC 4.9)
don't understand that destructors are implicitly noexcept and
complain about a weaker exception specification on ~QException
than on ~std::exception.

Change-Id: I433475fcf345d7da55e8da667cf9821ee09c0d8a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-17 13:22:50 +00:00
Marc Mutz
742c6ff5dc tst_QStateMachine: replace inefficient QLists with QVector
It's just a test, but it's in the way of automatic tracking
of inefficient QLists.

Change-Id: I2dcfd81c9e208dab57bb256d7c276ad5303f196c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-17 07:10:11 +00:00
Marc Mutz
b9331eff91 QMetaObjectBuilder: replace an inefficient QList with QVector
ints are only half the size of void* on 64-bit, so
QVector<int> uses only 50% of per-element memory,
compared to a QList.

Saves ~1800B of text size on GCC 4.9 optimized C++11 AMD64
Linux builds, even though it wasn't the last instance of
QList<int> in QtCore, yet.

Change-Id: Ibf04b26cff78c428e4253aaab7c280866906db58
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-17 07:10:06 +00:00
Marc Mutz
d4cee10bf8 QMetaObjectBuilder: replace inefficient QLists with QVector
The QMeta*Private classes are larger than a void*, and weren't
marked as movable, so QList<QMeta*Private> is horribly inefficient.

Fix by holding them in QVector instead. Saves ~900B in text size
on GCC 4.9 optimized C++11 AMD64 Linux builds, and tons of memory
allocations.

Change-Id: I313c965d7a0fea16f79e9fde04a972fc248e33aa
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-06-17 07:10:02 +00:00
Marc Mutz
2d9700c041 QPointer: add member-swap
Change-Id: I5704badc86f98e549c586656ec8df3915632ce15
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-17 07:09:57 +00:00
Marc Mutz
9f1646b0d9 qDBusRealAddTimeout(): don't create a QList just to check it's empty
Instead of QHash::keys(value).isEmpty(), use QHash::key(value, 0) == 0
(0 is used a failure indicator three lines down, so it should not be
a key in the hash table).

Change-Id: I75cc4f7f7540dc5c51a7b8e3add09a0ec6a75e05
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-06-17 07:09:52 +00:00
Marc Mutz
dd788e0dc8 QButtonGroup: don't create a list just to find the minimum element
Change-Id: Ibd66ad81264abbe804db2bae48823966d5e4f449
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-06-17 07:09:46 +00:00
Ulf Hermann
7c34ea1fc7 Don't define qAccessiblePlugins if we cannot use them.
In case of QT_NO_LIBRARY there are no plugins after all.

Change-Id: Iad891d0cf0edf9e4418a4fe4ac49cf6497ceeb79
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-06-16 14:31:00 +00:00