This patch adds the Objective-C NSData/CDataRef converters to
QByteArray
This will replace the current converters offered in QMacExtras
[ChangeLog][QtCore][Objective-C] Added NSData/CDataRef converters for
QByteArray
Change-Id: I7a0f14bee4271798db345f3c5efd26ac671a3ea4
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- Replace SRCDIR define by QFINDTESTDATA
- Replace QVERIFY by QCOMPARE where applicable
- Introduce QVERIFY2 with message for comparisons
Change-Id: Ib5a6b0f09428587281e1b9521e4d8a8117c1afdb
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
The test instantiates enormous amounts of templates in one compilation
unit. All clang versions, that I tested, suffers from performance issues
while compiling the test, the cost depends on the version. The most
affected are shipped by Apple.
Task-number: QTBUG-37237
Change-Id: I0959c1a4a6faee448ae1dae5c1e70ee06cefbd9c
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
We do not need to check all possible basic type combinations in
the autoregistration test.
Change-Id: Ibfb97a93d9d1862e669d843988976690bbc83c74
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Redundant and unused variadic macro arguments were removed. For macros
with known count of arguments, named arguments are preferred.
Common code was moved out from macros so it is not generated over and
over.
Change-Id: Ib5106555d0d3c6cadfbdbdbd614831240b6d762f
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
QFATAL : tst_QGLThreads::textureUploadInThread() Cannot make QOpenGLContext current in a different thread
QFATAL : tst_QGLThreads::painterOnPboInThread() Cannot make QOpenGLContext current in a different thread
Task-number: QTBUG-28264
Change-Id: I281cf0593e01b43456410a9a53746bbb15f34f24
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Change-Id: I1711f99f9e46f1d195684e3c3a714b00618dca2e
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
- QVariant can store (U)Int, (U)LongLong, Float and Double numbers.
Previously, QJsonValue::fromVariant() converted Floats into Strings
while converting the others to Doubles.
- Add unit tests for QJsonValue::fromVariant()
[ChangeLog][QtCore][JSON] QJsonValue::fromVariant() will now convert
single-precision Floats into Doubles instead of Strings
Change-Id: I457adbe29c37ada611d1c6d711c42866d63d4024
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
And takes a very long time to build if it doesn't run out of memory.
Task-number: QTBUG-37237
Change-Id: I8c7fae4d2d99ad59c6d6306da2df554a05955446
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
In the original change - cfb44c6528 - when
querying for the path of a file that did not contain a slash after the
drive indicator it would get the current path and return that as the path
that the file resided on.
However this meant that it would take the current path at that time which
may not be the actual path that was expected. So it was decided that
it should revert back to the original behavior which was to just return
the drive letter followed by the colon which would thus indicate still
that it represented whatever the current path was on that drive.
Change-Id: Ic57ae9227882a66e9a4c4d6537d7f2cae829165a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Remove the opengl proxy for now. Later it will either be moved into
a separate library or replaced by a QOpenGLFunctions-based approach.
This means that the -opengl dynamic configuration is not usable
for the time being. The rest of the enablers remain in place.
The convenience function QOpenGLFunctions::isES() is now moved to
QOpenGLContext and is changed to check the renderable type. This is
extremely useful since besides supporting dynamic GL it solves also
the problem of GL_ARB_ES2_compatibility (i.e. it triggers the real ES
path when creating an ES-compatible context with a desktop OpenGL
implementation).
Task-number: QTBUG-36483
Task-number: QTBUG-37172
Change-Id: I045be3fc16e9043e1528cf48e6bf0903da4fa7ca
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
When a child of a widget is spontaneously revealed due to a call to
the parent 'resize' method, the child will not receive a paint event
if it has the WA_StaticContents and WA_OpaquePaintEvent flags set.
This is caused by the backing store being pre-emptively resized by the
call to setGeometry_sys, which causes QWidgetBackingStore::sync to skip
the block which handles the static contents.
There doesn't appear to be any reason to preemptively resize the backing
store, since it is always resized as-needed during the the 'sync' method.
This change-set removes the code which preemptively resizes the backing
store.
Task-number: QTBUG-35282
Change-Id: Ie9942854ca5322dfe0f98ed8100810161576be80
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
MSVC 2008 is confused by TypeInStruct being a template, resulting in
\tst_qatomicinteger.cpp(189) : error C2027: use of undefined type 'QStaticAssertFailure<Test>'
with
[
Test=false
]
for int (and thus for all unsupported types). This appears to be a real
Heisenbug-nature compiler bug as it can also be fixed by adding
qDebug() << Q_ALIGNOF(TypeInStruct<T>)
before the static assert.
Task-number: QTBUG-37195
Change-Id: Ib2b60f3c1ffeb0b8bdeb1fb0c659655ce4ab10d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This causes frequent compiler errors on Windows CE.
tests\auto\corelib\global\qtendian\tst_qtendian.cpp(140) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'd:\orcas\compiler\utc\src\P2\main.c[0xCCCCCCCC:0xCCCCCCCC]', line 243)
Task-number: QTBUG-37194
Change-Id: I2adbc1e3b1896fbe86780aa26a15e918333a09f2
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
by default QT contains both core and gui already
Change-Id: I6f5b551104e40a024468e7cb62e302134e9472ec
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
These tests seem to fail because denormalized numbers are not
supported on QNX yet, so marking them as expected failures.
- floatDistance(denormal)
- floatDistance_double(denormal)
Task-number: QTBUG-37094
Change-Id: I79dbc78da6e9bef8466264fd2cab4af0ee8b868f
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
These tests seem to fail because denormalized numbers are not
supported on QNX yet, so marking them as expected failures.
- testNumbers_2()
- toJsonLargeNumericValues()
- parseNumbers()
Task-number: QTBUG-37066
Change-Id: Ifec95b936fb70253395dee4d1ca18e85870486a3
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
This is more consistent with e.g. qt.conf, where section names also
start with an upper case character.
Change-Id: I9ddaf72baeb9334d081807412512242d5d46cbbf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This reverts commit a4ff400e25.
The patch caused a regression for bold fonts which is currently
blocking the alpha of Qt 5.3, so lets revert it and try
resubmitting a fixed version later to avoid delaying any release.
Task-number: QTBUG-36929
Change-Id: I8d474b09b2270eb2f861853e60605429be08e2d9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
There is no need to even try to run the tests if the network test
server is not present.
Add a validation in initTestCase() since all test functions depend
on the network test server.
Change-Id: I8eca376a718ab5b6e1cc2c57f2e045dd0b58f52b
Reviewed-by: Richard J. Moore <rich@kde.org>
Unit-test this by making the QList, QVector, QHash and QMap unit tests
be duplicated under strict-iterator mode. There's no test for
QLinkedList.
The tst_Collections test does not compile under strict-iterator
mode. It generated over 15000 errors when I tried.
The strict iterators required a small change: the difference_type
typedef needs to match the operators that get distances
(operator-(iterator)) and move the iterator around (+, -, +=, -=, etc.).
Task-number: QTBUG-29608
Change-Id: I834873934c51d0f139a994cd395818da4ec997e2
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Add a new QMarginsF class to complement QMargins in the style of
QSize/QSizeF and QRect/QRectF.
[ChangeLog][QtCore] Added class QMarginsF to support handling margins
with floating-point values.
Change-Id: Iaaa95ec85f5d126d9d864fc4b607241a8c8a8f3a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
On Windows, trailing spaces in a filename are silently ignored, so we
need to strip it before trying to open a file with it. Otherwise it ends
up being stripped later and in a case like " ." it will end up causing
Qt to think that a folder exists when it does not.
[ChangeLog][Platform Specific Changes][Windows][QtWidgets][QFileDialog]
Handled the case of having trailing spaces in a filename correctly so if
the filename ends up being empty that the parent path is used instead.
Change-Id: I6500cc3a44746bf4a65e73bcfb63265a0a97c8a3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
So far we did bind the definition of Q_COMPILER_VARIADIC_MACROS to
C++11 (so gcc, clang will not define it in default gnu++98 standard).
However, variadic macros are a feature of the gcc preprocessor since
version 2.97, and are enabled in the default configurations on gcc, clang,
icc.
This might cause warnings and errors though if one enables additional
warnings in gcc, clang (e.g. by -pedantic). Anyhow, as a precedent
qglobal.h already relies on 'long long' ... The warning can be disabled
by adding '-Wno-variadic-macros'.
[ChangeLog][Compiler Specific Changes] Variadic macros are now enabled
more liberally for gcc, clang, icc. If you have warnings (because you e.g.
compile with -pedantic), disable them by -Wno-variadic-macros.
Change-Id: Ie979b85809508ad70cab75e6981f20496429f463
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commit f4dd534 introduced a regression, so that QFontMetrics reported
a wrong size (to be more specific width) for FreeType fonts.
The calculation of glyph advances has to to reflect (rounded)
integral number of pixels. This was only done when the glyph was cached.
So in some cases the first call to QFontMetrics::size gave a different
result than the second.
This patch reverts f4dd5344fb.
The tst_QFontMetrics::same auto test only happened to work on some
platforms, on BlackBerry for instance it did not. Extended the test
case to make sure it works for different font sizes.
Change-Id: Ia5bb9abd3ff98193c9bba048b85207672ed8d9c3
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Currently the only supported SPDY version is 3.0.
The feature needs to be enabled explicitly via
QNetworkRequest::SpdyAllowedAttribute. Whether SPDY actually was used
can be determined via QNetworkRequest::SpdyWasUsedAttribute from a
QNetworkReply once it has been started (i.e. after the encrypted()
signal has been received). Whether SPDY can be used will be
determined during the SSL handshake through the TLS NPN extension
(see separate commit).
The following things from SPDY have not been enabled currently:
* server push is not implemented, it has never been seen in the wild;
in that case we just reject a stream pushed by the server, which is
legit.
* settings are not persisted across SPDY sessions. In practice this
means that the server sends a small message upon session start
telling us e.g. the number of concurrent connections.
* SSL client certificates are not supported.
Task-number: QTBUG-18714
[ChangeLog][QtNetwork] Added support for the SPDY protocol (version
3.0).
Change-Id: I81bbe0495c24ed84e9cf8af3a9dbd63ca1e93d0d
Reviewed-by: Richard J. Moore <rich@kde.org>
This partially reverts 5764f5e6ea and
fixes the problem differently.
After this commit, "file:///foo" is still equal to "file:/foo", but
"foo:///foo" becomes different from "foo:/foo", as it should be.
Task-number: QTBUG-36151
Change-Id: Ia38638b0f30a7dcf110aa89aa427254c007fc107
Reviewed-by: David Faure <david.faure@kdab.com>
This also has the advantage of not requiring the use of the locale
codec. Quite an advantage if you're debugging the locale codec. But it's
mostly so that we don't get question marks that hide the difference we
were trying to locate.
[ChangeLog][QtTest] QtTest now prints an escaped version of QStrings
that failed to compare with QCOMPARE. That is, instead of converting
non-printable characters to question marks, QtTest will print the
Unicode representation of the character in question.
Change-Id: I44c1ef3246b188c913dacd3ca4df02581356ea41
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This is extremely useful, since the most common action after a failed
compare-and-swap is to loop around, trying again with the current
value as found in memory.
Code currently written as:
do {
Type value = atomic.load();
...
} while (!atomic.testAndSetRelaxed(value, desired));
Becomes:
Type value = atomic.load();
do {
...
} while (!atomic.testAndSetRelaxed(value, desired, value));
In most CPU architectures, the value that was found in memory is known
to the compare-and-swap code, so this is more efficient than the
previous code. In architectures where the value is not known, the new
code is no worse than before.
The implementation sometimes modified an existing function, sometimes
it added a new one, depending on whether more registers were needed in
the assembly (like ARMv6-7), the code became more complex (ARMv5), the
optimizer failed (C++11), or it was just plain equivalent (MIPS).
Change-Id: I7d6d200ea9746ec8978a0c1e1969dbc3580b9285
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This implementation is based on GCC's implementation of std::hash<FP>, but only
to the extent of checking for zero before hashing the bits. The bit hasher is
the Qt one; I didn't even look what GCC uses.
The check against 0.0 is mandated by the requirement to have
\forall x,y: x == y => qHash(x) == qHash(y)
which would be violated for x = 0.0 and y = -0.0 if we only hashed the bits.
Implemented out-of-line to avoid potential FP-comparison warnings, as well
as to be able to use the file-static hash() functions, which gets inlined
unlike qHashBits(), which cannot be.
[ChangeLog][QtCore][QHash/QSet] Allowed to use float, double and long double
as QHash/QSet keys.
Change-Id: I38cec4afb860f17e9f8be7b67544e58b330f8fff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
This test can assume that the QObject::signalsBlocked property works as
advertized, so just check signalsBlocked() in repsonse to QSignalBlocker
manipulations.
Change-Id: I99e4ef9c4ed05c3840233d92a587636d2d78f59a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Change 85e57653 caused a compile error for code that does
Q_DECLARE_LOGGING_CATEGORY(cat);
//..
qCDebug(cat()) << // ...
error: C3848: expression having type 'const QLoggingCategory' would lose
some const-volatile qualifiers in order to call 'QLoggingCategory
&QLoggingCategory::operator ()(void)'
This is a regression from Qt 5.2. Fix the error by adding a const version
of operator()().
Change-Id: I2fb04f2e155962adee0f98089fc5a159000bef56
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>