Commit Graph

54190 Commits

Author SHA1 Message Date
Mårten Nordheim
6f542f19bf QFontDatabase (Windows): Sanitize font requests early
After the windows font engine was no longer marking everything as
scalable we started limiting the font size of requests to the maximum
of Courier when it was requested. This was a regression from 5.8 and not
in agreement with our documentation.

The problem is that we would only make the switch from Courier to
Courier New after having already gone through the foundry-lookup and
found a closest-available font size for Courier.

With this sanitization step in the backend we can make these changes
early enough that we haven't yet adjusted e.g. the font size.

Pick-to: 6.2 5.15
Fixes: QTBUG-58995
Change-Id: I319e93e6b78c7c3c5539964ac5ab4e05f8902ab6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-12-06 20:06:06 +01:00
Tatiana Borisova
eba9196304 Fix tst_qfloat16 runtime failure for INTEGRITY
- GHS compiler is not fully compliant with iec559. Therefore we need
to update is_iec559 checking for GHS case.

Pick-to: 6.2
Change-Id: Ia094509d26bf5f0109f2937547a056267019cffb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2021-12-06 18:53:50 +00:00
Edward Welbourne
be63c3011b Suppress test set-up and tear-down in callgrind parent process
When running a test using -callgrind, we recurse into a child process,
run under valgrind, to which we pass -callgrindchild; and we only want
the output from the child process, since the parent won't actually be
running any tests. We also won't be using the global data table for
the test in the parent process. So bypass the set-up and tear-down of
both logging and the global data table in the parent process.

Prior to commit 3ee6d8d336, these parts
of the set-up and tear-down were skipped in the callgrind parent
process, but that refactoring split qExec() up into qInit(), qRun()
and qCleanup() to enable QtQuick to recombine them to implement an
equivalent of qExec(), calling qRun() once for each built-in style. It
needs these pieces of set-up to happen in qInit(), and of tear-down in
qCleanup(), to avoid repeating them for each style. Leave a comment in
qExec() that might help future readers to understand why it's done the
way it is.

Change-Id: Ieaca9a125c713b8fcf8dec8f9be0c024a798d504
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-12-06 19:06:30 +01:00
Edward Welbourne
9e835fe5a4 tst_BenchlibCallgrind: fix x86 preprocessor check
Its twoHundredMillionInstructions() test has #if-ery to limit it to
gcc and x86; however, it was testing only __i386 for the x86 part,
where gcc defines __x86_64 instead on modern 64-bit systems. In the
process, invert the condition and the branches it controls - positive
tests are easier to comprehend.

Change-Id: I8e906c606c48aa5034e02e3ed5d042fbb1f2ecbc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-12-06 19:06:30 +01:00
Marc Mutz
d5c605b148 QMetaType: port the BC fix for id() to new QT_REMOVED_SINCE
The allows qmetatype.cpp compilation to enjoy PCH again.

Change-Id: I47c5af33a5dbc930ee4c120b254e732c52bc2369
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-06 19:06:30 +01:00
Morten Johan Sørvig
d3646d2b05 Say hello to qtwasmserver
Development web server for web applications. Supports
http and https. Sets COOP and COEP headers.

The web server script supports certificate generation using
mkcert (github.com/FiloSottile/mkcert). Briefly, mkcert
supports generating server certificates for the current
local ip address(es), using a certificate authority
which can be installed on devices where the app should
run.

The COOP and COEP headers are required to enable the
SharedArrayBuffer API, which is required for Emscripten’s
pthreads implementation.

The server serves the current directory on localhost
by default. Use the “-a” argument to bind to an additional
address, or "--all” to bind to all IPv4 addresses found on
local network interfaces. Change the directory by passing
it as a positional argument.

Task-number: QTBUG-79087
Change-Id: Id0cba649e42af53ed8106e336a77e78398bcf901
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
2021-12-06 16:36:09 +01:00
Gatis Paeglis
9ef69efb3b qxkbcommon: UCS-4-encode surrogate characters in QKeyEvent::key()
Fixes: QTBUG-72776
Pick-to: 6.2 5.15
Done-with: Liang Qi <liang.qi@qt.io>
Change-Id: I9d1f4e34527079c3bc460016fe9b953636b4d6cb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-12-06 15:41:33 +01:00
Kai Köhne
5bacfbd77e Rasterwindow: Remove unneeded find_package
Change-Id: Ia526f7603af98a6d450ff2465fd666d955772646
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-12-06 14:42:45 +01:00
Kai Köhne
4c31a78516 Do not support Qt5 build in androidnotifier example
We can expect that users use Qt 6 to try out Qt 6 examples.

Pick-to: 6.2
Change-Id: Ifa7bd9471a712fa1d63107b7ff2d392b7aefdcfe
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-12-06 14:42:45 +01:00
Morten Johan Sørvig
fd0ef140cf wasm: make the compositor draw the window icon
Currently the compositor draws the Qt logo by default;
check if the window has an icon and draw that instead
if set.

Fixes: QTBUG-86052
Pick-to: 6.2
Change-Id: Ia4f9c03562c15993c86cb8717f27e47ab669353d





Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2021-12-06 14:42:45 +01:00
Giuseppe D'Angelo
ad5c5bb541 qBound: add an assert on !(upper < lower)
It's a precondition and we might just as well check it, given that
people have actually got the order of the arguments wrong (cf.
QTBUG-69330).

Unfortunately, Q_ASSERT is defined below qBound in qglobal.h, so I had
to reshuffle some code around.

Change-Id: I82e52bcb863ff8c96594817e0cd5d7d2abe2e57e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-12-06 12:28:41 +01:00
Giuseppe D'Angelo
19072a177b QPageLayout: do not calculate an invalid margin
A default constructed QPageLayout has an invalid QPageSize. When
asking for its size, an invalid QSize is returned (-1, -1). This
size is then used to calculate the maximum margins the page layout
can have, resulting in negative margins.

I'm not sure if that makes sense for QPageLayout (in principle, a
negative margin is acceptable, meaning to "grow" the size), but then
this margin is passed as an upper bound to a series of qBound calls in
QPageLayoutPrivate::clampMargins.

To fix this, change the calculations of the maximum margins by using
a lower bound of 0.

Change-Id: I429104acfb2296d9eb1ee54c113e9d7e22d9b6ab
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-12-06 12:28:41 +01:00
Giuseppe D'Angelo
212b7614e1 QListView: fix a broken qBound
If a QListView's model is reset to an empty one, its columnCount()
below the root is going to be 0. Therefore, the code was doing a

  qBound(0, d->column, -1)

which is meaningless (high < low). Instead, do the two logical
operations explicitly: first do an upper bound on d->column
(using qMin) and then lower bound the result by 0 (using qMax).

The code worked by chance, because 0 was eventually the correct
number to use as a bound for d->column.

Change-Id: Ic32077cdab01eaa715137c05ed1f9d66c8eb2f67
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-12-06 12:28:41 +01:00
Kai Köhne
251e848007 Remove .prev_CMakeLists.txt
These are left-overs from the initial qmake2cmake conversion.

Pick-to: 6.2
Change-Id: Ie15c9ff022ea4566d10c1ba74599de9af83d29a7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-12-06 11:23:26 +00:00
Dmitry Shachnev
f25761c617 Remove chip.debug compiled binary leftover from debugging
Pick-to: 6.2
Change-Id: I9d1ca06ffb5f9b8fc6e6042c399311dcec059521
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-12-06 07:15:59 +00:00
Shawn Rutledge
af987c1bde doc: Add details about what to use instead of QMouseEvent::source()
Pick-to: 6.2
Fixes: QTBUG-98875
Change-Id: I2678edccf68d754d191b9eb6cdfe09bba327e85a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-12-04 12:23:51 +00:00
Tor Arne Vestbø
b89608dcf8 Document which header to include for the various native interfaces
Fixes: QTBUG-98654
Pick-to: 6.2
Change-Id: Ic5ea3cc7d90ed336a5b6e827d1523bdd58fabc13
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-12-04 12:41:46 +01:00
Mårten Nordheim
cdc3de6c84 QStringBuilder: Add support for QByteArrayView
[ChangeLog][QtCore][QStringBuilder] Added support for QByteArrayView.

Change-Id: If2c23549d533dd31c320f3ee455fcd01ea5b460a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2021-12-04 08:21:22 +00:00
Mårten Nordheim
9909ec0bc6 QNAM: Reintroduce h2c with an attribute
[ChangeLog][QtNetwork][QNetworkRequest] Added
QNetworkRequest::Http2CleartextAllowedAttribute which controls whether
HTTP/2 cleartext (h2c) is allowed or not. The default is false. This
replaces the QT_NETWORK_H2C_ALLOWED environment variable.

Task-number: QTBUG-98642
Change-Id: I43ae1cc671788f6d2559cd316f6667b412c8e75e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-12-04 08:20:52 +00:00
Yuhang Zhao
5074344c9c MSVC: Use dubbed FH4 to make C++ exception handling smaller
Visual Studio 2019 introduced the dubbed FH4 feature
which can make C++ exception handling smaller on x64.
According to the article [1], it's enabled by default
for UWP applications, and Microsoft also use it in
their own widely-known commercial products such as
Office to reduce the binary size.

So make use of this feature for Qt when possible, to
get smaller binary.

As a drive-by, add "/EHs-c-" explicitly to the flags
when we want to disable C++ exception handling.

[1] Official article that introduces dubbed FH4:
https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/

Change-Id: I2e3330de477f78372cf7903d0ef7a732b09552a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-12-04 14:15:16 +08:00
Ievgenii Meshcheriakov
83f2f27bb6 QFile: Add open() overload that accepts permissions argument
The new overload allows creation of files with non-default permissions.
This is useful when files need to be created with more restrictive
permissions than the default ones, and removes the time window when
such files are available with less restrictive permissions.

[ChangeLog][QtCore][QFile] Added QDir::open() overload that
accepts permissions argument.

Fixes: QTBUG-79750
Change-Id: Iddfced3c324e03f2c53f421c9b31c76dee82df58
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-12-04 01:27:11 +01:00
Ievgenii Meshcheriakov
56e13acf4e QAbstractFileEngine: Add permission argument to open()
The new argument allows atomic creation of files with non-default
permissions.

Task-number: QTBUG-79750
Change-Id: I4c49455b41f924ba87148302c8d0f77f5de0832b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-12-04 01:27:08 +01:00
Volker Hilsheimer
56bd1b76d2 Don't change resolve mask when setting brush doesn't change palette
After 556511f9f3, which moved the resolve
mask storage into the palette's d-pointer, modifying the resolve mask
requires a detach. As of now, we only detached when setting a different
brush, but always modified the resolve mask, which broke palettes that
shared the d-pointer (likely the global default palette).

However, detaching has negative side effects when styles set brushes on
temporary palette objects and then use that palette object's cache key
to build a cache of pixmaps. As each drawing would detach the palette
(even if the palette doesn't change, which is likely), the cache key
changes with each detach, and the cache would quickly increase in size.
This was addressed in changes d7bcdc3a44
and 1e75dcf251.

We can either detach and find other ways to address the issues from
QTBUG-65475, or we can not change the resolve mask when the brush doesn't
change and completely ignore the call.

Since QFont ignores the setting of any attribute to a value that is
identical to the current value, and since it's possible to force that
the resolve-bit is set by calling setBrush twice with different brushes,
ignoring the call seems like the better solution.

[ChangeLog][QtGui][QPalette] Setting a brush on a palette that is
identical to the current brush no longer sets the resolve mask bit for
that particular role, so items using the palette will continue to
inherit changes from parent items.

Fixes: QTBUG-98762
Task-number: QTBUG-65475
Pick-to: 6.2
Change-Id: Ife0f934b6a066858408ef75b7bb7ab61193ceb47
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-12-03 21:07:09 +01:00
Albert Astals Cid
98c2260c3b Add QFontComboBox::setDisplayFont
Allows changing the font used to display a font family

[ChangeLog][QtWidgets][QFontComboBox] Added the setDisplayFont() function, in order to be able to control the font used to render the font name and sample text (when previewing the fonts).

Change-Id: I94bfef43142c5346237e3069449bd19dbacb7420
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-12-03 20:35:33 +01:00
Albert Astals Cid
63c0a1bd23 Add QFontComboBox::setSampleText
Allows setting the sample text to be used

[ChangeLog][QtWidgets][QFontComboBox] Added the setSampleText() function, in order to be able to control the sample text displayed by the combobox (when previewing the fonts).

Change-Id: Iedcd3bb72bc6aec9a178f14f7fbbe324ba0223ef
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-12-03 20:35:33 +01:00
Shawn Rutledge
46cadf7b48 QSystemTrayIcon example: ignore non-spontaneous QCloseEvent
Apparently this code is needed on other platforms now, not only macOS.

Pick-to: 6.2
Fixes: QTBUG-98504
Change-Id: Ie0a7e38609e8fc8c11915784dd3652a3517bb639
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2021-12-03 18:17:41 +00:00
Kai Köhne
6598a26a13 androiddeployqt: Fix signing of paths with spaces
Only use shellQuote() if the path is actually passed to a native API.
For QFile API, use the unquoted path.

Fixes: QTBUG-97649
Pick-to: 5.15 6.2
Change-Id: I9d8131819010bbd2faa8a81eef367245d90a767f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-12-03 15:09:26 +00:00
Andrei Golubev
08b0a63a0f QFontDatabase: unify relevant documentation pieces
addApplicationFont and addApplicationFontFromData basically do the same
thing (with one reading the data from a file and another reading
it directly from QByteArray)

The documentation is not quite identical, so fix that by using \include
magic of qdoc

As a drive-by, remove outdated \note within addApplicationFont() description

Fixes: QTBUG-98752
Pick-to: 5.15 6.2
Change-Id: I29738e7411d241c26a4b2e1dd91d0af867fcc111
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-12-03 12:57:39 +00:00
Marc Mutz
020191d2ef QLayoutPolicy: fix annoying -Wdeprecated-enum-enum-conversion
Says GCC -std=c++20:

    src/gui/util/qlayoutpolicy_p.h:127:30: warning: bitwise operation between different enumeration types ‘QLayoutPolicy::Policy’ and ‘QLayoutPolicy::PolicyFlag’ is deprecated [-Wdeprecated-enum-enum-conversion]
      127 |         if (verticalPolicy() & ExpandFlag)
          |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~

Fix by making Policy a QFlags<PolicyFlag>, which we can do because the
class is private. In QSizePolicy, this would break BC.

Since a QFlags cannot be opened for constants like an enum, we need to
define the ex-Policy-enumerators as static inline constexpr objects
instead.

Pick-to: 6.2
Change-Id: I29bc938f86508deed3f99ad9d1c1892547206c05
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-12-03 12:57:39 +00:00
Marc Mutz
2d2104da7c QSizePolicy: make qHash() a hidden friend
Less noisy compiler error messages.

[ChangeLog][Potentially Source-Incompatible Changes][QSizePolicy]
qHash() is now a hidden friend and can only be called by unqualified
(qHash(sp)), not by qualified lookup (as in, say, ::qHash(sp) or
QT_PREPEND_NAMESPACE(qHash)(sp)).

Task-number: QTBUG-98863
Change-Id: I37d26c661c2d8bb74350eb9378bd19fa426678d2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-12-03 12:57:39 +00:00
Assam Boudjelthia
f1c2b6f5f9 Android: add methods to get the FileDescriptor for a Uri
This can be useful for some cases when the Android APIs have calls
that expects a FileDescriptor instead of a Uri or an int file
descriptor (like a case in Qt Multimedia with MediaRecorder).

Pick-to: 6.2
Task-number: QTBUG-96081
Task-number: QTBUG-96957
Change-Id: I0ab8d37a43b7cb94f6ebb5d48014e5a7903aadc7
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2021-12-03 14:19:21 +02:00
Assam Boudjelthia
be55118bd3 Android: simplifications to exception messages for content file handling
The method getUriWithValidPermission() now returns null only if the
Uri couldn't be parsed, otherwise, returns the parsed Uri and fail later
when used if it doesn't have permissions for example.

Also, Don't use use hardcoded strings for method names, and print the
exception message instead of the whole stack.

Pick-to: 6.2
Task-number: QTBUG-96081
Task-number: QTBUG-96957
Change-Id: If7ba88265c9683e6660cb483cfee6c22016f2976
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2021-12-03 12:19:21 +00:00
Volker Hilsheimer
c034ad03ac QPA: Set focus reason when window activation changes focus
QApplication hides the fact that the reason is never set by several
QPA plugins, but Quick items don't receive the correct reason on
Windows, Android, the offscreen plugin, and other platforms.

Add relevant scenario to the QFocusEvent test case, and fix the
plugins to always set the focus reason when handling window activation
changes. Exclude the minimal plugin from the test, it seems largely
unmaintained anyway.

Task-number: QTBUG-75862
Change-Id: I5404a225b387fc9a3851b6968d0777c687127ed1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-12-03 08:15:29 +01:00
ChunLin Wang
8e465c75fe Repair parameter type
Fix the parameter types corresponding to the sample code and subclasses

Fixes: QTBUG-98578
Pick-to: 6.2
Change-Id: I06e342ae1210ed53c5deec3e2711457cf2ac5b15
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-12-03 11:52:21 +08:00
Marc Mutz
d06a686cad Remove unused Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6
There are no users left in the tree.

Change-Id: I336f4e15c0ec1f5933c1fcfa661bad85bd38ed35
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-12-03 03:42:01 +01:00
Inho Lee
ac2f4bd9db Remove XCB_EVENT_MASK_RESIZE_REDIRECT for Qt:WindowTransparentForInput
In xcb plugin, XCB_EVENT_MASK_RESIZE_REDIRECT is set but it is not
necessary. Mouse events are disabled by setTransparentForMouseEvents
and there is no reason to have this event mask.

Fixes: QTBUG-86372
Pick-to: 6.2 5.15
Change-Id: I2124b0684a0847d6705344bb5850bac178a292b6
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-12-03 00:22:49 +01:00
Shawn Rutledge
dbb9579566 Text editing: smart block and char format after newline
When you are editing in a QTextEdit and press enter to start a new line,
calling insertBlock() with no arguments tries to preserve the current
charFormat and blockFormat. That is often OK:
- if you hit enter at the end of a list item, you probably want another
  item in the same list
- if you are writing code inside a code block, you're probably just
  writing the next statement on the next line: stay in the same block
- margins, indents, tab positions should stay the same (but hopefully
  your editor has UI to manually reset the block format to default
  in case you are not continuing in the same style)
But there are some exceptions we can apply to be helpful:
- nobody ever wants to follow an <hr/> with another one (but
  hopefully the application has an action to insert one manually)
- a heading is more likely to be followed by a paragraph, or perhaps
  a smaller heading; another heading at the same level is unlikely.
  We need to reset the char format, not only the block format, because
  the large font and heavy font weight are stored there.
- when adding to a todo list, hitting enter at the end of the last task,
  let's assume the next task is not yet done, so it will be unchecked
  by default (else, why are you writing a todo list at all)
To achieve that, we need to customize the formats and call the
insertBlock() overload that takes them. The no-argument insertBlock()
will continue to preserve the formats, because it's an old API that is
used for much more than interactive editing.

Additionally, word processors tend to let you end a list (for example)
by hitting enter twice. In that case, you stay in the same paragraph
that you created the first time you hit enter, but now the formats are
reset to default, so that you can go on typing an ordinary paragraph,
rather than having to mouse up to the toolbar to select the paragraph
style in a combobox, or something like that. So we now do that: reset
both block and char formats after you hit enter on a blank line; but if
you then hit enter again, after the block format has been reset, then
you will get the actual blank line (empty block) inserted.

[ChangeLog][QtWidgets][QTextEdit] Hitting enter at the end of a line
with a special block format (horizontal rule, heading, checklist item)
now makes some "smart" adjustments to avoid retaining properties that
are unlikely to be continued on the next line. Hitting enter twice now
resets block and char formats to default.

Fixes: QTBUG-48815
Task-number: QTBUG-80473
Fixes: QTBUG-97459
Change-Id: I3dfdd5b4c0d9ffb4673acc861cb7b5c22291df25
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-12-02 22:22:59 +01:00
Alexandru Croitor
ebac49dd45 android:qmake: Fix static libraries to include the QT_ARCH suffix
When building a shared library (with qmake) in a user project
targeting Android, the library gets a QT_ARCH suffix added to its
name.
This suffix is not added when building a static library
(CONFIG += staticlib).

In the context of a multi-abi android qmake build, all the arch
specific static libraries would have the same name and would
override each other.
This happens with Qt 5.15 and it would also happen in Qt 6,
but we don't support multi-abi qmake builds in Qt 6 so far.

When the original fix to include the arch suffix for shared libraries
was done in Qt 5, d463a63bb9
it was likely an oversight that it was not applied to static
libraries as well.
The !static part of the condition was added in
72d4f0750b .
The change only handled installation responsibilities, not naming of
libraries.

Fix static libraries to include the arch suffix, but only in Qt 6.

It's too late to fix it in Qt 5, there might be projects that rely on
there not being a suffix in static library names. Adding the suffix
would suddenly cause linking errors.

Amends d463a63bb9

[ChangeLog][Android][qmake] Static libraries targeting Android will
now include an arch suffix when built using qmake.

Fixes: QTBUG-83165
Change-Id: I6f68dcb74cec30b4c8f0bc5a819d89843e9d695e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2021-12-02 20:29:58 +01:00
Mårten Nordheim
a6744bc9f9 OpenSSL: handle renegotiate errors by comparing certs
If the certificate didn't change then our trust in it didn't either.
Sadly, cannot have an autotest because we don't have any way
to facilitate a renegotiation at the moment and with TLS 1.3
not having them at all it's unlikely we ever will.

Pick-to: 6.2 5.15
Task-number: QTBUG-92231
Change-Id: Ibaa9b2f627daca05021c574e69526710aacdadae
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-12-02 19:29:58 +00:00
Tatiana Borisova
3c6582a082 Exclude INTEGRITY artifacts from Archivation step on CI
- there is no possibilities for running autotests on CI

Pick-to: 6.2
Change-Id: I15f0c600172ec4962edf3716a651483982c4f8c6
Reviewed-by: Toni Saario <toni.saario@qt.io>
2021-12-02 20:09:40 +02:00
Michał Cieślak
02955a10fa Use Android's View.generateViewId() for generating ids for views/surfaces
Qt Android was using consecutive numbers starting from 1 as ids for View.setId(int). The ids are used internally with an assumption that they are unique. It was potentially leading to collisions and unexpected behavior when adding custom views with id generated by View.generateViewId().

Task-number: QTBUG-98649
Pick-to: 5.15 6.2
Change-Id: I5bf2fe1d196c7adafeec544d8d945ebd82ba5cb6
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-12-02 19:09:40 +01:00
Edward Welbourne
24e4370414 Close leak of QOCIDateTime object
Noticed while reviewing usage of this type. The code has a whole
TempStorage class to take care of keeping allocated memory live until
we're done with it, explicitly including date-time objects as a
special case, but neglected to use it in one place.

Pick-to: 6.2 5.15
Change-Id: Ic94c56d67dda6dc3ee36a025a2e0149f6b2a1837
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-12-02 17:38:33 +01:00
Edward Welbourne
4ef8e9427c Reduce scope of a hack using volatile in favor of viewAt()
We can now get qt_configure_strs to tell us the size of the string, as
well as its start, bypassing the strlen()-calling branch of
fromLocal8Bit() that caused the need for a hack using a volatile
variable. However, QT_CONFIGURE_SETTINGS_PATH still needs the volatile
hack.

Change-Id: I0181abf512123e6355acdd506d6845c3fb75c0e3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-12-02 17:38:33 +01:00
Edward Welbourne
4d4aa6e21c Restrict clang warning disabler to affected versions
Apparently -Wdeprecated-copy got added between clang 9 and 11.
Versions without it warn about the attempt to suppress this option's
warnings.

This follows-up on commit 8662fbdd7e

Change-Id: I7fe9258cfe8a79d24c1f8b331a56468415b25cdb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-12-02 17:38:33 +01:00
Jonas Kvinge
a817490335 qnx: Fix typos in source code comments
Change-Id: I6420e14e3de9c7efc7d5073f44ccfd7ee9b88ea6
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-12-02 18:38:33 +02:00
Jonas Kvinge
5d08806adf android: Fix typo in source code comment
Change-Id: Ieeab35d51588cf247c3d9626d0291e2983720873
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-12-02 18:38:33 +02:00
Marc Mutz
ecc307ff41 QString et al: fix lastIndexOf() API asymmetry
Commit 6cee204d56 introduced overloads
of lastIndexOf() which drop the 'from' argument, inadvertently fixing
QTBUG-80694, but failed to provide the new overloads for all existing
lastIndexOf() overloads, making the fix for QTBUG-80694 incomplete.

This patch completes the fix, by adding the missing overloads (for
char-likes) and also adds the missing (non-regex) tests to
tst_qstringapisymmetry.

Also amends 1c164ec7f2.

Fixes: QTBUG-80694
Change-Id: Ib4b3d597d658ce2edf01a2bce0d711ecea593d6e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-02 16:05:33 +00:00
Elvis Lee
093a62a69a Support to get timing from pagefilp
Handle the timing from drmEvent when page flip finished.
The information can be used to optimize rendering timing.

Change-Id: I14612ca48a8fea5208aa74949d7543787e860c5f
Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-12-03 01:05:33 +09:00
Alexey Edelev
63b8840380 Fix dependency chain that collects the metatype json files
cmake_automoc_parser has the logic preventing the run of moc with the
--collect-json parameter if metatype json files are not changed.
This logic only verify if the file list is changed but not their
content. This change adds a timestamp file that contains the last
metatype json file timestamp that was modified during the last
cmake_automoc_parser run. The logic still prevents of running
'moc --collect-json' when the list of metatype json files is not
changed, but also checks if their content is no changed.

Another approach it to generate the depfile that can be utilized by
CMake in add_custom_command as DEPFILE argument. But this concept only
works from the second build attempt because of an issue related to
dyndep.

Pick-to: 6.2
Fixes: QTBUG-98532
Change-Id: I713f8bfa9ae769cefe0beac0b7fa19750b00a765
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-12-02 16:34:23 +01:00
Alexey Edelev
7a6dd6084c Replace BUILD_OPTIONS_LIST variable by the getter function
Encapsulate configuration options in a function and use it instead of
a globally defined variable.

Pick-to: 6.2
Change-Id: I5c69c207788fe069fdd046b68a6bc58aa16e71b4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-12-02 16:34:22 +01:00