Commit Graph

45049 Commits

Author SHA1 Message Date
Martin Koller
ce672e1c9b avoid compile warning when using clang++ with -Wshorten-64-to-32
Change-Id: I78a6cd84ac5b8c250d9569d864a7e38269b85e10
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-11 09:42:37 +01:00
Volker Hilsheimer
033d01bd6e QApplication: remove obsolete globalStrut functionality
Change-Id: If56873f86f5291264cac720f8db7dbd4db756f49
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-10 13:59:30 +02:00
Friedemann Kleint
c0873b7832 Fix a few size_t / int conversion warnings
Change the hash function of QTypeRevision and QtFontFallbacksCacheKey
to use size_t and add a few casts.

Change-Id: I89a8fc617abbe8b0c67529ec41795691c99b0574
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-10 11:30:17 +02:00
Andre de la Rocha
4c4693cf96 Windows: Provide a way to switch between WinTab and Windows Ink at run-time
This change adds the setWinTabEnabled() function to Qt Platform Headers,
which allows an application to set at run-time whether the WinTab API will
be used for tablet input instead of the native Windows Ink API.

[ChangeLog][Windows] The setWinTabEnabled() function added to Qt Platform
Headers now allows an application to set at run-time whether the WinTab API
will be used for tablet input instead of the native Windows Ink API.

Fixes: QTBUG-83218
Change-Id: I51d3c7316baeda136763cf37c2f54295905450ec
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-04-10 01:52:35 +02:00
Mikhail Svetkin
ae57e4fba5 cmake: Add library mapping for QtHttpServer
Change-Id: I3e12f164f7f6891c60c0d9da700b888850021e53
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-09 20:11:31 +02:00
Lars Knoll
56ebc2363d Fix autotests after the QHash changes
Some test cases are sensitive to the exact ordering inside
QHash, and need adjustments when we change QHash or the
hashing functions.

Some rcc tests now also need 32bit specific data, as the hashing
functions for 32 and 64 bit are different now (as we use size_t).

Change-Id: Ieab01cd55b1288336493b13c41d27e42a008bdd9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-09 20:04:15 +02:00
Lars Knoll
8a984ab772 Deduplicate some code
Requires one more branch inside the loop, but that should not
really matter performance wise. And it should expand to less code.

Change-Id: I4619dd2a2e6fedf8d109009a5b6d7410ed89f1fb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-09 20:04:07 +02:00
Lars Knoll
73ddfa25b4 Optimize hashing of floating point numbers
Change-Id: Id5e091b135c006b10987f229f45319228edb8675
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-04-09 20:04:00 +02:00
Thiago Macieira
09bdf907cf Replace Qt's hashing function with SipHash
This commit replaces MurmurHash with SipHash for all strings longer than
the size of a pointer. The most important difference between those
algorithms is that MurmurHash has this unwelcome property: for two
byte sequences x and y, if you know that x and y have the same hashing
for a given seed, then they have the same hashing for all seeds.

SipHash has no such issue. If the seed changes, the strings that used to
compute to the same hash are no longer likely to do so.

We've chosen to implement a SipHash-1-2 algorithm instead of the regular
2-4 as that has roughly the same performance as the old DJB33XA
algorithm. It's around 50% slower than MurmurHash, which is
acceptable given the added security.

Task-number: QTBUG-47566
Change-Id: I09100678ff4443e6be06fffd14819c8878d223e2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-09 20:03:52 +02:00
Lars Knoll
f14559790b Change qHashBits to use MurmurHash2
The old implementation was either using CRC32 on modern processors
or a trivial, but rather slow implementation.

We can't continue with CRC32, as that implementation can only
give us 32bit hashes, where we now need to support 64bit in Qt 6.

Change the implementation to use MurmurHash, as public domain
implementation that is both very fast and leads to well distributed hashes.

This hash function is about as fast as the SSE optimized CRC32 implementation
but works everywhere and gives us 64 bit hash values.

Here are some numbers (time for 10M hashes):

                                         14 char     16 char
                                         QByteArray  QString  float
old qHash (non CRC32)                    127ms       134ms    48ms
old qHash (using SSE CRC32 instructions  60ms        62ms     46ms
new qHash                                52ms        43ms     46ms

Unfortunately MurmurHash is not safe against hash table DoS attacks, as
potential hash collisions are indepenent of the seed. This will get
addressed in followup commit, where we use SipHash or an SSE optimized
AES based hashing algorithm that does not have those issues.

Change-Id: I4fbc0ac299215b6db78c7a0a2a1d7689b0ea848b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-09 20:03:45 +02:00
Lars Knoll
03d990fa15 Fix compiler warning on 32bit
Change-Id: I8728ba339161e210772e73c633cb2309dfb01b8e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-09 20:03:39 +02:00
Lars Knoll
0375757bfb Implement emplace() for QHash and QMultiHash
At the same time use the opportunity to refactor the
insertion code inside the implementation of QHash to
avoid copy and move constructors as much as possible
and always construct nodes in place.

Change-Id: I951b4cf2c77a17f7db825c6a776aae38c2662d23
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-09 20:03:32 +02:00
Lars Knoll
c6cdf38e75 Change qHash() to work with size_t instead of uint
This is required, so that QHash and QSet can hold more
than 2^32 items on 64 bit platforms.

The actual hashing functions for strings are still 32bit, this will
be changed in a follow-up commit.

Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-09 20:03:25 +02:00
Lars Knoll
775945137b Fix the documentation for QHash and QMultiHash
Change-Id: Iecf742c5e5bd4716e2d17394770e992024c5bdbb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-09 20:03:17 +02:00
Lars Knoll
3b46627942 Optimize QHash when using QHashDummyValue
This is used by QSet to avoid storing extra data for the value
in the Hash. Re-implement the optimization after the changes to QHash.

Change-Id: Ic7eba53d1c0398399ed5b25fef589ad62567445f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-09 20:03:11 +02:00
Lars Knoll
e1e573cee8 new QCache implementation
Make use of the new features available in QHash and do a more
performant implementation than the old one.

Change-Id: Ie74b3cdcc9871cd241aca205672093dc395d04a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-09 20:03:03 +02:00
Lars Knoll
5b7c3e31b5 New QHash implementation
A brand new QHash implementation using a faster and more memory efficient data
structure than the old QHash.

A new implementation for QHash. Instead of a node based approach as the old
QHash, this implementation now uses a two stage lookup table. The total
amount of buckets in the table are divided into spans of 128 entries.
Inside each span, we use an array of chars to index into a storage area
for the span.

The storage area for each span is a simple array, that gets (re-)allocated
with size increments of 16 items. This gives an average memory overhead of
8*sizeof(struct{ Key; Value; }) + 128*sizeof(char) + 16 for each span.

To give good performance and avoid too many collisions, the array keeps its
load factor between .25 and .5 (and grows and rehashes if the load factor goes
above .5).

This design allows us to keep the memory overhead of the Hash very small, while
at the same time giving very good performance. The calculated overhead for a
QHash<int, int> comes to 1.7-3.3 bytes per entry and to 2.2-4.3 bytes for
a QHash<ptr, ptr>.

The new implementation also completely splits the QHash and QMultiHash classes.

One behavioral change to note is that the new QHash implementation will not
provide stable references to nodes in the hash when the table needs to grow.

Benchmarking using https://github.com/Tessil/hash-table-shootout shows
very nice performance compared to many different hash table implementation.
Numbers shown below are for a hash<int64, int64> with 1 million entries. These
numbers scale nicely (mostly in a linear fashion with some variation due to
varying load factors) to smaller and larger tables. All numbers are in seconds,
measured with gcc on Linux:

Hash table              random     random     random  random reads   full
                        insertion  insertion  full    full   after   iteration
                                   (reserved) deletes reads  deletes
------------------------------------------------------------------------------
std::unordered_map      0,3842     0,1969     0,4511  0,1300 0,1169  0,0708
google::dense_hash_map  0,1091     0,0846     0,0550  0,0452 0,0754  0,0160
google::sparse_hash_map 0,2888     0,1582     0,0948  0,1020 0,1348  0,0112
tsl::sparse_map         0,1487     0,1013     0,0735  0,0448 0,0505  0,0042
old QHash               0,2886     0,1798     0,5065  0,0840 0,0717  0,1387
new QHash               0,0940     0,0714     0,1494  0,0579 0,0449  0,0146

Numbers for hash<std::string, int64>, with the string having 15 characters:

Hash table              random     random     random  random reads
                        insertion  insertion  full    full   after
                                   (reserved) deletes reads  deletes
--------------------------------------------------------------------
std::unordered_map      0,4993     0,2563     0,5515  0,2950 0,2153
google::dense_hash_map  0,2691     0,1870     0,1547  0,1125 0,1622
google::sparse_hash_map 0,6979     0,3304     0,1884  0,1822 0,2122
tsl::sparse_map         0,4066     0,2586     0,1929  0,1146 0,1095
old QHash               0,3236     0,2064     0,5986  0,2115 0,1666
new QHash               0,2119     0,1652     0,2390  0,1378 0,0965

Memory usage numbers (in MB for a table with 1M entries) also look very nice:

Hash table        Key   int64      std::string (15 chars)
                  Value int64      int64
---------------------------------------------------------
std::unordered_map      44.63      75.35
google::dense_hash_map  32.32      80,60
google::sparse_hash_map 18.08      44.21
tsl::sparse_map         20.44      45,93
old QHash               53.95      69,16
new QHash               23.23      51,32

Fixes: QTBUG-80311
Change-Id: I5679734144bc9bca2102acbe725fcc2fa89f0dff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-09 20:02:55 +02:00
Szabolcs David
926a0886d1 Support multiple page ranges in QPrinter
Add a new QRangeCollection type to store and manage
multiple page ranges. This moves out the parser and validator
logic from the platform dependent (UNIX) dialog and makes it
publicly available from QPrinter.

This improves the usability of QPrinter in those applications
which doesn't use print dialog to configure printer.
(e.g.: QTextDocument, QWebEnginePage)

Change-Id: I0be5a8a64781c411f83b96a24f216605a84958e5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-04-09 16:45:32 +02:00
Alexandru Croitor
4c66b75c89 CMake: Skip regeneration of manual compile test project
Change-Id: I8563ed5b034c843b9f3a4390f963558f6d214ad1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-09 11:26:46 +02:00
Alexandru Croitor
066e8a4557 CMake: Handle missing packages in project compile tests
If a find_package() in a try_compile project doesn't find a package,
and we then link against a non-existent target, the configuration
failure of the compile test also fails the configuration of the
project.

To avoid that, separate library targets from non-targets, and make sure
to only link against the targets if they exist.

pro2cmake now outputs modified compile test project code which iterates
over targets and non-target libraries, and links against them when
needed.

Change-Id: Ib0f4b5f07af13929c42d01a661df2cabdf9b926b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-09 11:26:42 +02:00
Volker Hilsheimer
c9b2528a9d Don't set WindowContextHelpButtonHint by default for dialogs and sheets
This makes the Qt::AA_DisableWindowContextHelpButton flag obsolete. It
is already documented as such in Qt 5, so we can remove it now.

[ChangeLog][QtWidgets] Do not show 'What's this' button anymore in
dialogs on Windows. To show the button again, you need to set
Qt::WindowsContextHelpButtonHint explicitly the top level widget.

Change-Id: I30017ca300441cb2ee37940ce97dfe18eb2b118b
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-04-09 09:35:23 +02:00
Karsten Heimrich
b75c82f645 Resolve Qt6 TODO items, replace Median and BlockSizeManager
* Replaces the, only internaly used, implementation of template
  class Median with a fixed size none templated version.
* Replaces BlockSizeManager with an updated BlockSizeManager V2,
  but keeping the original name.
* adapt the auto-test to take the fixed size array into account

Change-Id: If76cb944676c4a06a7566ad0bc37ded25b81c70c
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-04-09 02:49:18 +02:00
Karsten Heimrich
9ad8b80fb9 Remove some dead code
Change-Id: I526d9baee260f018cec6076595a28be8596b6395
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-04-09 02:49:08 +02:00
Volker Hilsheimer
0f968085b9 QApplication: remove obsolete keypadNavigationEnabled member
QApplicationPrivate::keypadNavigationEnabled remains, and is
used in many places in QtWidgets.

Change-Id: Id95239560c279850f340f65414acb92202d10367
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-04-09 00:49:42 +02:00
Volker Hilsheimer
9c551778c8 QApplication: remove deprecated keyboardInputLocale/Direction members
Change-Id: I87767cbf16aadb1ee36cfed958b5d6367a565915
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-04-09 00:49:32 +02:00
Qt Forward Merge Bot
c937ed8af4 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-04-08 22:04:23 +02:00
Alexandru Croitor
e0346df1b2 CMake: Handle finding of OpenSSL headers correctly
In Coin when provisioning for Android, we download and configure
the OpenSSL package, but don't actually build it. This means that
find_package(OpenSSL) can find the headers, but not the library,
and thus the package is marked as not found.

Previously the openssl_headers feature used the result of finding
the OpenSSL package, which led to it being disabled in the above
described Android case.

Introduce 2 new find scripts FindWrapOpenSSL and
FindWrapOpenSSLHeaders. FindWrapOpenSSLHeaders wraps FindOpenSSL,
and checks if the headers were found, regardless of the OpenSSL_FOUND
value, which can be used for implementing the openssl_headers feature.

FindWrapOpenSSL uses FindWrapOpenSSLHeaders, and simply wraps the
OpenSSL target if available.

The find scripts also have to set CMAKE_FIND_ROOT_PATH for Android.
Otherwise when someone passes in an OPENSSL_ROOT_DIR, its value will
always be prepended to the Android sysroot, causing the package not
to be found.

Adjust the mapping in helper.py to use the targets created by these
find scripts. This also replaces the openssl/nolink target.

Adjust the projects and tests to use the new target names.

Adjust the compile tests for dtls and oscp to use the
WrapOpenSSLHeaders target, so that the features can be enabled even
if the library is dlopen-ed (like on Android).

Task-number: QTBUG-83371
Change-Id: I738600e5aafef47a57e1db070be40116ca8ab995
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-04-08 22:03:24 +02:00
Alexandru Croitor
0a13c3a3f0 CMake: pro2cmake: Handle $$PWD in included .pri files correct-ish
Previously the $$PWD was evaluated within the including .pro file,
which generated incorrect relative paths to source files.

Now we use a horrible hack to evaluate keys ending with SOURCES
and HEADERS. If such is a case, use a map_file transformer which
will use the included scope, thus creating correct relative paths.

Fixes projects in qtdeclarative like src/qmltypregistrar and qmllint.

Checked that it doesn't break projects in qtdeclarative and qtbase.

Change-Id: I21f1e4c638c2cf8d0f67e94e1a583ebc54c175a2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-08 21:58:41 +02:00
Volker Hilsheimer
0651a4c274 Remove global GDI helpers qt_win_display_dc and qt_region_from_HRGN
They were no longer used anyway.

Change-Id: I565480cf39d2d8a27735afe56ac6537bc62fbd4a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-04-08 21:58:41 +02:00
Volker Hilsheimer
aad8d17f74 QApplication: remove forwarding of QGuiApplication::windowIcon
Change-Id: If886b0187bd5a6e0d57f6f0ed6bc4fca3edbe435
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-08 21:58:41 +02:00
Volker Hilsheimer
d638d62ce3 QApplication: remove obsolete syncX member
Change-Id: I388fe7e9eef56ad5dcc63a8b7d14b95cfc39e599
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-04-08 21:58:41 +02:00
Volker Hilsheimer
e25d79a5bd QApplication: remove obsolete setGraphicsSystem
Change-Id: I1152207947f9dfe0c40b5702f33d12d2da85502e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-08 21:58:41 +02:00
Volker Hilsheimer
402e955db0 QApplication: remove deprecated members for obsolete ColorSpec
Change-Id: Idf1f4fd34e22c0ecac50a030e709d90b46dd6145
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-08 21:58:41 +02:00
Volker Hilsheimer
c8dea4a833 Override virtual method in private class instead of downcasting
Move QGraphicsView specific code into reimplementation of now virtual
(and const) canStartScrollingAt.

Remove unhelpful comment.

Change-Id: Ib4799e48ac4f85748c77c52d29511a0490303676
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-08 21:58:41 +02:00
Volker Hilsheimer
e349f787d5 QGraphicsView: consistently use ranged for and iterators
- replace random access with ranged for
- replace foreach with ranged for
- add qAsConst where possible
- iterate directly over QMap, rather than the keys (address FIXME
  comment)
- add some const to ensure that code has no side effects on
  containers or indices used in different places

Change-Id: I6199fd6edd5e4426c6c7fee0ff64ec9421a64cd5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-08 21:58:41 +02:00
Volker Hilsheimer
6dab2577bf Constify parameter in QGraphicsItem/Object debug streaming operator
Address FIXME comment.

Change-Id: I55b6e458f2aead9baac8ab3bba7009ad993863e6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-08 21:58:41 +02:00
Volker Hilsheimer
6693befcbb Move code from QTabBar::event to mouseDoubleClickEvent override
Address FIXME comment, convert if/else cascade to switch-statement,
and fix coding style in surrounding code.

Change-Id: Ia883b839d2af314f4abe18e4d7cefa21d77ff7c9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-08 21:58:40 +02:00
Qt Forward Merge Bot
8823bb8d30 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	examples/opengl/doc/src/cube.qdoc
	src/corelib/global/qlibraryinfo.cpp
	src/corelib/text/qbytearray_p.h
	src/corelib/text/qlocale_data_p.h
	src/corelib/time/qhijricalendar_data_p.h
	src/corelib/time/qjalalicalendar_data_p.h
	src/corelib/time/qromancalendar_data_p.h
	src/network/ssl/qsslcertificate.h
	src/widgets/doc/src/graphicsview.qdoc
	src/widgets/widgets/qcombobox.cpp
	src/widgets/widgets/qcombobox.h
	tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
	tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
	tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
	tests/manual/diaglib/debugproxystyle.cpp
	tests/manual/diaglib/qwidgetdump.cpp
	tests/manual/diaglib/qwindowdump.cpp
	tests/manual/diaglib/textdump.cpp
	util/locale_database/cldr2qlocalexml.py
	util/locale_database/qlocalexml.py
	util/locale_database/qlocalexml2cpp.py

Resolution of util/locale_database/ are based on:
https://codereview.qt-project.org/c/qt/qtbase/+/294250
and src/corelib/{text,time}/*_data_p.h were then regenerated by
running those scripts.

Updated CMakeLists.txt in each of
	tests/auto/corelib/serialization/qcborstreamreader/
	tests/auto/corelib/serialization/qcborvalue/
	tests/auto/gui/kernel/
and generated new ones in each of
	tests/auto/gui/kernel/qaddpostroutine/
	tests/auto/gui/kernel/qhighdpiscaling/
	tests/libfuzzer/corelib/text/qregularexpression/optimize/
	tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/
	tests/libfuzzer/gui/text/qtextdocument/sethtml/
	tests/libfuzzer/gui/text/qtextdocument/setmarkdown/
	tests/libfuzzer/gui/text/qtextlayout/beginlayout/
by running util/cmake/pro2cmake.py on their changed .pro files.

Changed target name in
	tests/auto/gui/kernel/qaction/qaction.pro
	tests/auto/gui/kernel/qaction/qactiongroup.pro
	tests/auto/gui/kernel/qshortcut/qshortcut.pro
to ensure unique target names for CMake

Changed tst_QComboBox::currentIndex to not test the
currentIndexChanged(QString), as that one does not exist in Qt 6
anymore.

Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
2020-04-08 20:11:39 +02:00
Joerg Bornemann
48e8f06658 CMake: Add 'opengl' to QT.gui.CONFIG if OpenGL is ON
...like we do in the qmake build.

Change-Id: I1fed28f3294c8556e115c3a86589c98f85554bf8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-08 15:14:09 +02:00
Joerg Bornemann
bb5a505d43 CMake/qmake: Fix qtIsPrefixBuild for a CMake-built qtbase
In addition to .qmake.cache and .qmake.super we check for the
existence of CMakeCache.txt. The top-level non-prefix build part is
prospective, but seems plausible.

Without this fix, non-prefix qmake builds build libs etc. in the wrong
locations, i.e. not in a subdirectory of qtbase.

Change-Id: Ic88efa6c772d49ef92713fe640f004c8a5c849d3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-08 15:14:09 +02:00
Fabian Kosmale
14c55e2979 Revert "QCommonStyle::pixelMetric(): Silence warnings about deprecated enum values"
This reverts commit 82a39f12fa.

Reason for revert: Breaks the 5.15 -> dev merge. Failing tests appear
in tst_qgridlayout.

Change-Id: Ic251df6e06f5505de37376a6b15249762cba5307
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-04-08 12:01:58 +00:00
Simon Hausmann
5422fb7948 Allow declaring QProperty<> based Q_PROPERTYies with a notify signal
This requires mostly making moc a bit more permissive, which has the
advantage that it also simplifies the code a little bit.

The newly added test case demonstrates how to connect such a property
with a change signal.

One test case needed to be changed regarding the callback as the
publicProperty member now has a (permanent) observer and therefore
re-assigning the binding will re-evaluate it as the value might have
changed.

Change-Id: Ia7edcec432de830bdd4e07d943c5d4550c175ca4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-04-08 11:26:39 +02:00
Qt Forward Merge Bot
34adcabc6c Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I34a71ddbc6afb1f12a0a044d0d3876e1af58d60c
2020-04-08 01:01:06 +02:00
Alexandru Croitor
0bfbe10ff2 CMake: Implement proper exclusion of tools including installing
The previous approach didn't work for prefix builds. While a target
might be excluded from building via EXCLUDE_FROM_ALL property, when
calling make install it would still try to install the target and
thus fail.

It's not possible to modify an install() command in a post-processing
step, so we switch the semantics around.

pro2cmake will now write a
qt_exclude_tool_directories_from_default_target() call before adding
subdirectories. This will set an internal variable with a list
of the given subdirectories, which is checked by qt_add_executable.

If the current source dir matches one of the given subdirectories,
the EXCLUDE_FROM_ALL property is set both for the target and the
qt_install() command.

This should fix the failing Android prefix builds of qttools.

Amends 622894f96e

Change-Id: Ia19323a2ef72a3fb9cb752ad2d4f2742269d11c4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-07 23:22:33 +02:00
Alexandru Croitor
5c9ab44ff6 CMake: Simplify semicolon escaping in qt_config_compile_test
list(JOIN) removes a layer of escaping, which force doubling up
on the backslashes. Instead use string(REPLACE) thus making the
escaping a bit saner.

Change-Id: Ie3daf0112dd09fbcbaf8798552949470952611c9
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-07 23:22:33 +02:00
Vitaly Fanaskov
8365322d3d StoredFunctionCall: simplify runFunctor implementation
Task-number: QTBUG-82383
Change-Id: Ib8e196106c80e8f3aba1ff7d0c8b76a547c648da
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-07 17:47:31 +02:00
Timur Pocheptsov
603eaa9fbb H2C - make sure we send the client preface and settings
It's required as a response to upgraded protocol and apparently some
servers would wait for it, not sending any frames. Becomes a problem
in case only one request was sent.

Fixes: QTBUG-83312
Change-Id: I90dc5c04095f0b78baa404466625d329dc4c6e21
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-07 16:46:44 +02:00
Alexandru Croitor
23be07c2d0 CMake: Autodetect Objective-C support only on macOS
On Android, check_language() reports that the languages are supported,
but enable_language fails afterwards.

On Linux it causes issues with the PCH. The PCH file might contain
a Clang pragma, even though the C++ compiler is GCC. Presumably due
to finding a Clang Objective-C compiler.

Change-Id: I1b4c54459772c089e7f6350872c87af52ad72a37
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-04-07 13:04:06 +02:00
Topi Reinio
2d0c7d3d9e Doc: Document QTestStream manipulators under the Qt namespace
The global variants of the manipulators have been deprecated in favor of
the ones in the Qt namespace. However, only one set was documented (the
deprecated ones).

Ensure documentation for both sets is generated, and link to the Qt::
manipulators in QTextStream documentation.

Fixes: QTBUG-82532
Change-Id: I430d15f6d9a34411d1d7265031249e600f6874ef
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-04-07 09:32:19 +02:00
André Klitzing
2a4e6124ac Fix build with macOS 10.15 and deployment 10.12
io/qfilesystemengine_unix.cpp:1420:9: error: 'futimens' is only available on macOS 10.13 or newer [-Werror,-Wunguarded-availability-new]
     if (futimens(fd, ts) == -1) {
         ^~~~~~~~
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/stat.h:396:9: note: 'futimens' has been marked as being introduced in macOS 10.13 here, but the deployment target is macOS 10.12.0
 int     futimens(int __fd, const struct timespec __times[2]) __API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0));
         ^
 io/qfilesystemengine_unix.cpp:1420:9: note: enclose 'futimens' in a __builtin_available check to silence this warning
     if (futimens(fd, ts) == -1) {
         ^~~~~~~~

Change-Id: Ib52adf7b1ec4f1057d8cb260a00da509429cfaed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 2f030c2cf3fe368be217c0e0b157e050d1c27afc)
2020-04-07 08:24:12 +02:00