Commit Graph

53612 Commits

Author SHA1 Message Date
Ievgenii Meshcheriakov
826fc8c9bd Update UCD to Revision 28
This corresponds to Unicode version 14.0.0.

Added the following scripts:

    * CyproMinoan
    * OldUyghur
    * Tangsa
    * Toto
    * Vithkuqi

Full support of these scripts requires harfbuzz version 3.0.0,
this version adds support for Unicode 14.0:

    https://github.com/harfbuzz/harfbuzz/releases/tag/3.0.0

With this release 10 test cases in tst_qurluts46 were fixed, one
additional test case is failing in tst_qtextboundaryfinder and
is commented out. In total 62 line break test cases and 44 word
break test cases are failing.

A comment in src/corelib/text/qt_attribution.json was updated to
include the URL of the page containing UCD version number.

Fixes: QTBUG-94359
Change-Id: Iefc9ff13f3df279f91cbdb1246d56f75b20ecb35
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-10-18 16:45:10 +00:00
Topi Reinio
439f6c9576 coin: Add instructions to generate docs during testing
A single configuration provides qdoc and qtattributionsscanner via
provisioning. The environment variables instruct QDoc to run in
testing mode; it ignores linking warnings (since we don't have .index
files for external documentation modules) and terminates with non-zero
exit code if documentation warnings exceed the limit set in the
documentation config.

The provisioned binaries are portable, packaged together with their
dependencies. As they are installed under /opt, the instructions
create symlinks to the binaries in the install directory before
building the 'generate_docs' target.

Pick-to: 6.2
Task-number: QTBUG-78069
Fixes: QTBUG-95554
Change-Id: I4a4765250247e2fc6eddd153c36cf8126ddd10ae
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-10-18 16:23:13 +00:00
Ulf Hermann
bcf3f63d52 QProperty: Eliminate further unnecessary TLS operations
If we don't have a binding, we don't need to remove it. We can figure
this out without TLS lookup.

Pick-to: 6.2
Change-Id: I0cb20f2a68a119df7742631e307002e3813eac03
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-10-18 18:23:13 +02:00
Ulf Hermann
80c17af940 QProperty: Don't needlessly calculate inBindingWrapper()
If there is no binding data, we don't need it. inBindingWrapper()
involves a TLS lookup.

Pick-to: 6.2
Change-Id: I829f314d708b80821e907124eef4aec758bbbc6a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-10-18 18:23:13 +02:00
Tor Arne Vestbø
44b7a1a37b Don't hide dialogs before closing them
When a dialog was accepted or rejected via done(), we used to only hide
it, but as of 0246bfd40a we now close it.

Closing a widget results in hiding it as part of handleClose, so we
do not need to explicitly hide it before calling close(). In fact
doing so prevents the lastWindowClosed logic from checking whether
the window was visible before handling the close event, which is
documented to be a requirement for a window triggering lastWindowClosed.

We still need to hide the widget in case we don't end up closing it
ourselves, to ensure QDialog::closeEvent accepts the close. The reason
for the code in closeEvent seems a bit dubious, but that's left for
future adventures.

Change-Id: Ic32b965d495c08996c3a199bbee798df0206216c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-18 15:29:09 +02:00
Tor Arne Vestbø
df359bcb70 Decouple quitOnLastWindowClosed from quitLockEnabled
In a512e210ac5b032c5fc2edf1ddf72e5a414485fda512e21 quitOnLastWindowClosed
was changed to be implemented in terms of quitLockEnabled, but without
any documentation to that end.

Although the two features are similar (automatic quit under certain
conditions), and interact, it doesn't make sense to overlap them until
we actually expose them as a single property (automaticQuit e.g.)

The logic for determining whether we can can quit automatically has
been refactored to take both properties into account, on both a Core
and Gui level. The call sites still need to check the individual
properties to determine whether to activate automatic quit for
that particular code path.

Change-Id: I38c3e8cb30db373ea73dd45f150e5048c0db2f4d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-18 15:29:09 +02:00
Tor Arne Vestbø
55f8f916ce Fix indentation in inputMethodQuery implementations
Change-Id: I406194e084f62f16d432eae63845bcc3da148ac0
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-18 15:29:09 +02:00
Sona Kurazyan
8a8bf1b84e Fix docs for comparison/debug/data stream operators of Qt containers
Because of the constraints on comparison, debug and data stream
operators, the return types for them look weird in docs. Conditionally
use the actual return types, in case if Q_CLANG_QDOC is defined.

Also add the docs of debug stream operators for types for which they
were misssing.

Task-number: QTBUG-97247
Pick-to: 6.2
Change-Id: I57f2c52bd3af805c7eeebb602c47de1e95ee09bd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-18 13:42:07 +02:00
Jonas Kvinge
2f2fdc418d sqldrivers: Fix typo in error message
Pick-to: 5.15 6.2
Change-Id: I6354275d04ee9474d4baeaaf0b14a52aca3dd70c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-18 13:42:06 +02:00
David Skoland
723a2c34a5 Make sure Qt::Popup is treated like a dialog
According to the documentation, Qt::Popup should have a proper frame
with a title bar. To honor this, two functions had to be
slightly altered.

Change-Id: I4bbc18e6b7fbec5702fad6e22ef2226c09dea15a
Fixes: QTBUG-94768
Pick-to: 5.15 6.2
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2021-10-18 13:42:06 +02:00
Volker Hilsheimer
5335cc4a5a Fix cursor positioning on bidi boundaries
When the cursor is positioned between to script items that have different
writing directions, prioritise the script item that has the same direction
as the paragraph (i.e. the QTextEngine) when deciding where and how to
display the cursor. If visual cursor movement is enabled, the behavior is
unchanged.

As a drive-by, clean up coding style and avoid shadowing of function-
local variables.

Task-number: QTBUG-88529
Pick-to: 6.2
Change-Id: I15227b10b1469d9caf1235b00e4d6f9f64a8b510
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-18 13:05:42 +02:00
Volker Hilsheimer
f54044d4a9 Fix cursor placement at left and right ends of bidi text
In a text line that has a change of direction at either end of the text,
the cursor needs to be positioned where the next character is inserted,
or where backspace deletes the previous character. In bidi text, this is
ambiguous as illustrated by this example:

abcشزذ

Depending on whether this string was typed in a left-to-right document
or in a right-to-left document, it could be first latin, then arabic; or
it could be first arabic, then latin.

If a general left-to-right context, cursor position 0 should be in front
of the 'a', and cursor position 6 should be at the end of the arabic
text, in the visual middle of the line. Cursor position 3 can be either
after the 'c' if the next character typed would be latin, or at the
visual end of the line if the next character will be arabic.

Qt calculated the cursor position past the right end of the text as 3
(which is not wrong, but 3 has two visual positions), and placed the
cursor at the visual end of the line (favoring the right-to-left
alternative). Backspace would then delete the 'c', writing a new
latin character would insert a 'd' next to the 'c', writing a new arabic
character would insert it also in the middle - none of these operations
happen at the visual end of the line, where the cursor was blinking.

To fix this, we take into account the general layout of the text, which
is typically based on the document, or the user's locale setting and UI
translation, and calculate the cursor position accordingly: if we are
past the visual end of the document on either side, then the cursor
position is either 0 or the last character of the text, depending on the
direction of the QTextEngine used. This way, the cursor ends up in the
middle of the document when we click beyond the end of the line, which
is where characters are removed and inserted. Typing a 'd' at this point
will make the cursor jump to the end, where the d is added.

There are still corner cases: clicking on the right-most arabic character
calculates the cursor position as 3, which is then ambiguous, as it can
be either at the visual end of the string, or next to the 'c'. َQt makes
the inconsistent choice to place the cursor at the visual end, showing
the left-to-right indicator, but pressing a 'd' adds the 'd' after the
'c' in the middle of the text.

Fixes: QTBUG-88529
Pick-to: 6.2
Change-Id: Idccd4c4deead2bce0e858189f9aef414857eb8af
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-18 13:05:42 +02:00
Thiago Macieira
e652fa4d3e Q_GLOBAL_STATIC: suppress warning about expressions in noexcept()
We use a simple statement to try and mark the holder as noexcept and that
works for most cases (but not all). It triggers a warning when the
expression is complex, though, like this in qlocale.cpp:

Q_GLOBAL_STATIC_WITH_ARGS(QSharedDataPointer<QLocalePrivate>, defaultLocalePrivate,
                          (new QLocalePrivate(defaultData(), defaultIndex())))

Pick-to: 6.2
Change-Id: Iea05060bc2c046928536fffd16adf4be6126d039
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-18 08:53:27 +00:00
Thiago Macieira
8c2969ea86 QPlugin: Move the plugin metadata to a note in ELF platforms
A few systems, like OpenWRT, may strip the section table off the
resulting binaries (see [1]), making it impossible for us to pinpoint
the exact location of the Qt plugin metadata. This commit moves the meta
data to a location that is identifiable even in fully stripped binaries:
an ELF note.

By naming our section ".note.qt.metadata", we instruct the linker to
place it along the other notes and to mark it in the program header
section. Another advantage is that the notes are usually in the very
beginning of the file, as they are used by the dynamic linker itself, so
we'll need to read much less of the full contents.

The unit test is modified not to attempt to strip the plugin of
debugging data. In fact, we add something to the end that would,
otherwise, be matched as (invalid) metadata.

The following was produced with GCC 11 and GNU binutils ld 2.36.1.

Section Headers:
[Nr] Name                 Type         Addr             Off      Size     ES Flags Lk Inf Al
[ 0]                      NULL         0000000000000000 00000000 00000000  0        0   0  0
[ 1] .note.gnu.property   NOTE         00000000000002a8 000002a8 00000030  0 A      0   0  8
[ 2] .note.gnu.build-id   NOTE         00000000000002d8 000002d8 00000024  0 A      0   0  4
[ 3] .note.qt.metadata    NOTE         00000000000002fc 000002fc 000001ac  0 A      0   0  4

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
...
  NOTE           0x0002a8 0x00000000000002a8 0x00000000000002a8 0x000030 0x000030 R   0x8
  NOTE           0x0002d8 0x00000000000002d8 0x00000000000002d8 0x0001d0 0x0001d0 R   0x4

The Qt metadata note is 4-byte aligned and can thus be found in the
second note section, which spans from 0x02d8 to 0x02d8+0xac=0x0384.

GNU readelf -n can even show it:

Displaying notes found in: .note.qt.metadata
  Owner                Data size        Description
  qt-project!          0x0000018f       Unknown note type: (0x74510001)
   description data: 01 06 03 81 bf ...... ff

I chose 0x7451 as the prefix for our notes, even though they're already
namespaced by the owner in the first place, because eu-readelf
mistakenly tries to interpret note 1 as a GNU ABI tag regardless of
owner. The owner name was chosen to be 12 bytes long, so the ELF note
header is 24 bytes in total. There's no space wasted because the payload
needs to be aligned to 32-bit anyway and I didn't want to use only 4
characters (header total size 16 bytes) so we'd skip the "GNU" note on
size, without string comparison. And I couldn't think of a 4-character
representative string ("QtP" ?).

[1] https://github.com/openwrt/video/issues/1

Fixes: QTBUG-96327
Change-Id: I2de1b4dfacd443148279fffd16a3987729346567
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-18 01:53:27 -07:00
Thiago Macieira
d09306064f QUtf32: remove set-but-not-used variable
Found by clang 13:

qstringconverter.cpp:1039:15: warning: variable 'length' set but not used [-Wunused-but-set-variable]

Pick-to: 6.2
Change-Id: Iea05060bc2c046928536fffd16adf46d4934c37c
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-10-18 01:53:27 -07:00
David Skoland
2c648fea57 Add comment about the meaning of magic number in QWasmEventTranslator
Without this comment, the button == 0 code is very cryptic.
This comment helps in deciphering what exactly is being checked.

Change-Id: Ied96118362d097d7036bafcc491b8574e1225de1
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2021-10-18 08:07:20 +02:00
Eirik Aavitsland
73119e27b3 Handle DPR in QPainter's drawing methods taking a brush parameter
The emulation paint engine is required not only for non-LogicalMode
gradient brushes, but also for texture (pixmap/image) brushes with
DPR != 1. fillRect(), strokePath() etc. would check for the former
case, but not the latter.

Fix by factoring out a common checking function.

Pick-to: 6.2 5.15
Fixes: QTBUG-89101
Change-Id: I3cddf8a86a321de97b12c85a187069e77d2acea6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-10-18 07:52:35 +02:00
Thiago Macieira
fc3ac31891 QFontDatabase: suppress warning about its constructor being deprecated
qmetatype.h:2263:76: warning: 'QFontDatabase' is deprecated: Call the static functions instead [-Wdeprecated-declarations]
...
moc_qfontdatabase.cpp:159:1: note: in instantiation of variable template specialization 'qt_incomplete_metaTypeArray<qt_meta_stringdata_QFontDatabase_t, QtPrivate::TypeAndForceComplete<QFontDatabase, std::integral_constant<bool, true>>>' requested here
qfontdatabase.h:113:7: note: 'QFontDatabase' has been explicitly marked deprecated here

Change-Id: Iea05060bc2c046928536fffd16adf537be122db2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-16 11:59:10 -07:00
Thiago Macieira
d91b2a4479 QtWidgets: remove set-but-unused variables
Found by clang 13:

qlayoutengine.cpp:80:9: warning: variable 'cMax' set but not used [-Wunused-but-set-variable]

Change-Id: Iea05060bc2c046928536fffd16adf54d1527e657
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-16 08:49:27 -07:00
Shawn Rutledge
362e56b520 Markdown importer: keep entities in HTML blocks with the HTML
If an entity occurs directly in markdown, we parse and insert it
directly; but if it occurs in an HTML block, it has to be added to the
HTML accumulator string for deferred parsing when the HTML block ends.

Pick-to: 6.2
Fixes: QTBUG-91222
Fixes: QTBUG-94245
Change-Id: I0cf586d68d6751892ca035a98f77cd67950d3bc4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-16 16:10:49 +02:00
Tor Arne Vestbø
848e3855f9 macOS: Don't require marked text before passing mouse down to input context
There are situations where the input context might want the event,
even if there's no marked text, for example when long-pressing A
with a US keyboard layout and getting the accent popup. In that
case we want a press somewhere else in the input item to move the
cursor, and commit the current preedit.

This is the same approach as NSTextView has, always calling
handleEvent, and in line with the recommendation from Apple:

 https://lists.apple.com/archives/cocoa-dev/2012/May/msg00539.html

Pick-to: 6.2
Change-Id: Iff0861a4e604ab594d1ad4ccbb9367d8e0ffe4ef
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-16 14:33:29 +02:00
Tor Arne Vestbø
3007050db7 macOS: Pass on mouse press if input context didn't handle it
We follow the approach of [NSTextView mouseDown:] by bailing out if the
input context handled the event, and otherwise passing it along to the
input item.

This allows moving the cursor with a single click in the input item,
which will also commit the current preedit string as is, depending on
the input context.

For some reason 2-Set Korean input results in plain insertText calls
for each step of the composition with an NSTextView, while we get
marked text. The result is that when composing with 2-Set Korean,
a native NSTextView will only require a single click to move the
cursor, while for us it requires two, since the input context says
it handled the event.

We opt to follow the behavior of NSTextView to bail out if the
input context handled the event, instead of trying to emulate
the observed behavior for 2-Set Korean by always passing the
mouse event on, as the former seems like a safer approach.

This is also in line with the recommendations from Apple:

 https://lists.apple.com/archives/cocoa-dev/2012/May/msg00539.html

Pick-to: 6.2
Change-Id: I372ac62ee3b8b20531cd7cfa2d412a5efea3eb68
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-16 14:33:29 +02:00
Tor Arne Vestbø
0488fde042 Add implementation of QCocoaInputContext::commit()
Without this we end up treating input method commits from the
input items as cancellations, as the base class implementation
doesn't do anything.

Pick-to: 6.2
Change-Id: Ieeed71404ee32ab51287b2f4f2d70ffcf9d8e7ef
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-16 14:33:29 +02:00
Tor Arne Vestbø
c67f46877c macOS: Only send mouse press to input context if clicking input item
Our QNSView can represent many controls, not just the current input item,
so we need to ensure the click happens inside the input item before we
ask the input context to handle the event.

This allows clicking controls such as buttons and check boxes while
composing complex text, without cancelling or otherwise affecting
the composition.

Fixes: QTBUG-57347
Pick-to: 6.2
Change-Id: I8449c8d74fd21b1ee1d5bd75f960751b64d7e078
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-16 14:33:29 +02:00
Tor Arne Vestbø
1dfc74970c Deduplicate lastWindowClosed handling
Whenever a window was closed, we had logic to check if it was the last
window, and if so emitted lastWindowClosed and then tried to quit the
application. But the automatic quit process also checked if there were
any remaining windows, as this process could be triggered as a result
of a QEventLoopLocker going out of scope. The two paths now share the
same logic for determining if there are any remaining windows.

The docs have been updated to reflect the original intent of the logic,
dealing only with primary windows (top levels without a transient parent).
This was how both the original code paths implemented their logic.

For historical reasons the Qt::WA_QuitOnClose attribute is closely
tied to the lastWindowClosed signal, and isn't merely limited to
controlling whether we try an automatic quit when the last window
closes. For now this behavior has been kept, but the docs have been
updated to clarify how the attribute is handled in practice.

Change-Id: If3d06b065236aad2e59e9091cac3146bc4cf79f6
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-16 14:33:28 +02:00
Tor Arne Vestbø
30404b49d8 Remove unused parentWidget variable in QWidgetPrivate::handleClose
It was a leftover from when the quitOnClose logic was duplicated in the
handleClose function.

Change-Id: I38903b7e30ef1cf1d0dce87f61097a83259aea8e
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-16 14:33:28 +02:00
Joerg Bornemann
879f86098e Remove zlib from bootstrap library
None of the bootstrapped tools use zlib anymore.

Change-Id: I2cd7cb855ed671916a21c23449d9b6c4506f8546
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-16 14:33:28 +02:00
Giuseppe D'Angelo
896f71d500 QList: deprecate iterator<->pointer implicit conversions (3/3)
Follow-up of the previous commit: in case the implicit conversions
between iterator and pointers are disabled, then reintroduce
the non-template arithmetic operators for the iterator classes.

Change-Id: I8cee60fe77ee3a47e189b4b53a08e39408f9db18
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-16 13:48:27 +02:00
Giuseppe D'Angelo
b6cbd9c43a QList: deprecate iterator<->pointer implicit conversions (2/3)
The constructor from a raw pointer should be
1) constexpr,
2) explicit, and
3) *private*.

We can do 1) without too much trouble.

2) is a (easy to fix) SIC in case of implicit conversions accidentally
relied upon from somewhere.

3) cannot be "easily" fixed by user code (they have to refactor), and
also, it's a BIC on Windows which encodes class members' access in
symbols. Someone may have been exporting some QList subclass, in turn
exporting the iterator classes, and therefore that someone now has the
constructors' symbols with a given access.

So, don't do 2+3 _just yet_ for user code, but set a deadline: Qt 6.5 is
the last that will support this. On Qt 6.6, we switch. All of this on
non-Windows, againt to avoid an ABI break. One can opt-in at any time
via a suitable define.

Given we have this define, use it to guard the other way around as well:
conversions from an iterator to a raw pointer should never be explicit
(there's std::to_address for this).

[ChangeLog][QtCore][QList] Converting a QList's iterator from and to a
raw pointer is deprecated, and will get removed in Qt 6.6. User code can
prepare for the change by defining QT_STRICT_QLIST_ITERATORS.

Change-Id: I0f34bfa3ac055c02af5a3ca159180304660dfc11
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-16 13:48:27 +02:00
Giuseppe D'Angelo
0220484329 QList: deprecate iterator<->pointer implicit conversions (1/3)
QList<T>::(const_)iterator both feature an implicit operator T*.

This operator exists in order to keep compatibility with Qt 5 code,
where QVector<T>::iterator _was_ indeed a T*. However, iterators are
not proxy objects and should not convert to T* (at least, not
implictly). In fact we've already seen compilers complain about
ambiguous calls when e.g. moving an iterator through an arithmetic
operation (say, operator+).

For instance, if one does

  it + number

and the numeric argument of that call is not precisely qsizetype
(but, say, int), then the call is ambiguous between

  operator+(iterator, int promoted to qsizetype)
  operator+(pointer (converted from iterator), int)

One can imagine similar failures in generic code. In short: let's
deprecate (not remove) the implicit conversion, and let people use
iterators for what they are.

Task-number: QTBUG-96128
Change-Id: I008348beefe00e4449b2d95c21c842d676390a26
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-16 13:48:27 +02:00
Edward Welbourne
c6bd13ab3d Mention a change to QDateTimeEdit::setDateTime()
I neglected to record the change in the Qt 6 changes documents that
help folk migrate from Qt 5. This is a follow-up to
commit 2a653fde48

Fixes: QTBUG-97493
Pick-to: 6.2 6.2.1
Change-Id: Ie496fdd05759eeeac4c7610db40ab6745b5e0640
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-10-16 13:01:33 +02:00
Friedemann Kleint
bb56560b6b Polish the painting/affine example
- Use member initialization
- Remove C-style casts
- Add space around operators
- Use qsizetype for list indexes
- Remove commented out debugging code

Task-number: QTBUG-97095
Pick-to: 6.2
Change-Id: I11a17fa6e7f17968367a57291d83ee6fba731a34
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-10-16 12:52:29 +02:00
Povilas Kanapickas
a875503d9e xcb: Use byte buffer for event masks
This prepares for use of masks larger than 32 bits which happens on XI
2.4. Additionally, since the XI protocol always sends the masks using
little-endian, the XI protocol support on big-endian machines was
currently broken.

Change-Id: Id22131e075059cea783b5be0691a673a457c7364
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-10-16 12:52:29 +02:00
Volker Hilsheimer
32edae5e26 Fix restoring main window state for maximized/fullscreen windows
On systems that asynchronously resize the window to maximized or full
screen state, the window will become visible in its normal geometry
before it gets the final size by the windowing system. This might cause
multiple resize events, to each of which the widget's layout responds
with a call to its setGeometry implementation.

The QMainWindowLayout is special in that it will shrink dock widgets if
there is not enough space for them, but it doesn't grow them back once
there is. With the initial resize event being for a smaller size than
what was restored, the state is not restored correctly, but remains in
the state that fit into the smallest size with which setGeometry got
called.

To fix this, we have to keep the restored state around until the window
either gets a size that is large enough for it to fit, or until we can
be reasonably certain that the windowing system is done resizing the
window while transitioning it to the maximized or full screen state.
Since across the various platforms and windowing systems there is no
reliable way to know when the window reaches its final size, we have
to use a timer that we (re)start for each call to setGeometry with a
size that's not large enough. Once the timer times out, we have to
give up; then the last layout state calculated is the final state.

To calculate the size of the layout, introduce a function to the
QDockAreaLayout that returns the size required for the current sizes
of the docks. Refactor sizeHint and minimumSize (which were identical)
into a helper template that takes member-function pointers to call the
respective method from the dock area layout's content items.

Add a test case for various permutations of the scenario. The timeout
of 150ms is based on running this test case repeatedly on various
desktop platforms and X11 window managers.

Fixes: QTBUG-46620
Change-Id: I489675c2c40d3308ac8194aeb4267172b2fb38be
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-16 09:46:22 +02:00
Jonas Kvinge
553a1c48fd widgets: Fix typos in source code comments
Pick-to: 6.2
Change-Id: I22f71a53b0f7f0698450123343e25548c889c3e2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-10-15 20:07:09 +02:00
Joerg Bornemann
dedb29cf23 Fix high DPI position of foreign child windows on Windows
Suppose you have a child window that is a foreign window.  In the bug
report's example it's a QAxWidget that wraps the Windows Media Player.

This means, we have a non-top-level QWindow with a platformWindow
assigned.  If windows:dpiawareness is set to 1 (system-DPI aware) and
the window is displayed on a screen with origin != (0, 0), then we
called QPlatformWindow::setGeometry with a position in native
coordinates.  This moved the child window outside of the visible area.

Fix this by calling QHighDpi::toNativeWindowGeometry instead of
QHighDpi::toNativePixels.  The former function takes child windows
properly into account.

Pick-to: 6.2
Fixes: QTBUG-96114
Change-Id: Ibb0f844b10aece8ede99cb34289c0430ac283fa0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-10-15 20:03:34 +02:00
Alexandru Croitor
aad4158959 CMake: Postpone target existence check for qml plugin targets
Each included qml Qt6FooPluginTargets.cmake file checks whether
all the dependency targets that are referenced in the file already
exist by the time the file is included.

If one of the referenced targets is missing, the file sets
${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE with a message mentioning
which targets are missing and also sets
${CMAKE_FIND_PACKAGE_NAME}_FOUND to FALSE.

All our qml package Config.cmake and Targets.cmake files are
include()d by Qt6QmlPlugins.cmake using a file(GLOB) which means the
order in which the files are loaded is implementation-defined.

Furthermore we didn't check the above set variables after each
inclusion, which means the values are overridden and the last plugin
to be loaded determines whether the Qml package is found or not.
If the last included file sets no error, it effectively silences any
previously set error.

Ever since we added dependencies between the qml plugin targets
themselves, we hit the above situation and depending on the platform,
no error was shown because the last file overrode any errors.

But we finally got a specific platform (wasm) which unearthed the
problem (QTBUG-97478). This can happen for any static Qt build though.

To fix this properly, we will most likely have to rewrite the whole
inclusion mechanism to use find_package() so that dependencies
can be resolved recursively as needed. This is a non-trivial change
that will have to be addressed in both qtbase and qtdeclarative.

In the mean time, a stop-gap solution that this change implements is
to include all the files while ignoring any error messages.
Then include the files one more time and check for error message after
each included file.

All qml plugin targets should have been brought into scope with the
first round of inclusions, thus circumventing "missing referenced
target" errors, while still catching any other possible errors.

Amends
6fd1216801f078f65be2cbc748cc459cb6912a4f
9fc302e6d146878103b3d105dce49c7695fcf93a
c368175a9e0a0c120b5bb8a0a02859bfc0cf42ba
in qtdeclarative.

Pick-to: 6.2 6.2.1
Fixes: QTBUG-97478
Task-number: QTBUG-95609
Task-number: QTBUG-97099
Change-Id: I157fa93fc979d726cd221d969b995b3642aeec77
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2021-10-15 18:25:29 +02:00
Tor Arne Vestbø
f572b88899 Clarify QWidget::normalGeometry documentation
The property reflects the widget's current geometry if it is not in a
full screen or maximized state.

Pick-to: 6.2
Change-Id: I5816687119500995654a926aef952d788ad74886
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-10-15 18:14:25 +02:00
Alexey Edelev
2b6500cd15 Add PRIVATE_MODULE_INTERFACE to the module dependency set
PRIVATE_MODULE_INTERFACE libraries are linked as interface libraries to
the module's Private target and exported as the dependencies of package
targets. We need to register these modules as public package dependencies
to call find_package when resolving module dependencies in user
projects.

Pick-to: 6.2
Fixes: QTBUG-96558
Change-Id: I4eef550aab306eaf357539ef7a0f76d69873f856
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-15 15:53:23 +02:00
Alexey Edelev
f19f729511 Improve double call protection of qt_internal_generate_tool_command_wrapper
file(GENERATE) might fail if an unrelated configuration error happens,
and yet QT_TOOL_COMMAND_WRAPPER_PATH would already be set. Set the
cache variable only if generating was successful and replace the
QT_TOOL_COMMAND_WRAPPER_PATH valiable check with GLOBAL property to
protect the function from double call.

For CMake versions higher than or equal to 3.18 replace 'file(GENERATE'
call with 'file(CONFIGURE' to generate the wrapper at configure time
with the use of a plain semicolon character.

Pick-to: 6.2
Fixes: QTBUG-96870
Change-Id: Icf9c40f571d9c069043604f67ffcf2762966f6d0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-15 15:53:23 +02:00
Andy Shaw
a36c84c6a3 When filling a pixmap after an assignment ensure the set DPR is not lost
Pick-to: 6.2 5.15
Change-Id: I649547ea277f9d074e6638e4b7b1206d3d3d976b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-10-15 10:27:15 +02:00
Mårten Nordheim
ed3e1ecb27 QOpenSSLBackend: Properly load 3.0 when compiled with 3.0
The naming updated but the version suffix is hardcoded on windows
and it was overlooked when work was done to support OpenSSL 3.

Fixes: QTBUG-97116
Pick-to: 6.2 5.15 6.2.1
Change-Id: Iec15d772c54ed214940ec5634a0929485478f771
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-10-15 08:21:17 +00:00
Giuseppe D'Angelo
ad972af8fb QList: add mixed comparison operators between (const_)iterators
It is currently possible to compare a QList iterator with a
const_iterator and viceversa, even though these operations aren't
defined, because they are actually routed through the relational
operators between iterators and raw pointers after a conversion (!).

With the deprecation of iterator->pointer implicit conversions, this
is going to break, so add the missig mixed comparison operators.

Change-Id: Ic645ab0246f79f64b04334ecd02e9fe8fa46f0fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-15 10:19:17 +02:00
Iikka Eklund
be3df082bc Conan: Do not use f-strings
Conan supports Python3.5 which does not support f-strings yet.

Pick-to: 6.2
Change-Id: Ie4b64e3baff7da64b80db71f4f0ea4172ddc61fb
Reviewed-by: Toni Saario <toni.saario@qt.io>
2021-10-15 11:09:38 +03:00
Tatiana Borisova
144f3fe5a3 Fix autotest public API compilation for INTEGRITY
- getgid/getpwuid are not supported
- process should be used with config check

Task-number: QTBUG-96176
Pick-to: 6.2
Change-Id: Ib6854772bcf52f3533cb722f963426717926258b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-15 11:00:25 +03:00
Jonas Kvinge
071ebc9eee dbus: Fix typos
Pick-to: 5.15 6.2
Change-Id: I9efce6a3163ca6564d511c994776ff96999909b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-14 20:22:21 +02:00
Jonas Kvinge
1463ffc38d xcb: Fix typos in source code comments
Change-Id: I3a91f57d3c47d9e96215d5dc064664626a8f65e7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-10-14 20:22:21 +02:00
Jonas Kvinge
7ce3231749 qwindowsdialoghelpers: Fix typo in documentation
Pick-to: 5.15 6.2
Change-Id: I23e096655f68d64c0c40c02a246582916c2d1743
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2021-10-14 20:22:21 +02:00
Jonas Kvinge
3a68f49c48 Fix typos in SQL driver documentation
Pick-to: 5.15 6.2
Change-Id: I871f6eff908926485c371121113d4853064f808f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-14 20:22:21 +02:00
Jonas Kvinge
35385dcbe6 qxcbscreen: Fix typo in documentation
Pick-to: 5.15 6.2
Change-Id: I92f7d707a1395594ad6d1fe841fa77d21ae7c8b1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-10-14 20:22:21 +02:00