If an error occurs during the transaction, we should prevent the
containers from being successfully read. So, check the status of the
stream before reading the container, because the deserialization
procedure temporarily resets it on entry.
Task-number: QTBUG-54022
Change-Id: Ie955c2fa3e449374f0f8403f00e487efa2bfdaf3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The header says they'll stop doing that in the next release. It's been
like that since at least the OS X 10.8 SDK...
Change-Id: Ib57b52598e2f452985e9fffd14585d4838dc8b09
Reviewed-by: Richard J. Moore <rich@kde.org>
The current QFontDatabase().writingSystemSample for Arabic is an
arbitrary text and meaningless.
This suggested text is used in LibreOffice and it makes sense for Arabic
people.
Task-number: QTBUG-53390
Change-Id: I7456d2741fbc07b4cfffd6151b421cb4427dd3e9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
C preprocessors augment their standard list of include paths from the
environment: Unix preprocessors use $C_INCLUDE_PATH (for C) and
$CPLUS_INCLUDE_PATH (for C++), plus CPATH for both, whereas MSVC uses
the an environment variable simply called "INCLUDE". Handling this for
MSVC is particularly important because the VCVARSALL.BAT script sets the
necessary #include paths in the environment for important things.
Without that being parsed, moc won't find some #defines, like
WINAPI_DESKTOP_FAMILY.
[ChangeLog][moc] qmake and moc now cooperate to use the Visual Studio
environment variables (set by the VCVARSALL.BAT script) to find system
include files. A possible consequence is that moc parses application
headers slightly differently, depending on #if conditions that depended
on macros that previous versions had not seen #define'd. Implementers of
other buildsystems are advised to pass the --compiler-flavor=msvc option
to moc.
Change-Id: I7e06274214d1939b0124e5b4bf169cceaef9ca46
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
In order for moc to properly parse #ifdefs and family, we've had
QMAKE_COMPILER_DEFINES as a list of pre-defined macros from the
compiler. That list is woefully incomplete.
Instead, let's simply ask the compiler for the list. With GCC and
family, we use the -dM flag while preprocessing. With ICC on Windows,
the flag gains an extra "Q" but is otherwise the same. For MSVC, it
requires using some undocumented switches and parsing environment
variables (I've tested MSVC 2012, 2013 and 2015).
The new moc option is called --include to be similar to GCC's -include
option. It does more than just parse a list of pre-defined macros and
can be used to insert any sort of code that moc needs to parse prior to
the main file.
Change-Id: I7de033f80b0e4431b7f1ffff13fca02dbb60a0a6
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
We were printing 'loaded library "xxx"' even when ret == false, which
was misleading. So instead print the error string.
Change-Id: Ib57b52598e2f452985e9fffd1459ea860ed2dfcf
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
There is now a DARWIN version for all four Apple platforms at once,
a MACOS_IOS version for macOS and iOS (since many of the checks we need
are prior to tvOS or watchOS's existence), and MAC and OSX have been
relegated to synonyms for MACOS_IOS and MACOS, respectively.
Change-Id: I54f587e26c6b46bf4b469c5d3039086c65566651
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Conflicts:
qmake/library/qmakebuiltins.cpp
qmake/library/qmakeevaluator.cpp
qmake/library/qmakeevaluator.h
qmake/project.h
QMakeEvaluator:
* evaluateConditional(): one side changed return type, the other
changed a parameter type.
* split_value_list(): one side changed a parameter adjacent to where ...
* expandVariableReferences(): ... the other killed one overload and
changed the survivor
src/corelib/io/qlockfile_unix.cpp
One side changed a #if condition, the other moved NETBSD's part of
what it controlled.
src/corelib/tools/qdatetime.cpp
One side fixed a reachable Q_UNREACHABLE in toMSecsSinceEpoch(), the
other moved it from the private class to the public one, in the midst
of the "short date-time" optimization, which confused diff entirely.
One side changed a QStringLiteral to QLatin1String, the other rewrote
adjoining code.
src/network/kernel/qauthenticator.cpp
Both rewrote a line, equivalently; kept the dev version.
src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
One side changed #if-ery that the other removed.
tools/configure/configureapp.cpp
One side added a check to -target parsing; the other killed -target.
tests/auto/testlib/selftests/expected_cmptest.lightxml
tests/auto/testlib/selftests/expected_cmptest.teamcity
tests/auto/testlib/selftests/expected_cmptest.txt
tests/auto/testlib/selftests/expected_cmptest.xml
tests/auto/testlib/selftests/expected_cmptest.xunitxml
Regenerated using generate_expected_output.py
I note that quite a few other expected_* come out changed, now.
There was no git-conflict in
src/widgets/kernel/qformlayout.cpp
but it didn't compile; one side removed some unused methods; the other
found uses for one of them. Put FixedColumnMatrix<>::removeRow(int)
back for its new user.
Change-Id: I8cc2a71add48c0a848e13cfc47b5a7754e8ca584
Align ourselves to what std::thread does (and what's sensible to do anyhow,
since we even document that "Deleting a running QThread [...] will probably
result in a program crash").
[ChangeLog][QtCore][QThread] Destroying a QThread which is still running will
now result in immediate and abnormal program termination.
Change-Id: Ib481287915be01a1381df14abf6e0fb68c36b5b5
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Associates the scalableBitmapFactor with the freetype QFontEngine
so that it is preserved when caching the engine
Task-number: QTBUG-53652
Change-Id: I010f9d235ccf30679b112e0c05e01bc247a3693f
Reviewed-by: jian liang <jianliang79@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Most fields were over-written after setting invalid. The two that
weren't (not used by QUtcTimeZonePrivate) should be (if only for
uniformity with other QTimeZonePrivate variants), so set them to
sensible values.
Change-Id: I824ca0108d5b6bc322f76a0d1683342f789523b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We can expect C++11 now, and using an initializer list
is much shorter.
Change-Id: I6424d24ce7660b342a629e836b94d62c8868a44d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
The XML parser uses fastScanLiteralContent() to read a block of
text. The routine was not checking the range of valid characters as
defined in the XML standard:
https://www.w3.org/TR/2008/REC-xml-20081126/#NT-Char
A check has been added to stop reading the bad character.
Note that the characters are legal in XML 1.1, but QXmlStreamReader
is a well-formed XML 1.0 parser
[ChangeLog][QtCore][QXmlStreamReader]
Fixed a bug in the XML parser that prevented to load XML that
contained invalid characters for XML 1.0.
Change-Id: I10aaf84fbf95ccdaf9f6d683ea7c31925efff36d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Conflicts:
qmake/library/qmakeevaluator.cpp
One side changed the iterator to use ranged-for, the other changed its
body; they only conflicted because the latter had to add braces around
the body, intruding on the for-line. Trivial resolution.
Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
The (example) code used a real to hold 360 / 7, which is of course 51,
discarding the 3/7 that was most likely meant to be kept. Noticed by
Coverity (CID 22364). Use 360.0 instead of 360 to get more accurate
results.
Change-Id: Ifdfbb932589d8ea728710e8b656af651c9f8a7d2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Do not attempt to switch from translucent GL windows (emulated by DWM blur
behind) to translucent raster windows (using layered windows) as
this produces warnings from UpdateLayeredWindowIndirect() failing.
Task-number: QTBUG-54734
Change-Id: Ie05126c5cb091a00f17b88a74b287c90aa2dfebd
Reviewed-by: Joni Poikelin <joni.poikelin@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Change d1b09dba45 removed the
support to detect the C++ version the compiler used by
default. In essence, it forced the compiler in C++11 mode,
if the default was still C++98.
This change reimplements the functionality in the new
configuration system.
Change-Id: Ib4bf7ade85288776f9ae2a870f19764df727e0a5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Do not increment 'data' past the buffer in case of invalid token.
Remove the left over qDebug so we can make a test.
Task-number: QTBUG-54609
Change-Id: I8f0dd3381fbdea3f07d3c05c9a44a16d92538117
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Emit a warning when the function is called before show()
as it does not have any effect in that case.
Amends change 69839e55c1.
Task-number: QTBUG-41309
Change-Id: I7c2bb21735d8e41d525c5e00213b0e278ae5c774
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Previously, QWindowsTheme had a hardcoded list of of available file icon sizes.
As the sizes depend on the Windows display scale factor, this can lead to
undesired scaling of icons.
Maintain an array of the standard sizes against which the sizes are
matched; refresh in display change.
Task-number: QTBUG-54561
Change-Id: If36de2f30c8a230cc7bd8eeb4dfc9f201aeda5e4
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
QTRY_VERIFY seems to be a better solution.
Change-Id: I92f9d11c393d9a464716b9224da1fd9c2be956a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Use QStringBuilder more.
Use QL1S directly, without QString construction.
Change-Id: Iad844391367681fc1013b9725403d009e7c346e6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When one tries to lock without a timeout, there is no need to allocate
a QReadWriteLockPrivate as we will not wait on it.
Change-Id: I37c96a7fbc0c66fbdffe372f6089708cb2466fe3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A number of devices are indicating that there is a problem with using
bgra so instead of blacklisting all of them individually it is best to
blacklist them all on the iOS platform. This ensures
QQuickItem::grabToImage() will work then.
Task-number: QTBUG-45902
Change-Id: I900857cfa996924469aaaeeee8037dc84a4fd575
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Only the static method systemFormat of NativeImage was used, and only
from raster pixmaps for default formats.
This patch moves the method to qpixmap_raster.cpp.
Change-Id: Ic3cb673775693ea0595bad5e5f267a8dd1e8b0ec
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
After initialization bsdkeyboard and bsdmouse didn't notify
QInputDeviceManager about new input devices so parts of Qt that relied
on these notifications (like QFbCursor) were not aware about new
functionality.
Set number of keyboard/pointer devices to 1 when bsdkeyboard and
bsdmouse plugins successfully initialized
Change-Id: I440826d2b7f3653fd43e58df8239346ba1e8a223
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Include qtwidgetsglobal.h from qtprintsupportglobal.h.
Add qtprintsupportglobal_p.h.
Include those headers from all header files in the module.
Change-Id: I8d8b2012ee7d513172b985e13fdfeb3493d26d23
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The new modular configuration system requires one global
header per module, that is included by all other files in
this module.
That header will later on #include the configuration file
for Qt Widgets. For now it defines the Q_WIDGETS_EXPORT
macro for this library.
Change-Id: I6698989b952b9bac94d086d9f219e03c000f7d53
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The file lives in Qt Gui, but declares a few methods from
Qt Core and Widgets. All of those methods are actually mostly
unused, not documented and pretty trivial.
This patch removes the last few places the methods got used and
removes the declarations. The implementations should get removed
in a future release.
Change-Id: I2b609c29f403d2ed4824ff4346008be08b3fd067
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The two versions of this function are now documented on the
global variables page.
Change-Id: Iee95e251d616f6c8b1b42458d23cbf64a70a5315
Task-number: QTBUG-50654
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
styleHint for SH_FocusFrame_Mask calls drawControl with a painter created
for pixmap. We only test pixmapSize.isValid(), but the size (0,0) is also 'isValid',
and we end up with a QPainter with an invalid paintEngine (null) crashing in
drawControl.
Task-number: QTBUG-54630
Change-Id: I84d1785f04ffb3e608812076a6d1bc36ffb92adc
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Add autotest for QHttp2ProtocolHandler. This patch contains a very simplistic
"in-process HTTP2 server" for testing the protocol's basic logic/flow control/error
handling and emulating possible scenarios.
Task-number: QTBUG-50956
Change-Id: Ie02d3329c5182277a3c7c84f1bae8d02308e945d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We cannot really remove the function, since it's called from
inline code (QCharRef::op=(QChar)), but we can schedule it for
removal in Qt 6, and inline it into existing in-tree callers.
Change-Id: I3499f101dcb5ae908726b3673bf3526a04408db6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The hash function is carefully designed to give the same result
as the straight-forward implementation of qHash(unordered_map),
which we'll probably add at some point, namely: std::accumulate
over a container of std::pair.
This is one reason to use std:: and not QPair in the implemen-
tation of qHash(QHash). The other is that qHash(QPair) uses a
bad hash combiner, which may xor out the 'seed' from the result.
We can't fix that until Qt 6, but the qHash(std::pair) overload
uses the well-known boost::hash_combine algorithm (implemented
in Qt as QtPrivate::QHashCombine), so we can use that.
I also trust std::pair to work without problems with reference
template arguments, while QPair only very recently gained a very
basic auto-test for reference parameters.
[ChangeLog][QtCore] Added qHash() overloads for QHash, QMultiHash.
Change-Id: I90879d8a99cf1aadb6e84ecc0c3704f52f3691da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Those are not supported on Unix configure and are not something
we should support IMO.
Also cleaned up setting a QMAKE_QT_VERSION_OVERRIDE variable
in qconfig.pri that's never used.
Change-Id: I470483660118368abf7bd8aba4a53a25d9ab8a40
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The new modular configuration system requires one global
header per module, that is included by all other files in
this module.
QtDBus already had such a header, but its name (qdbusmacros.h) was
not in line with what's being used in all other modules. So
add a qtdbusglobal.h header, and turn qdbusmacros.h into a a forwarding
header to that new global header file.
Change-Id: Ib7eb2484c7b8b588eb89bf3290cb6c1c7c391fe2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
... and re-use them in QImageReader, QJpegHandler, QPngHandler.
Change-Id: Iec89e47205f3c420e1e7eb4a2d3c1fbfe887fd8c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>