...instead of coding the loop by hand.
Change-Id: Ieaa066de1ff8552b737cf27cf0d4236efb7296eb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
...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>
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>
...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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
In case of QT_NO_LIBRARY there are no plugins after all.
Change-Id: Iad891d0cf0edf9e4418a4fe4ac49cf6497ceeb79
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
We have established the maximum size qAllocMore can deal with in
commit 880986be23 and we should use
it.
The maximum size for byte arrays is reduced by one byte as with
the previous code we could make qAllocMore produce ((1 << 31) - extra)
by passing (1 << 30). That is not a problem for qAllocMore itself
(as long as extra > 0) but it's hard to verify that no related
code casts the total sum back to signed int, which would overflow
to -1.
To make the compiler inline access to the maximum size, a private
enum MaxByteArraySize is provided, which can be used in internal
code.
This fixes the merge of commits
880986be23 and
c70658d301
Change-Id: Idb04856f7c2e53ef383063e7555d3083020ff2b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add a cleanup function for the check and disable animations
in tst_qwidgetaction to prevent effect widgets from interfering
(vista style animations).
Change-Id: I043ecb131c8dcd07b6ef10bc75c9e010ab569e85
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Not only should using the "Ex"-versions be the rule and not the
exception on Windows, but it's only the only way to share as much
code as possible between Desktop Windows and WinRT (which is pushed
by Microsoft a lot). The current rule of Desktop and WinCE vs WinRT
does not make a lot of sense any longer, as WinCE is getting less
and less important. By moving these #ifdefs in favor of WinRT,
WinCe code might be removed easier in the future.
Change-Id: I0ef94fb14fbf8add9c2dfa2a3fb8036d25fb697d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This can lead to situations in which the gap item ends up in the
saved state
'subinfo' is owned by the item, but the const-ness is not transferred to
the pointer. So calling a non const function (unplug) that changes the
subinfo changes it in the original list as well.
This is a problem because that list might be shared with the saved state.
Change-Id: I90a5faafea5958043db610a84c069494f2e48137
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Jocelyn Turcotte (Woboq GmbH) <jturcotte@woboq.com>
We cannot do this if no library support is present. Incidentally that's
the case when bootstrapping, but you can also set the flag manually.
Change-Id: I51e167176d0839af5858122630ef623a1c69a106
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Use a QStringRef instead of a QString.
Change-Id: I63bf9775606b071cd9614306375e1316dada9f61
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Addition of new options SSL_KEY, SSL_CERT, SSL_CA, SSL_CAPATH and SSL_CIPHER
to allow SSL-encrypted connections to MySQL databases.
When needed, these options must be specified in the function call
QSqlDatabase::setConnectOptions() before the call to QSqlDatabase::open().
SSL_KEY = the path name to the key file
SSL_CERT = the path name to the certificate file
SSL_CA = the path name to the certificate authority file
SSL_CAPATH = the path name to a directory that contains trusted SSL CA
certificates in PEM format.
SSL_CIPHER = a list of permissible ciphers to use for SSL encryption.
These options replace CLIENT_SSL (which should not be used any more).
Example:
db.setConnectOptions("SSL_KEY=client-key.pem;" \
"SSL_CERT=client-cert.pem;" \
"SSL_CA=server-ca.pem");
[ChangeLog][QtSql] SSL support for MySQL database connections has been added.
Option CLIENT_SSL replaced by SSL_KEY, SSL_CERT, SSL_CA, SSL_CAPATH and
SSL_CIPHER, so that the keys, certificates and cipher can be specified.
Task-number: QtBUG-3500
Change-Id: I8197234b169a818658678d6fcc953c90e83db23e
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Print the full backtrace including the values of all variables, for
improved diagnostic analysis.
Change-Id: Iffcaa08123599e3610cdc2e316627167bfff0f36
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
They didn't show up in the "old" CI runs because they usually pass the second
time they are executed - which the testrunner does. The new CI doesn't do that
anymore, instead we now mark those tests explicitly and will track their record
of passing and failing in the new metrics database.
Change-Id: Id34dd6f792f38995b07b6fec88f833df64de2f8b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Otherwise you cannot link it statically against QtCore.
Change-Id: I4ac35602cea2192974f3e96ecad35edac976ce27
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The d_ptr variable is introduced by QGLCustomShaderStage and
needs to be fully handled by it. Delete the d_ptr in the dtor
Fixes Coverity CID #10995.
Change-Id: I76bf05206acf23363419afc95094f5593e808a2e
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>