Commit Graph

50254 Commits

Author SHA1 Message Date
Joerg Bornemann
d9a7d1a89c Revert "Fix static build with tests"
This reverts commit 74f549b402.

Reason for revert: This breaks transitive dependencies.

The object file we're adding with target_sources will not be
propagated transitively.

For example, qmltestrunner depends on QuickTest, and
QuickTest depends on Quick.
The 'qrc_scenegraph.cpp.o' object file will not be propagated to
qmltestrunner if added with target_source(Quick INTERFACE ...).

Fixes: QTBUG-90933
Pick-to: 6.0
Change-Id: I11269537ae75de14189f8b5f59094b467e2eee24
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2021-02-07 20:10:42 +00:00
Mårten Nordheim
fcb9a94f83 Switch QNetworkInformation manual test back to using qDebug
It turns out QTextStream on Android isn't as easily visible as it is
when going through qDebug (where it can easily be seen with
`adb logcat -v brief libqnetworkinformation_<arch>.so:* -s`)

Change-Id: I3b495d7a3d331fda6cfe602c461107dd1d0b3faf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 677797929d8080199990d741773832f80a654265)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-07 11:10:31 +00:00
Hou Lei
584541c7e4 Avoid C-style casts when possible
Other affected rows have also been fixed.

Change-Id: I1d2c28eb37a9d259d3132156163d4135894c18c3
Reviewed-by: David Faure <david.faure@kdab.com>
2021-02-07 01:17:46 +00:00
Mårten Nordheim
67d2963583 Remove QNetworkStatusMonitor
Since the old code is now fully integrated in QNetworkInformation backends

Change-Id: Ia843d17bb3c98333e8d68752e25722b5860f48e0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 7860b9e6ffece207d054ac0c321bc3c5b983708f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-06 10:28:20 +00:00
Mårten Nordheim
b063d22147 SCNetworkReachability based backend for QNetworkInformation
For macOS/iOS. Based on the code Timur wrote for QNetworkStatusMonitor,
and uses QNetworkConnectionMonitor. It has less detail than the other
backends which is unfortunate but should be fine!

Task-number: QTBUG-86966
Change-Id: I0d5930d539f9668f001d6f85c86c9df0803d0f60
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 309a2360fdb3e9c1b07d2937859c521da187c486)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-06 10:28:14 +00:00
Samuli Piippo
d6f00c637d tst_qtexttable: fix fail on QEMU ARMv7
Different font was used when running on QEMU ARMv7 and the second page
was never reached.

Pick-to: 6.1
Task-number: QTQAINFRA-4127
Change-Id: Ic85b76661cf3642b69e6e1b21e8062d7c36231e3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-05 18:36:51 +00:00
Allan Sandfeld Jensen
74158ab1a6 Allow benchmarks with --force-debug-info
Developer builds with RelWithDebInfo should also make benchmarks, it
is how we get good traces.

Change-Id: I009d40580d5d784f78bd18ebf21887ce3c1fa97d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-05 17:34:18 +01:00
Alexey Edelev
d57ccd923f Add framework paths when generating moc manually
In apple systems it's necessary to pass the framework paths to the moc
generator to resolve required header files. We need to collect framework
paths for all INCLUDE_DIRECTORY_TARGETS and add them to the command line
of the moc generator.

Task-number: QTBUG-84906
Change-Id: I9e6356e7e0a5f2493823ec764a48b0b8f1c8c10d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-05 17:11:15 +01:00
Mårten Nordheim
63a9793360 NetworkManager based backend for QNetworkInformation
For Linux. Based on the code from the old bearer plugin for
NetworkManager with changes to fit better the objective of
QNetworkInformation.

Task-number: QTBUG-86966
Change-Id: I90c3488ff31ef6dfdcfb877c0e9c592c6c328a89
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 6d85e6e45ac9efe12f01ae38619487a23c585e9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-05 14:52:57 +00:00
Edward Welbourne
128942ccc9 Clean up documentation in QVector[234]D
Change-Id: I13f04c06280b998e5489eb114977ec0ed37178b7
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-02-05 15:40:01 +01:00
Edward Welbourne
968f4001a8 Fix warning from syncqt.pl about header inclusion path
After a "QtCore: WARNING:" intro (separated to avoid being mistaken
for a footer) syncqt.pl said:

 .../qtbase/src/corelib/kernel/qjnienvironment.h includes QScopedPointer when it should include QtCore/QScopedPointer

Change-Id: Iaa1f025367b7321af9c5de27196ebf271f9179df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-05 15:34:00 +01:00
Richard Moe Gustavsen
0bae5fbabb iOS: close edit menu upon focus transfer
If you select text, the edit menu will show.
But if you tap directly inside another input
field, and as such, transfer focus, the menu
will continue to stay visible.

This patch will ensure that we hide the edit
menu when the input field that it was
requested for looses focus.

Pick-to: 6.0 6.1 5.15
Fixes: QTBUG-90937
Change-Id: I1d97bd57fc793826a3170404795b06a1e058d1b7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-02-05 15:25:10 +01:00
Eskil Abrahamsen Blomfeldt
ef763e1958 Fix crash when requesting A32 glyph on Wayland
On Wayland we aren't getting any information about the subpixel
layout of the screen. On Freetype, this triggers an
assert / memory corruption when explicitly requesting a subpixel
antialiased glyph (via QRawFont) because it needs to know the
layout to render the glyphs.

It might be possible to get this information in the Wayland plugin,
but at least we should have a failsafe which doesn't crash when
the problem occurs. This simply falls back to using A8 antialiasing
when it doesn't know the subpixel layout.

[ChangeLog][Freetype] Fixed crash when calling
QRawFont::alphaMapForGlyph() with subpixel antialiasing on Wayland.

Fixes: QTBUG-90236
Pick-to: 6.0
Pick-to: 6.1
Pick-to: 5.15
Change-Id: Iddee2e171a81664ae9e3989115881f23262b2182
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-02-05 15:13:11 +01:00
Tor Arne Vestbø
7c85a45fde macOS: Don't assume NSEvent charactersByApplyingModifiers: produces character
In cases where the keyboard layout doesn't have a mapping for a given
event and modifier combination the result will be an empty string.

Fixes: QTBUG-90683
Pick-to: 6.0
Change-Id: Ice06241f0ae71a19cde041410818decc312bc630
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-02-05 11:50:18 +01:00
Tor Arne Vestbø
6faa33192c macOS: Don't wrap key event keys in QChar
Key events have a wider range of possible values than the unicode range,
as they also include all the special keys as defined in Qt::Keys.

Instead of turning the argument to keyMapForKey into an integer,
we can remove the argument completely, as it was only used as a
fallback in the cases where UCKeyTranslate (or in the future,
charactersByApplyingModifiers:), failed to map the virtual key
and modifiers to a character. But in those cases we should not
fall back to the Qt key from the key event, as that doesn't
match what the keyboard layout defines. Most keyboard layouts
explicitly define the base key as the key for these "undefined"
mappings, but if the keyboard layout does not, we should not
produce any input in the application, to match what AppKit does
in this case.

Fixes: QTBUG-90315
Pick-to: 6.0
Change-Id: Ib9ffd9521049ee8e4b103597c1d34cbe3d23dbdf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-02-05 11:50:14 +01:00
Tor Arne Vestbø
98b60450f7 rhi: metal: Present drawables via addScheduledHandler instead of presentDrawable
The former API is the recommended way to present drawables -- avoiding
WindowServer submission throttling and potential issues with lock-ups
when window are not serviced, are being moved to other screens, or users
mistakenly call waitUntilCompleted.

The scheduled block captures the drawable and retains it until the block
is done executing.

Change-Id: I99dca2db3bcfbea67c686dd5d97ba5011598997e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-02-05 11:50:09 +01:00
Tor Arne Vestbø
0cba6a27e2 rhi: metal: Manually manage drawable lifetime
The drawable returned from nextDrawable is autoreleased, which means
unless we explicitly retain it we have no guarantee that it will stay
alive long enough to be used again in endFrame(). For example, if the
user had an autorelease-pool in their custom render code, where the
call to beginPass() happens, the drawable would be released when that
pool went out of scope. The only reason we didn't hit this yet is due
to the default autorelease-pool being at the level of the runloop, so
the drawable happened to outlive the rendering of a single frame.

An advantage of manually managing the lifetime of the drawable is
also that we can release it immediately after being done with it,
instead of waiting until the autorelease-pool drains.

Change-Id: Ie6fd271adbe1121eb947bb7075142f1a6c81175d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-02-05 11:50:06 +01:00
Fabian Kosmale
0a86e7fb6d QMetaType: avoid id() calls in compare
We can avoid the overhead of the out-of-line function calls if the id is
already set.
As a drive-by, use relaxed loads in QMetaType::id (was: acquire).

Change-Id: I1d53dbf7e58eae80776ff36334ebf0642ba7842f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-05 07:40:35 +01:00
Giuseppe D'Angelo
a1e9817cec QStandardItem(Model): refactor multiData support
QSI(M) allow users to override their data() functions. This
means that we can't have their data() implemented in terms of
multiData(), or otherwise a subclass that overrides data() will
fall out of sync with its multiData() implementation. We must
keep multiData() implemented in terms of data() instead.

While at it, document QSI::multiData().

Pick-to: 6.0 6.1
Task-number: QTBUG-89423
Change-Id: If30a980d8449135b516745fec73170d53367b4b7
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-02-05 01:00:17 +00:00
Eskil Abrahamsen Blomfeldt
8b485664e4 Fix flakiness in tst_QGlyphRun::drawRightToLeft
As described in 3279c8e7d7, we can't
depend on the widths of decoration to always be the same for
drawText() and equivalent drawStaticText/drawGlyphRun.

This is typically visible as an off-by-one when using the default
fonts on OpenSUSE.

Since this test was actually made to test positions of RTL glyphs,
we can just disable the decoration and simplify the text.

Fixes: QTBUG-89086
Change-Id: I139fe3e1c5e98d8b1d7e0e7c19645fd4717d1d95
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-02-04 18:02:34 +01:00
Edward Welbourne
7a738daa97 Make explicit that we expect co-ordinates to be finite
The various spatial-vector, line, point, region and margin types have
all long taken for granted that their co-ordinates are finite and, in
particular, not NaN. Make this expectation explicit in the
documentation. Added assertions where (chiefly) noexcept and (where
the assertion would be a simple qIsFinite() call) constexpr didn't
preclude doing so. Also assert against zero divisors that would lead
to non-finite results.

Make minor clean-ups to docs in the process. QMarginsF had several
methods whose declaration, definition and docs weren't consistent in
their parameter names.

Task-number: QTBUG-89010
Change-Id: I601a830959d13a73dcb17ce31a1202a1486c8f7f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-02-04 17:18:51 +01:00
Edward Welbourne
96ef1769c1 Rationalize QVector[234]D's length-handling
Use qHypot() instead of casting to and from double so much,
use qFuzzyCompare(_, 1.0f) rather than qFuzzyIsNull(_ - 1.0f).

Change-Id: I70f38fe2d9aefe1ceb15e1a370f181a7856911b7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-02-04 17:18:46 +01:00
Edward Welbourne
8c1532eeaa Rationalize QQuaternion's length-scaling code
Use qHypot() to implement length(), avoid duplicating its code and use
its result more carefully, saving the need for casting to and from
double.

Subtracting a double from 1.0f still got a double, so the
qFuzzyIsNull() checks were using double's tolerance, where the use of
1.0f indicates the float tolerance would have been more apt. Also, use
qFuzzyCompare(_, 1.0f) instead of qFuzzyIsNull(_ - 1.0f).

In getEulerAngles(), scale co-ordinates by length before multiplying
(to ensure O(1) quantities) rather than scaling the products by the
squared length (possibly after {ov,und}erflowing).

Change-Id: Id8792d6eb047ee9567a9bbb246657b0217b0849f
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-02-04 17:18:38 +01:00
Assam Boudjelthia
d6b9200e32 Fix compiler warnings for QFontMetrics use
Pick-to: 6.1 6.0
Change-Id: I4c416280cef8c316258817184e94962c250370da
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-04 16:50:45 +02:00
Richard Moe Gustavsen
be06164201 iOS: don't report selection changed if it didn't change
Be more careful about reporting a new selection to Qt. The code for
handling IM selection events in QQuickTextArea is quite complex
and need to take pre-edit text into account. The latter means
that when the pre-edit text changes, as a result of the user composing
a word, the width of the pre-edit text will also change (and as
such, the cursor rectangle). But the cursor position itself stays
the same.  And for this reason, it emits cursorRectChanged more often
than strictly needed. But rather than trying to clean that up, we
do some extra checking before we send the IM event from QPA in
the first place.

Pick-to: 6.0 6.1 5.15
Fixes: QTBUG-63018
Change-Id: I689d989c3fe5d61ef2b1dbee7a70418b7790bce9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-02-04 14:33:12 +01:00
Jan Arve Sæther
f4887aca1e a11y: Report mixed state if QCheckBox is PartiallyChecked
Previously it only returned checked or unchecked for a tri-state
checkbox.

Fixes: QTBUG-84616
Pick-to: 5.15 6.0 6.1
Change-Id: Ife72098e35f8295fd389bda232de5478ffa7e87f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-04 13:23:33 +00:00
Richard Moe Gustavsen
b390812304 iOS: hide edit menu if typing on the input panel
On iOS, if you select some text, the edit menu will show on
top of it. And if you tap on the screen (or inside the menu) it
will hide. But if you type on the input panel, it will stay
open. This is wrong.

This patch will keep better track of whether or not the edit
menu was opened by us, and if it was, ensure we close it also
if the cursor moves by typing on the input panel.

Pick-to: 6.0 6.1 5.15
Fixes: QTBUG-90860
Change-Id: I0a51382030560182e7925c8b694b42e50943514e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-02-04 12:29:47 +00:00
Morten Sørvig
f7dd793db5 Android: Use new QPlatformInputContext geometry API
This simplifies the Android platform plugin code, since
it no longer has to make QHighDpi scaling calls.

QPlatformInputContext returns geometry in the native
window coordinates. These can be used directly, or in
some cases be mapped further to native global (screen)
coordinates. Note that this mapping now happens after
High-dpi scaling, so we must use QPlatformWindow::mapToGlobal()
instead of QWindow::mapToGlobal()

The inputItemTransform() is applied by QPlatformInputContext
when needed, these calls can also be removed.

Change-Id: I179d44d148dded43683df5e97ad506940894c423
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-04 13:29:46 +01:00
Fabian Kosmale
1316af2f3e Fix QMetaType benchmark
The benchmark used to crash because QMetaType::typeName would return an
empty string, which is not a legal value for newRow.

Change-Id: I9e6c6c1cf153943bfa21181cd2cca596a7943ea0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-02-04 13:29:46 +01:00
Samuli Piippo
f30a4f0be7 tst_qdatetime: remove blacklisting and expect failure
Amend ac970d48fd and use
QEXPECT_FAILURE for systemTimeZone test on 32bit systems.

Task-number: QTBUG-89889
Change-Id: I0eed35df871c69a20bcd7c544fc0e9a48dd8db7b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-04 09:04:06 +02:00
Volker Hilsheimer
5c329f023a Add "we mean it" warning to private header
Fix warning from configure.

Change-Id: I12def11a4effb7298ec0501cfac4ffd37b777ff6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-03 23:46:31 +01:00
Volker Hilsheimer
f2e5621451 Fix compiler warning in QNetworkReply test
Clang warning: 'isSequential' overrides a member function but is not
marked 'override' [-Winconsistent-missing-override]

Change-Id: I1a7c5516d2656469eab556e7f9d310192510b99b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-03 23:46:25 +01:00
Liang Qi
faab8f603d testlib: Only consider major version for macOS 11 and later in blacklists
Pick-to: 6.1 6.0 5.15
Change-Id: I9d3f7ca2022b17559dd5bdd5c6bb8c85e89c3f64
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-03 19:21:01 +00:00
Allan Sandfeld Jensen
0c5d9b953e Optimize RGBA64PM->RGBA64 for SSE4
And remove direct conversion to take advantage of both the SIMD, but
also threading on all platforms.

Change-Id: I782ae7c80e82b694e23abee28d69cecd0d28c32f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-03 17:24:25 +01:00
Edward Welbourne
9505bd84db De-const the members of QHypotHelper to enable assignment operators
Being able to iterate h = h.add(next) over a sequence of numbers makes
it possible to implement arbitrarily-many parameter functions that
need hypot, e.g. the implementation of V4's Math.hypot().
This amends commit b08368d99f.

Change-Id: I76bb65bd5f318e915d42fa4c935129850e258132
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-02-03 14:05:10 +01:00
Edward Welbourne
dca74b45a3 Use the double-conversion sources without rearrangement
This simplifies the include path addition we need when compiling and
eliminates the need to rewrite all the #include lines on update.

Change-Id: I14e301d277f1eb49286721b012559f0ec84ea520
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-03 14:04:50 +01:00
Laszlo Agocs
d136299bb8 rhi: gl: Attempt reading back floating point formats
...in the hope that they may work. If not, that's it, but at least we
tried.

Task-number: QTBUG-76970
Change-Id: I134c5cc4cfb5ad1e6f9edbfcf506df20022e127a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-02-03 10:40:47 +01:00
Richard Moe Gustavsen
eadbf2dd0b QGuiApplication: use global position to create local position for synthetic mouse events
When QWidgetWindow handles a QTouchEvent, it will call
updateTouchPointsForWidget() for each widget it tries
to deliver the touch event to. This will make sure that
the point's position() is updated to be local to the
widget being processed.

The problem is that we never reset this overwriting of
local positions in the event after we're done. So if we
later try to synthesize a mouse event from it, the local
position in the fake mouse event will be based on the local
position inside a random widget, and not the original local
position sent from QPA.

Rather than trying to store all the original local
positions inside the event before going through this delivery
logic, and reset it afterwards, we base the local position of
the synthesized mouse event on the (unmodified) global
position instead.

Fixes: QTBUG-90033
Change-Id: I1588351482de7cce9c06d102db3686ea8dd0c118
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-02-03 09:05:21 +00:00
Assam Boudjelthia
4493b90224 Android: fix compiler warnings for Android input
QPointingDevice requires using the constructor to set its settings
in Qt 6.

Replace + with | operator and return QKeyCombination instead of int.

Change-Id: Id3da469cc13b34ec7b55afa751dbc04601880df6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-03 11:02:24 +02:00
Mitch Curtis
b1d750d59b Improve and expand QShortcutMap debug output
- Replace vague symbols with descriptive words.
- Use qScopeGuard() to ensure that removeShortcut prints the number of
  removed shortcuts for all execution paths.

Change-Id: I4d36366445756b41b1dc40bbb1e987dce669a723
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-03 09:46:40 +01:00
Eskil Abrahamsen Blomfeldt
fccd419dd6 Remove false Q_UNREACHABLE from shaping code
This was added by 9ff76c27b9 on
the basis that it signifies a shaping error and would later assert
or crash.

But the line is easily reachable by user code. If Harfbuzz returns
0 glyphs, it just means it is unable to shape the string, for instance
if the input string only contains default ignorables (like a ZWJ)
and does not have any appropriate glyph to use for replacement.

Qt expects there to always be at least one glyph in the output
(num_glyphs == 0 is used to indicate shaping is not yet done), so
to avoid asserts later on, we simply populate the output with a
single 0 token, which is a required entry in the font that is
reserved for representing unrepresentable characters.

This also adds a test and therefore a zero-width joiner to the test
font to reproduce the issue.

[ChangeLog][QtGui][Text] Fixed a possible crash with certain fonts
when shaping strings consisting only of control characters.

Fixes: QTBUG-89155
Pick-to: 5.15
Pick-to: 6.0
Change-Id: Ia0dd6a04844c9be90dcab6c464bebe339a3dab11
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2021-02-03 09:44:44 +01:00
Andreas Buhr
52fcd0b6d7 Add method to conditionally remove binding to QObjectCompatProperty
Setters of QObjectCompatProperty need to remove the binding, but
only if it is not in the wrapper. This patch adds this method to
the public interface.

Change-Id: Ibc96418fe15b0aeeb2059411ea910ba1f733c255
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 09:32:12 +01:00
Joerg Bornemann
74f549b402 Fix static build with tests
A static build of Qt with QT_BUILD_TESTS=ON would fail with errors like
this:

FAILED: tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2
undefined reference to `qRegisterResourceData(...)'

We create object libraries for resources. In this case, for the
mimetypes of QtCore.

For static builds we added the object files to INTERFACE_LINK_LIBRARIES
of the Qt module the resource belongs to:
    target_link_libraries(Core INTERFACE
        "$<TARGET_OBJECTS:$<TARGET_NAME:${resource_target}>>")

That is, however, a problem for projects that link only against QtCore,
like testProcessEcho2 above. On the linker command line Qt6Core.a is
before qrc_mimetypes.cpp.o and that doesn't work, because the latter
needs symbols of the former.

To have the resource object files before any other libraries on the
linker's command line, we now treat them as source files.

Pick-to: 6.0
Fixes: QTBUG-90582
Change-Id: Ia2786beb5f7c2eba194e8f00ae8785572df1cf6e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-03 09:22:21 +01:00
Allan Sandfeld Jensen
936d499ed4 Optimize RGBA64->RGBA64PM for SSE2/AVX2
And remove the direct conversion so we can get both the SIMD
optimization and threading applied.

Change-Id: Id032ea91cc40c1cbf1c8a1da0386de35aa36cfb5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-03 08:22:16 +01:00
Allan Sandfeld Jensen
ba6b29a367 Fix inefficient use of qToBigEndian
It can do unaligned access directly as well.

Change-Id: I4046cf69e2ad8eb628b8b53bfa521800bb35dc6d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-02 13:06:16 +02:00
Allan Sandfeld Jensen
bde773ec6a Fix a few compiler warnings in tests
Change-Id: I22f6ac8ed02dd4ef4083ce3c781552623a0b08da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-02-02 12:06:05 +01:00
Li Xinwei
fce1019133 qtlskey_schannel_p.cpp: fix a compilation error
qtlskey_schannel.cpp(183): error C3861: 'lcSsl': identifier not found

Change-Id: I406860f87a7b7f93ac2c0ca3d426dfa88615a90e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-02 18:34:26 +08:00
Tor Arne Vestbø
3d341ae882 macOS: Reduce duplicated code for showing file dialogs
The initialization was duplicated across the different modes. We now do
the setup once, in a shared showPanel:withParent function.

This also simplifies and removes the need to store the return code.

Change-Id: I3c4da48cfef92bcc59c76cffa15b40150de1a9e1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-02-02 11:29:16 +01:00
Tor Arne Vestbø
1724fccb01 macOS: Reduce duplicated updates of file dialog properties
Change-Id: I2017bfdfa6d5598405d700680ecaaf04fd6023fd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-02-02 11:29:13 +01:00
Tor Arne Vestbø
7f8a80ebf8 macOS: Refactor computing of accepted extensions in file dialogs
Change-Id: Ie71db5a0ab66dd9d157b53297cbb9aba248fa8af
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-02-02 11:29:11 +01:00