Commit Graph

44209 Commits

Author SHA1 Message Date
Leander Beernaert
c431e2d33c Refactor Metatypes dependency propagation
Every metatypes.json files is now added as an INTERFACE source file to a
target. This enables us later to correctly collect all the
metatypes.json files from dependent targets. This information is also
correctly exported via export()/install().

To avoid the metatypes.json appearing in every target's source list,
the file path is wrapped in a generator expression which will only be
evaluated when the consuming target has the property
QT_CONSUMES_METATYPES set to true. At the moment this is limited to
targets which need to interact with qmltyperegistrar.

Change-Id: I0ffebcd069a923383f7ed11cde2c94ecf2fb13f3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-10 15:07:34 +00:00
Joerg Bornemann
5b59b2ea15 Doc: Document the ltcg CONFIG value
Fixes: QTBUG-81035
Change-Id: I41bff3aef3ac0ce7c117ab2245491dceb6f2685b
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-02-10 15:09:20 +01:00
Assam Boudjelthia
a84c895b17 Android: Fix native fileDialog not waiting for user selection
Add an event loop to wait for user file selection in native fileDialog

Task-number: QTBUG-77214
Change-Id: I3d97d6c3f46cf2a8ed0ee6f98e555e8d62e12cc3
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-02-10 16:09:20 +02:00
Marc Mutz
b1089787d1 QMimeData: Extract Method QMimeDataPrivate::find()
Centralize the search for the QMimeDataStruct with a given format in
find() (overloaded on const and non-const, but implemented only once),
and use it in the three other functions that performed lookup before.

In setData(), optimize the case where data is overwritten.

Use a std::vector to not have to think about hidden detaches when
implementing the const find() in terms of the non-const one.

Change-Id: I874e5c6ef9c97d98b42f29faccbc3043e8c6a855
Reviewed-by: David Faure <david.faure@kdab.com>
2020-02-10 14:09:12 +00:00
Tor Arne Vestbø
4777c6d76b testlib: Improve error message when detecting line count mismatch
Change-Id: I0e19b4c0dd7aa77063e02e6aac7e345dd7c8a5f5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-10 15:06:14 +01:00
Tor Arne Vestbø
93b8cdc974 testlib: Make testlogs enumerable and printable
Change-Id: Id0ac30fe0a63757ef722634e6dd90806015467aa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-10 15:06:06 +01:00
Dmitriy Purgin
9557715016 std::chrono overload added to QStateMachine::postDelayedEvent()
Some Qt classes already accept std::chrono durations in their methods
(see, for example, QTimer). The proposed change adds an overload
with std::chrono::milliseconds to QStateMachine::postDelayedEvent().

Change-Id: I360fd2bb54fedc7415e9ec17e096095be3604d41
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2020-02-10 15:04:39 +01:00
Jan Arve Sæther
f415c5ad23 Remove unused variable
Change-Id: I774b1647eff5fcfa0de5bcc50ca2638644b03613
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-10 15:04:39 +01:00
Laszlo Agocs
71e9c2f036 rhi: vulkan: Fix descriptor update with more objects involved
Once the number of buffers or images exceeds the QVarLengthArray limit,
it moves over to heap-based allocation, and then reallocated to grow as
needed. Problem is, if we keep references to the elements, those may get
invalidated on every grow. This was not an issue until the element count
reached the preallocated (stack) count.

So instead, store indices and fill in the pointers in the VkWriteDescriptorSet
only before issuing vkUpdateDescriptorSets().

Change-Id: I99f26f5e14cb28107edb1db86a21afa135858589
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-02-10 10:40:02 +01:00
Ulf Hermann
71436d5499 Fix typos in the documentation for Q_REVISION
Change-Id: Ic55ab0dfca0f62e8d29a4e7d41384bed6fb1da62
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-10 10:20:20 +01:00
Thiago Macieira
23d42a6a30 QStorageInfo/Linux: resolve non-existent devices via /dev/block
On systems with very simple boot sequences, the kernel will create a
device called /dev/root and use that to mount the root filesystem.
However, that doesn't actually exist in /dev and could cause
confusion. So we try to resolve using /dev/block if the /dev entry does
not exist but udev is in use (udevd has the string "/dev/%s/%u:%u").

[ChangeLog][QtCore][QStorageInfo] Improved discovery of device nodes on
Linux if the /dev entry was renamed after the filesystem was mounted and
udev is in use.

Fixes: QTBUG-81464
Change-Id: If79a52e476594446baccfffd15eec573ae3deb0d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-09 22:19:20 -08:00
Marc Mutz
6b9a1824a4 Extend tst_qstringapisymmetry for member compare()
There were a few surprises:

- QByteArray::compare() are missing noexcept (will add)
- ibid., called with non-ascii content and CaseInsensitive fails
  (this was discussed on the ML, with tentative agreement that
  it's a feature, not a bug; waiting for QUtf8String(View) for a
  fix, then).
- As was the case when we did this exercise with the relational
  operators, QString(Ref)/QChar is not noexcept (will fix)

These have been QEXPECT_FAIL'ed.

Not much of the cartesian product is implemented at all, yet.  These
have been #ifdef'ed with NOT_YET_IMPLEMENTED to see what's still
missing.

Change-Id: I7d9b21e292b98f980aacdc6248e88188f7472ba2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-09 17:43:20 +00:00
Lars Knoll
7caaf4eb7f Don't rely on iterators being stable while modifying the hash
The Mapping struct referred to where it got inserted into the
source_index mapping table by a const iterator to the table. That
is rather fragile, as changing the table invalidates the iterator.

It happened to work with QHash in Qt 5, but will break with the new
implementation in Qt 6.

Instead simply store the key in the Mapping struct so that it can
be quickly found in the hash.

Also fix one place, where we unconditionally call erase on an iterator
returned by constFind(). Turns out constFind() did sometimes not find
the item in question and returns end().

Change-Id: I0420a06d496f640a3150478e8c644d4cc669ceff
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-09 17:41:52 +01:00
Tor Arne Vestbø
dfaa61482c Blacklist tst_QGuiApplication::quitOnLastWindowClosedMulti on macOS in CI
Change-Id: I55cb9a6b3aebac68fb1b20127ba7aa501b4a3f2b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-08 14:01:11 +01:00
Olivier Goffart
4933a5f892 Use C++17 for qmake and force the build of everything with C++17
We will want to use C++17 code in our headers soon.
(including the one in the bootstrap libraries)

This patch is quick and dirty, I guess it will be cleaner once we move to cmake

Updated QMAKE_MACOSX_DEPLOYMENT_TARGET because 10.13 runtime does
not support C++17 stdlib features

Change-Id: I75ac171436945dddd1bb953a9c8d323ac20da7ac
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-08 09:49:07 +01:00
Timur Pocheptsov
1a54165756 QMacStyle: fix NSBox geometry for Aqua theme
Apparently vertical shift and increased height were not enough, more
adjustment needed horizontally also: the default NSBox draws itself
smaller in both dimensions and shifted from the origin we wanted.
Thus we trick it to think it's drawing a bigger thing. It will
draw a smaller one (again), but closer to what we need.

Fixes: QTBUG-72365
Change-Id: Ib3a4c0b3eafb9f2f9d3b24bcbdd8335e73053622
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-08 05:58:38 +01:00
Qt Forward Merge Bot
9634055543 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I5d80d84d1fd9f52e7c8e4895cc34d4d29043f400
2020-02-08 01:00:08 +01:00
Mårten Nordheim
3568ad58f5 Introduce a configure-time check for C++17 filesystem
Various compilers have various fun ways of failing to compile when it
is used so let's check if they will work properly during configure
rather than much later.

Change-Id: Ia93d4b91b3d269b4cab2a5f677c3c89e06b44ce3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-07 23:51:06 +01:00
Ulf Hermann
f64694647a moc: Extend revision markers to allow for major and minor version
As we want Qt's own revisions to follow the Qt versioning scheme, we
need to allow for the minor version to reset to 0 now. In order to
facilitate this, we interpret the argument passed the current Q_REVISION
macro as major version and allow for an optional minor version. Both are
encoded it into the resulting revision number.

Change-Id: I3519fe20233d473f34a24ec9589d045cdd162a12
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-02-07 21:23:55 +01:00
Christian Ehrlicher
0eb922a4e9 QtSql: remove deprecated signal 'notification(QString)'
It was deprecated in Qt5 and the replacement signal with three arguments
can be used instead.

Change-Id: I6d0db8d9fa9bea2039c548e32bc39a8173403c3a
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-02-07 20:22:45 +01:00
Christian Ehrlicher
947d1eaaa4 QtSQL: remove SQLite2 and TDS driver for Qt6
They were deprecated in Qt4 (TDS) and 5.14 (SQLITE2) so they can be
removed now in Qt6

[ChangeLog][QtSql] Removed obsolete TDS and Sqlite2 drivers

Change-Id: I55118fb03106564d519a99ab55f9b5cf528179f3
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-02-07 20:22:44 +01:00
Jarek Kobus
e14e5e104d Replace the QMatrix field of QTransform with qreal[3][3]
Remove temporarily the reference returned by QTransform::toAffine()
since we don't keep the QMatrix object internally anymore.
This is done in order to compile the rest of the code.
The follow-up patch is going to remove that method completely.

Task-number: QTBUG-81628
Change-Id: If7140eedb7582d81ac8da529017cf792174e86ab
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-07 20:05:41 +01:00
Alexandru Croitor
1c571e5fe7 Merge "Merge remote-tracking branch 'origin/wip/cmake' into dev" 2020-02-07 18:19:51 +00:00
Ulf Hermann
2145cdc54d Core: Provide comparison functions for QTypeRevision
The unspecified segment is between 0 and 1. This is because
QTypeRevision::zero(), as the default revisision needs to be smaller
than any other. At the same time we want explicitly specified non-zero
revisions to be larger than unspecified ones. Breaking this down on a
per segment level gives us the order shown here.

Change-Id: I1cca12f1180eb6f77563fb5b22c3400e118dc5e9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-07 19:19:50 +01:00
Mårten Nordheim
2c189ac79b QMultiMap: fix QDoc warning
The iterator is a QMultiMap iterator, not QMap, so the QDoc would
complain.

Change-Id: I1e3d2b454e21049d676387945e1e860e50854de8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-07 18:13:54 +01:00
Mårten Nordheim
360d9fba23 Use posixpath when generating relative path
Fixes generating some paths with the backslash in the beginning

Change-Id: Ic7705d61f9362d3b854b2eb95f95a8951beca72d
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-02-07 13:57:59 +00:00
Alexandru Croitor
abc2e51041 Fix cross compilation builds with template v2
Make sure to split the command arguments after variable substitution
like it is done in call_cmake.yaml.

Amends d445112cc0

Change-Id: Id23fcfa5b58c33e05495413fb10349fbcff1bfac
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-07 12:37:10 +00:00
Volker Hilsheimer
e79979ba40 On Windows 7, fall back to SHFileOperation to avoid confirmation dialogs
Moving a file to the trash should preferably done via IFileOperation.
However, the implementation on Windows 7 ignores the operation flags
that request the shell not to show any confirmation dialogs or other UI
elements.

SHFileOperation is an old API that doesn't show any UI, but has the
limitation that it doesn't report the location of the file in the trash
after the move. So an application cannot restore the file, but the user
can do so via Explorer.

Overall, the better compromise is to not have dialogs at the expense of
not being able to report the new path. This allows us to run the unit
test on Windows 7 as well.

Change-Id: Ib8e651a69e2c6750f668b52d2a70925d156cc8ae
Fixes: QTBUG-81927
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-02-07 12:21:13 +01:00
Liang Qi
d445112cc0 cmake: upload artifact for qtbase android build and etc
Task-number: QTBUG-78945
Change-Id: I3361e63ed4830ac0e1ebb9d4b9495df09c45f476
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-07 10:05:51 +00:00
Eskil Abrahamsen Blomfeldt
78da102810 Make text decorations consistent between ways of drawing text
The drawGlyphRun() and drawStaticText() functions would calculate
the horizontal origin of the decorations based on the left-most edge
of the left-most glyph, in practice including the left bearing of
that glyph in the position. But in drawText()/QTextLayout it will
always be drawn from the position given as input by the user of the
function.

The inconsistency was detected in an upgrade of Harfbuzz NG, where
the tests on macOS would get a -0.05 left bearing, and as a result
the decorations would be painted one pixel to the left in
drawGlyphRun()/drawStaticText() compared to QTextLayout.

It is not a big deal in practice, but in order to get the Harfbuzz
update in, we fix the inconsistency now, by passing the user-input
position into the decoration function.

This was also an opportunity to consolidate the two code paths, and
to unexport the qt_draw_decoration_for_glyphs() symbol, which was
exported in Qt 4 only to be usable by Qt Quick 1.

Change-Id: I243404b2710ae378e84d7587efae719da3879944
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-07 08:54:11 +01:00
Eskil Abrahamsen Blomfeldt
31911d387b DirectWrite font db: Fix unstretched font selection
A typo in the conversion between DirectWrite stretch and Qt stretch
caused all unstretched fonts to be registered as ultra-condensed.

Change-Id: I2ec64fcef44cc6259946b761a7bfac0ce191971e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-07 08:54:11 +01:00
Timur Pocheptsov
4c4b5a97c3 Skip test cases that is failing on macOS >= 10.14
bind on port 1/82 is now success, in QTcpSocket's test things are more
broken: changing the test row makes the test flaky with port not available
due to the previous test case.

Task-number: QTBUG-81905
Change-Id: Iaf1b5457fa3961a4f6bc92b79aa4668a8359136e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-07 08:54:11 +01:00
Volker Hilsheimer
5c520f4b0a Discover the conditions under which registerTimer is flaky, and skip
On macOS, the registerTimer test case fails frequently, and blocks
valid integrations. With this change we try to detect the condition
and skip the test.

Change-Id: Id2065f606abfd431971becf63034a4c1f0fdb9e5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-07 04:51:16 +01:00
Wang Chuan
75285b64ad QComboBox: send font change event to popup menu when font changed
The font change in QComboBox might cause incorrect appearance of popup
menu since it doesn't notify popup menu to relayout itself

Fixes the issue by send font change event to the item view of popup
menu when received a font change event in QComboBox

Fixes: QTBUG-75846
Change-Id: I4821015cca95a7e233a22262596a6fbf27f10aef
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-02-07 09:18:47 +08:00
Tor Arne Vestbø
8237e39f5d testlib: Move subtest argument handling to individual tests
The test orchestrator shouldn't have to deal with the individual options
needed for each test.

Change-Id: I78bbf4850cc649e625bd08a7aedf02267ba1314d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-06 23:43:05 +01:00
Tor Arne Vestbø
dbdb3cbc90 Reduce scope of testlib selftest regular expressions
Change-Id: I2fd7a39684bde44d82c4d877086f606413d68520
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-06 23:43:04 +01:00
Tor Arne Vestbø
a2832c577f Remove tst prefix for testlib selftests
These tests are apparently not run at the moment, otherwise they would
have failed to even start, but they should definitely not have the tst
prefix.

Change-Id: Iafcec2764ebb3570e6bc6ebfba27d92a94639893
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-06 23:43:02 +01:00
Tor Arne Vestbø
1a58e78db0 testlib: Be more selective in choosing to show stacktraces on macOS
The built in crash reporter on macOS will by default not show the
dialog if the application is not one that will run in the foreground.

Change-Id: I0020520ae2f14a0e2f84fdca1d80ec6fe1247ffd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-06 23:42:55 +01:00
Alexandru Croitor
b06f086460 Don't add private module headers for private modules when not needed
If a module has the NO_MODULE_HEADERS option, we should not add
the private module header paths to the BUILD_INTERFACE of private
modules.

This fixes building static non-prefix qtdeclarative builds on Linux,
where non-existent QtXcbQpa headers failed the qtdeclarative
generation step.

Change-Id: Ic9fdd8c5688d3449576eb8a5dd852c252e29bf5b
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-06 21:43:14 +00:00
Christian Ehrlicher
f9cd8fef5e QPushButton: fix text truncating when icon+text+menu is drawn
When a QPushButton has an icon, text and menu, the text is truncated. In
RTL mode the menu indicator is also drawn on the wrong side.

Fixes: QTBUG-81784
Change-Id: I27ecb67d12c68ac939540f0f836b2e2875706b4b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-06 18:00:26 +01:00
Volker Hilsheimer
ef7773e566 Doc: QPersistentModelIndex cannot be stored in a QStandardItem
As discussed in the bug report, making sure that the reference counts
are correct in such scenarios adds substantial complexity to the code,
only to support a bad use-case for which QStandardItemModel was not
designed.

Change-Id: I663b490ed3471875386add17e7eadb7d8df50489
Fixes: QTBUG-78142
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-06 16:46:21 +00:00
Andy Shaw
eb45c37be7 sqlite: Update to v3.31.1
Since the patches applied previously are no longer required, we have
removed those too.

[ChangeLog][QtSQL][sqlite] Updated to v3.31.1

Change-Id: Ia80c31683a8cf92cfd114b6da32460ddcf38d502
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-06 17:46:21 +01:00
Friedemann Kleint
e9efd96e62 uic/Python: Add imports for Q(Date)Time, QKeySequence
Those types are used as properties of Q(Date)TimeEdit,
QKeySequenceEdit.

Fixes: PYSIDE-1215
Change-Id: I8b9ffebb8229fff447aa7dd6bee6e037d708333c
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-02-06 17:46:21 +01:00
Mårten Nordheim
b14ee53a08 Add necessities for qtquick3d
Change-Id: I39aadda7ed2b088a475ba5f940d1cb65b5b62f94
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-06 13:22:34 +00:00
Leander Beernaert
cb1fbfa1a0 Remove qt_add_qml_module() from QtBuild
This bit is being move to QtDeclarative as it is not required to build
QtBase.

Change-Id: I7b559b8b0e33e66d92c97c93bc43b650e7150237
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-06 12:22:09 +00:00
Leander Beernaert
2c297ac598 Load module specific extensions for QtBuildInternals
This patch enables each module to load their own
Qt${version}ModuleBuildInternals.cmake to expose module specific
features when building Qt.

These scripts are only loaded when the package QtBuildInternals has been
loaded.

Change-Id: Ie58dd93ddd292cf106fe7ef147151a51fd5aa2b1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-06 12:21:58 +00:00
Leander Beernaert
a43f2a6caa Safeguard against multiple definition of dbus-1 target
Change-Id: Ibba9ce7ce472fe2939386065087f0b07ad811c3f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2020-02-06 12:21:49 +00:00
Laszlo Agocs
19510abbff rhi: Add depth bias and slope scaled depth bias
Beware of the API terminology: GL 'factor' = 'slope scaled depth bias',
GL 'units' = '(constant) depth bias'.

Task-number: QTBUG-81843
Change-Id: I03e3618d007cbf7100add0de4950a6163d788cc7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-06 13:06:34 +01:00
Laszlo Agocs
7e82d49cc5 rhi: d3d: Make DepthClipEnable set to true
...which is the natural default, and matches other backends.

Task-number: QTBUG-81852
Change-Id: I6d0788b18eb7601661ef646e650114a503a12215
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-06 13:06:28 +01:00
Laszlo Agocs
1d77945094 rhi: metal: Make sure the resources are sorted based on the native bindings
...before generating batches for the encoder's set* methods. Otherwise there
is a chance we end up in an assertion in case the native binding number for
a buffer/texture/sampler happens to be smaller than the native binding of the
previous. (we pre-sort based on the SPIR-V binding but that is not what the
Metal API works with in the end)

Task-number: QTBUG-81822
Change-Id: Iddfed168e065e3c7f6a09ad6dd4efdafa891b339
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-06 13:06:23 +01:00