Commit Graph

10427 Commits

Author SHA1 Message Date
Volker Hilsheimer
b4669b9190 QMenu: hide when a QWidgetAction fires the trigged signal
QMenu hides regularly when the user interacts with it, and manages
the firing of signals based on that. It ignores if a QAction that is
added to it fires the triggered() signal programmatically.

With QWidgetActions added to the menu, the menu usually doesn't get
interacted with directly, as the widget gets the input events.
Since the action can be added to multiple menus, neither widget nor
action can interact with the menus programmatically. Instead, the
menu needs to hide when the widget action triggers.

Test included that covers the case where a QWidgetAction is added
to multiple menus that are visible. Documentation updated, and
removed a redudant paragraph as a drive-by change.

[ChangeLog][QtWidgets][QMenu] a popup menu hides when a QWidgetAction
added to it fires the triggered signal.

Change-Id: I69f378426a45c2e46cebdaa5e6f1b21c8fb03633
Fixes: QTBUG-10427
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-03-03 18:52:11 +01:00
Edward Welbourne
466d32160a Suppress warnings where QString and its tests use SplitBehavior
This is a follow-up to commit 895939c7f9
to fix deprecation warnings it added.

Change-Id: I3d86655ec2c84c1bdcac9c70436075fc78f2f781
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-03 17:34:16 +00:00
Mårten Nordheim
8f8eb99991 QNetworkReply: Deprecate 'error' signal, use 'errorOccurred' instead
[ChangeLog][Deprecation Notice] QNetworkReply::error() (the signal) is deprecated; superseded by errorOccurred()

Change-Id: I4f1ef410fd22d34ddf87e89cc5709cc60703af95
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-03 18:25:57 +01:00
Laszlo Agocs
0378332bc1 rhi: Use versioning in QShaderDescription serialization as well
This is the first time that we add something to QShaderDescription
after migrating to the non-JSON based serialization system. This now
involves checking the "qsb version" when deserializing.

Task-number: QTBUG-82624
Change-Id: I2bd875ef21e461559b878dccc5537cdfa43feaa2
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-03-03 18:25:57 +01:00
Qt Forward Merge Bot
60ec012d8d Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I851c0328c3c38ea67b5ad115b205ac6a1262706e
2020-02-29 01:00:44 +01:00
Edward Welbourne
305ddbeb5b Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: I399b5ea56e9255e775ca1746632f7421519a6616
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-28 15:37:11 +01:00
Edward Welbourne
26b1cf2bba QMake: Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: I3f1b836cfb47bba0fdc27f2c3aa7b0576d123dca
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:37:11 +01:00
Edward Welbourne
00f0863cbe Core: Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: I446f9ddc8f8de4a0b79b09edb44f7c1496fbc33f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-28 15:37:11 +01:00
Volker Hilsheimer
4a1de178c9 Try again to make QDeadlineTimer test robust against context switches
Instead of comparing to absolute values, compare the result from
QDeadlineTimer with the reference clock types from std::chrono. Pass
the test as long as we are within 10% of that reference.

In addition, handle the case where QTest::qSleep sleeps for more than
10% longer or shorter than what is requested, and if so, abort the
test.

Change-Id: If8b77aea55a8c5c53e96427b2fff2f78281d0f82
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:15:42 +01:00
Shawn Rutledge
7447e2b337 QTextMarkdownImporter: fix use after free; add fuzz-generated tests
It was possible to end up with a dangling pointer in m_listStack.
This is now avoided by using QPointer and doing nullptr checks before
accessing any QTextList pointer stored there.

We have 2 specimens of garbage that caused crashes before; now they don't.
But only fuzz20450 triggered the dangling pointer in the list stack.
The crash caused by fuzz20580 was fixed by updating md4c from upstream:
4b0fc03077

Change-Id: I8e1eca23b281256a03aea0f55e9ae20f1bdd2a38
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2020-02-28 09:31:59 +01:00
Alexander Akulich
4c86e667d2 Revert "QNetworkReply: deprecate the 'error' getter"
This reverts commit ccb2cb84f5 and
commit 0f568d0a67.

The patches fix ambiguity between a getter and a signal by changing the
getter name, but we still have to rename the signal to follow the signals
naming convention.

Revert the commits to keep the getter as is and change the signal name instead.

Change-Id: Iddbab7c33eea03826ae7c114a01857ed45bde6db
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-28 07:21:14 +03:00
Robert Loehning
cb1145fb26 Fuzzing: Add fuzz target for QCborValue::fromCbor
Change-Id: I59fbab99849a23c553520db33d6c7182dc7b114d
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-27 19:36:30 +01:00
Lars Knoll
bb802b4318 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-02-27 19:35:43 +01:00
Volker Hilsheimer
924b97d6ab Fix QDateTimeEdit's handling of invalid time in dst gap
During a spring forward, a time-zone omits an hour. A QDateTime with
such an hour is invalid, but QDateTimeEdit's handling of this invalid
time was not done correctly.

With this fix, up/down changes of any field that would result in an
invalid date-time corrects the time to be valid, while leaving as
much as possible of the user-entered data unchanged. To do that, we
rely on QDateTime::toMSecsSinceEpoch to return a value even for such
an invalid time, which then can be used to construct a valid
QDateTime.

Edits that would result in an invalid hour are reverted to the
previous when pressing return, if correctionMode is
CorrectToPreviousValue. This change also implements support for
CorrectToNearestValue, which uses the same mechanism as when stepping
over an invalid time.

Include a test that verifies that the various interactions result
in a reasonable value. Since QDateTimeEdit does not respect the
timezone or timespec of the QDateTime it is initialized with, we
have to find the first hour of daylight saving time for a year
that we know works for most time zones. Failing that, we have to
skip the tests. Verified in a wide range of time zones.

Change-Id: I05b906ae3b5f6681891d23704f00f9c10cd479ae
Fixes: QTBUG-79803
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-27 19:35:28 +01:00
Volker Hilsheimer
31b06a0437 QWizard: deprecate visitedPages and add visitedIds instead
As per the ### Qt 6 comment. A method visitedPages should, following
the convention of the other QWizard APIs, return a list of QWizardPage
pointers. Since the method returns a list of IDs, visitedIds is the
correct name.

[ChangeLog][QtWidgets][QWizard] visitedPages has been deprecated, use
visitedIds instead.

Change-Id: Ifdb94adf093be14cb48c84cb40818c55ff5189a0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-02-27 19:35:19 +01:00
Lars Knoll
5c6c0289f0 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I4212d070d5752275085e754b96f0392113604dba
2020-02-27 14:22:01 +01:00
Alexander Akulich
cb26a4da69 QAbstractSocket: deprecate 'error' signal, use 'errorOccurred' instead
[ChangeLog][Deprecation Notice] QAbstractSocket::error() (the signal) is deprecated; superseded by errorOccurred()

Change-Id: I11e9c774d7c6096d1e9b37c451cf0b99188b6aad
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-27 13:56:45 +01:00
Volker Hilsheimer
715468df40 Fix flaky QElapsedTimer::elapsed test case
Much of this test case was testing that the machine it runs on didn't
take more than an expected amount of time, which is an assumption that
won't hold in a virtual environment where the hypervisor might decide
to not allocate any CPU time to the machine at certain times.

Instead, take the samples that we want to compare with once, then
use them as reference for further comparisons.

Also, split the test in two, with the comparison operators and msecsTo
test moved into a separate test function.

Change-Id: I7db12b8e02552f4d63af933c1b0fee9d62b591eb
Fixes: QTBUG-58713
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-27 10:36:57 +01:00
Volker Hilsheimer
6324873543 Stabilize task255529_transformationAnchorMouseAndViewportMargins
This test doesn't test whether window activation works, so there is
no reason to fail the test if it doesn't. Instead, abort the test, so
that we can record it as a skipped test.

Change-Id: Ia44308ef17f110d40c6455d7ee85d90914face4f
Fixes: QTBUG-22455
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Levon Sargsyan <levon.sargsyan@qt.io>
2020-02-27 10:24:09 +01:00
Allan Sandfeld Jensen
25677ec4b2 Fix bounding box of zero-width entities in QFontEngineFT
Freetype can give us non empty bounds for zero-width characters,
this change just makes us skip metrics of characters already found to
not contribute to text advance. The coretext and windows
font-engines already uses the already calculated advance.

Change-Id: I82b3521a4fb92614be509be5982cd5ab9c1eb7de
Fixes: QTBUG-58854
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-02-27 08:59:08 +00:00
Volker Hilsheimer
8b9a025373 Make QDeadlineTimer test more resilient against VM starvation
Flaky fails in this test suggest that the VM on which the
test is executed does not get CPU resources allocated for enough time
to make this test pass. This change makes the test more resilient by
taking the measurements as quickly as possible.

In addition, use a sanity-check based on std::chrono APIs to abort the
test completely if we see that the clock has advanced too far to make
the following tests meaningful.

Change-Id: Ie6ac4ffb52f20e7774014f8222c9cd8f54d8a263
Fixes: QTBUG-64517
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-26 23:26:23 +01:00
Lars Knoll
fd4be84d23 Add an expansion limit for entities
Recursively defined entities can easily exhaust all available
memory. Limit entity expansion to a default of 4096 characters to
avoid DoS attacks when a user loads untrusted content.

Added a setter and getter to allow modifying the expansion limit.

[ChangeLog][QtCore][QXmlStream] QXmlStreamReader does now by default
limit the expansion of entities to 4096 characters. Documents where
a single entity expands to more characters than the limit are not
considered well formed. The limit is there to avoid DoS attacks through
recursively expanding entities when loading untrusted content. The
limit can be changed through the QXmlStreamReader::setEntityExpansionLimit()
method.

Fixes: QTBUG-47417
Change-Id: I94387815d74fcf34783e136387ee57fac5ded0c9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-26 22:08:38 +01:00
Alexander Akulich
6d18e4a2b8 Revert "QAbstractSocket: deprecate 'error' member-function"
This reverts commit 94b3dd77f2.

The patch fixes ambiguity between a getter and a signal by changing the
getter name, but we still have to rename the signal to follow the signals
naming convention.

Revert the commit to keep the getter as is and change the signal name instead.

Change-Id: I0dd60cf1ae9d1bd95beeb8ad58661ca4b1fb63b9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-26 23:07:52 +03:00
Marc Mutz
e5acaa12e3 QObject: treat T* -> bool conversions as narrowing
Following wg21.link/LWG3228, it was found that a proper variant fix
requires that T* -> bool conversions be treated as narrowing
conversions in subclause wg21.link/dcl.init.lst. wg21.link/P1957R2 was
accepted in Prague 2020 as a DR and retroactively applies to older C++
standards.

Since we hard-code the algorithm of [dcl.init.lst], we can and must
add this manually.

[ChangeLog][QtCore][QObject] For the purposes of
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT, pointer
(incl. pointer-to-member) to bool conversions are now considered
narrowing. This matches the resolution of a defect report in C++
itself.

Change-Id: Ifa9a3724c9c8ccd3dd6614928dbbe37477591dc1
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-02-26 07:48:47 +00:00
Qt Forward Merge Bot
226533fd85 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iad459349ea8b4090d79b4771bfff8f656a8a8189
2020-02-26 01:00:08 +01:00
Friedemann Kleint
3c4078ca02 tst_QSettings: Fix leaking registry key
On Windows, the test was leaking a registry key
HKEY_CURRENT_USER\Software\tst_QSettings_trailingWhitespace
Fix by using .ini-Format in the temporary directory created by the test.

Amends e66a878838.

Task-number: QTBUG-22461
Change-Id: If141a9e72e8faebc3fc46b94dab7b4b728a75292
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-25 20:16:20 +01:00
Liang Qi
4403ec3bc1 tests/xcb: fix tst_QWidget::updateWhileMinimized() on mutter/GNOME Shell
Task-number: QTBUG-68862
Change-Id: I6247867ae4ec126ab0549741f2d2d491a7f2e8a0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-25 18:58:17 +01:00
Friedemann Kleint
a5ea2f7e99 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ibe5b4aa249863a54007180f3684dc5ce1b23cb7b
2020-02-24 08:40:45 +01:00
Christian Ehrlicher
875420f1c2 QAbstractItemView: Make sure to update the editor geometries
QAbstractItemView::setIndexWidget() does not trigger a relayouting when
a new widget is set. This results in a wrong editor geometry under some
circumstances. Fix it by triggering a delayed relayout.

Fixes: QTBUG-81763
Change-Id: I75d0e19bd5e56d63effe4990d782d202fb39e3e6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-23 10:48:53 +01:00
Timur Pocheptsov
c58ee54a70 tst_qtcpsocket::bind - amend the recent fix
0. The recent patch fixed the case when we can suddenly (meaning from
a particular version of Darwin) bind on a port number 1. Unfortunately,
it's not the case for IPv4 and while fixing one test case, the patch broke
another - so this patch addresses this.
1. Unfortunately, binding on a fixed port 1 on macOS made the test flaky
- we run this 'bind' several times and sometimes OS thinks port is already
bound (because of the previous test case) - closing the connection seems
to fix this problem (thus this patch do this also).
2. As a bonus a proper resource management added (aka RAII) where we would
previously leak a socket in case some QCOMPARE failed.

Fixes: QTBUG-81905
Change-Id: I90c128a332903bb44ab37de4775ca00d390dc162
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-22 03:36:54 +01:00
Volker Hilsheimer
962a3d8a98 Stabilize QFileSystemModel::dirsBeforeFiles test
Make the test operate in its own temporary directory, so that entries
left behind by other test functions don't impact this test.

Also, call QFileSystemModel::sort explicitly; it would otherwise only
be done once through a single-shot timer, and the test processes events
until the model is populated, which might not process that delayed
sorting. Since dirsBeforeFiles tests the sorting algorithm and not
the sorting logic, best to do this explicitly.

In case of sort failure, print diagnostics.

Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Fixes: QTBUG-75452
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 4e796e0b0d)
Change-Id: I144b68a17280a38cc7d6daf7ec343eea4453623d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-22 02:52:44 +01:00
Volker Hilsheimer
1ce3585305 Detect double timer during single timeout in registerTimer test, and skip
We observe this happening on macOS in the CI system, and it might happen
if a VM doesn't get CPU cycles for long enough time so that two timers
time out. Then event processing will process two timer events, and we
overwrite the timerIdFromEvent with the second event.

Instead, skip the test when this happens.

This is an ammendment to 5c520f4b0a

Fixes: QTBUG-71751
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 67491e2df5)
Change-Id: I30eef8cfc94988e6cad500dd5e6722488c2985be
2020-02-22 02:52:36 +01:00
Volker Hilsheimer
c3951470ca 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.

Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5c520f4b0a)
Change-Id: I97644b5b4654b4c96fbc99858bbf191e6edb5977
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-22 02:52:24 +01:00
Qt Forward Merge Bot
65cafea797 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iace12004afdfe765a3068dfcf6f1320c1123c539
2020-02-22 01:00:07 +01:00
Laszlo Agocs
2940c375e4 rhi: Allow querying the native buffer objects behind a QRhiBuffer
Modeled after QRhiTexture's NativeTexture query.

This becomes valuable in advanced cases of integrating external native
rendering code with Qt Quick(3D), because it allows using (typically
vertex and index) buffers created by Quick(3D) in the custom renderer as
well, without having to duplicate the content by manually creating native
buffers with the same vertex and index data.

Change-Id: I659193345fa1dfe6221b898043f0b75ba649d296
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-02-21 09:15:18 +01:00
Laszlo Agocs
79b605d285 rhi: Fix building hellominimalcrossgfxtriangle on macOS
Change-Id: I55fa7d4d122750ca7ab90559026f4f4fcdf11663
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-02-21 09:15:10 +01:00
Laszlo Agocs
efba2530f9 rhi: Do not rely on unspecified relation between readbacks and FramesInFlight
Add a new queriable resource limit value MaxAsyncReadbackFrames. Change
the autotest to rely on this instead of relying on the unspecified,
works-by-accident relation between readbacks and FramesInFlight. This
way even if the behavior diverges in some backend in the future, clients
(well written ones, that is), will continue to function correctly.

Also clarify the docs for FramesInFlight, and change d3d and gl to return
the correct value (which is 1 from QRhi perspective; the expanded docs now
explain a bit what this really means and what it does not).

Change-Id: I0486715570a9e6fc5d3dc431694d1712875dfe01
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-02-21 09:15:05 +01:00
Volker Hilsheimer
f79efbc867 Un-blacklist QFileSystemModel::dirsBeforeFiles
After 4e796e0b0d we only have blacklisted
passes in the database, and no flaky failures on macOS.

Exception is WinRT, which stays blacklisted.

Change-Id: Ie1c492d20c76d4ba12b3f513ac038f023b864cb1
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-20 11:23:44 +01:00
Friedemann Kleint
e0225d8bee Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-02-20 08:36:03 +01:00
Friedemann Kleint
41ecb6abbf Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ide8768d0d95aaeec943658aea27a03737d7dbf3f
2020-02-20 08:34:46 +01:00
Volker Hilsheimer
1821f5163d Fix font and palette propagation for themed children created at runtime
Widgets have a default palette and font that is influenced by several
factors: theme, style, QApplication-wide overrides, and the parent's.
If an application sets a font or palette on a parent, then widgets
inherit those settings, no matter when they are added to the parent.

The bug is that this is not true for widgets that have an application-
wide override defined by the platform theme. For those, we need to merge
parent palette and font attributes with the theme, and this is currently
not done correctly, as the respective masks are not merged and inherited.

This change fixes this for fonts and palettes. Children are inheriting
their parent's inheritance masks, combined with the mask for the
attributes set explicitly on the parent. This makes the font and palette
resolving code correctly adopt those attributes that are set explicily,
while leaving everything else as per the theme override.

The test verifies that this works for children and grand children added
to a widget that has a palette or font set, both when themed and
unthemed. Children with own entries don't inherit from parent.

The QFont::resetFont test had to be changed, as it was testing the
wrong behavior. If the child would be added to the parent before the
font property was set, then the test would have failed. Since this
change makes sure that children inherit fonts in the same way, no
matter on when they are added to their parent, the test is now
modified to cover both cases, and ensures that they return identical
results.

[ChangeLog][QtWidgets][QWidget] Fonts and palette settings are inherited
by children from their parents even if the children have application-
wide platform theme overrides.

Change-Id: I179a652b735e85bba3fafc30098d08d61684f488
Fixes: QTBUG-82125
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-02-20 08:04:47 +01:00
Nicolas Guichard
f9086ebd01 QShaderGenerator: Allow more expressions in input nodes
Currently QShaderGenerator will crash when encountering some expressions
in input nodes.

For example, this node prototype would make it crash:
"VERTEX_COLOR": {
  "outputs": ["color", "alpha"],
  "rules": [
    "headerSnippets": ["in vec4 vertexColor;"],
    "substitution": "vec3 $color = vertexColor.rgb;
                     float $alpha = vertexColor.a;"
  ]
}

Change-Id: I37abb8099d376843a4cb13228140467dc1b8f60c
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-20 08:00:20 +01:00
Nicolas Guichard
39994e0705 QShaderGenerator: Don't crash when a node has multiple outputs
It was already possible to declare a node prototype with multiple
outputs, but trying to assign to all those outputs was not possible and
instead resulted in a crash.

It is now possible to declare nodes like this without crashing:
"SEPERATE_XYZ": {
  "inputs": ["vector"],
  "outputs": ["x", "y", "z"],
  "rules": [
    {
        "substitution": "float $x = $vector.x;
                         float $y = $vector.y;
                         float $z = $vector.z;"
    }
  ]
}

Change-Id: I748e77e84c9120dc688c573eee33dc13c6bfbace
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-20 08:00:14 +01:00
Tor Arne Vestbø
8c3cc07bf5 widgets: Translate QWindow move events into widget relative position
If a widget backed by a QWindow is moved we need to translate the window
geometry into a position relative to the parent widget. In most cases this
was incidentally working due to widgets backed by QWindows always having
QWindow parents too, so the QWindow position was applicable to the widget
as well. But when Qt::WA_DontCreateNativeAncestors is used this is no
longer the case, and we would end up with a widget geometry that included
the parent positions all the way up to the next native widget.

The updatePos() function has been squashed into handleMoveEvent(), since
we need to ensure the position in the move event sent to the widget is
correct as well.

Change-Id: I55894ad7ab42a6d4d65e446a332ecdd7dcdcc263
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-19 20:04:19 +00:00
Nicolas Guichard
7981dbfaf3 QShaderGraph: don't generate statements with undefined inputs
This fixes the shader generation for graphs like this one:

                 Function0 ------> Output0
            (with unbound input)

   Input ------> Function1 ------> Output1

With those graphs, createStatements will not return any statement for
nodes Function0 and Output0.

Change-Id: Iec32aa51623e176b03ae23e580f06d14df80a194
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-19 17:39:51 +01:00
Shawn Rutledge
b1b37a36cb Test QImageReader::setScaledClipRect() more realistically
Ensure that each image plugin really clips within the scaled coordinate
system, as documented. Always clipping from 0,0 wasn't interesting.

Task-number: QTBUG-81044
Change-Id: Ic06fe52f92f719e1ff9c0348f667215e53b60fb0
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-19 13:28:01 +01:00
Nicolas Guichard
49dbe760e4 Fix QShaderGenerator crashing when a node port name prefixed another one
QShaderGenerator didn't handle substitutions like
`vec4 $color = mix($color1, $color2, $fac);`

Note that `$color` is a prefix to `$color1` and `$color2`. For the
substitution `QByteArray::replace` was used so if `$color` was handled
first and replaced by `v1`, `$color1` and `$color2` were never correctly
replaced and instead became `v11` and `v12` which caused a crash later
on.

Change-Id: Idaf800fdac468f33c323eb722701da5f8eb918d6
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-19 08:47:58 +01:00
Liang Qi
fd49b4a2b9 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-02-18 22:13:18 +01:00
Andy Shaw
9029c55864 Send the LanguageChange event to all top level windows, not just widgets
By sending it to all top level windows it will make it possible for
non widget based controls to listen for this event if it cares about it
so it can handle translation updates as appropriate.

Task-number: QTBUG-78141
Task-number: QTBUG-82020
Change-Id: I8f35cdcccd81a199ff780c3f4f3d2c663480d638
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-02-18 22:11:30 +01:00
Liang Qi
b9585277e7 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/tools/qlinkedlist.h
	src/plugins/platforms/wasm/qwasmintegration.cpp
	src/plugins/platforms/wasm/qwasmscreen.cpp

Change-Id: Iefca7f9f4966bdc20e7052aca736874861055738
2020-02-18 09:26:53 +01:00