Commit Graph

61408 Commits

Author SHA1 Message Date
Mårten Nordheim
825a37da66 tst_QSslCertificate: Make it easier to check which backend is used
Instead of having one member signaling !openssl
let's just add booleans for openssl, schannel and securetransport.
The latter two of which are not currently used but may be in the future.

As a drive-by, make a compile-time check into a runtime one.

Change-Id: Id2f51f5396383a3f5836ac708996bfce8ae35c91
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-04-25 23:39:24 +02:00
Morten Sørvig
15dab565d0 wasm: rework local font support
Populate a subset of the font families at startup if the local fonts
access API is supported, and the access permission has been given.

Since this code runs at app startup there is no opportunity to request
font access. That should be done in response to user action, for
example by having a "load local fonts" button in the application.

Pick-to: 6.5
Change-Id: Ib6826deeec06ee3def0e793dd1462977710462be
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
2023-04-25 21:38:08 +00:00
Hatem ElKharashy
c10c66e552 Support float_type arrays when using lttng
lttng ctf_array does not support float types which
causes compilation error when a float type is passed
to the function. A solution is to pass the array
elements one by one to TP_FIELDS.

Fixes: QTBUG-112761
Pick-to: 6.5
Change-Id: I30e7049d9eda1141298145897df372213145c1b4
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2023-04-25 20:57:43 +00:00
Timothée Keller
21e4116874 Windows QPA: Fix restore geometry after dragging from maximised
Start tracking the window geometry before a mouse drag, so that we can
revert back to that geometry when we restore from maximised. Previously,
when dragging from maximised to maximised, the restore geometry would
end up being the final drag place before snapping to maximised, instead
of where the window was before the first maximised.

Fixes: QTBUG-112814
Pick-to: 6.5 6.2
Change-Id: Ic2ddf29d6c4abdc9e8b0c5161b17aa6ee9474ea3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-04-25 22:57:43 +02:00
Amir Masoud Abdol
eec5a016d3 Remove an unnecessary None definition
We should be able to just pass `0L` and avoid defining a None macro.

Pick-to: 6.5
Change-Id: I513d726120454523627a1e66515a5a533c0238b1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-25 22:57:42 +02:00
Mikolaj Boc
07a736db6a Remove FileReader callbacks before assigning new ones
This fixes the assert raised on overwriting event handlers

Fixes: QTBUG-113041
Change-Id: Ie2afe09f4111ea542297b82a51382f1eb04ec960
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
2023-04-25 22:57:42 +02:00
Thiago Macieira
0198611fd4 Revert "Exclude files from unity build"
This reverts commit e0cec08480.

Reason for revert: this can't possibly be the correct solution. It
set properties in headers (not .cpp sources) and headers can't cause
a build issue because they aren't built. Moreover, the problems
were seen in another module, so the properties set in those files
shouldn't even be visible to CMake.

Change-Id: I8473bb819e768bd203f89034d18132186da0371c
Pick-to: 6.5
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-04-25 17:49:34 +00:00
Mikolaj Boc
d09855ae7b Copy memory to buffer when saving files on wasm with threading on
wasm heap uses a shared array buffer, which cannot be fed to
FileSystemWritableFileStream.write due to security limitations.
Heap memory has to be copied to a temporary buffer for the operation to
succeed.
This is only done if __EMSCRIPTEN_SHARED_MEMORY__ is on to optimize the
non-threading path.

Fixes: QTBUG-112881
Pick-to: 6.5
Change-Id: I0d117a8703caf4c17abc67b30df5248a53406d5f
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-04-25 19:24:33 +02:00
Laszlo Agocs
5ebb9a8bf3 Tune textures example to work with wasm and update docs
Old examples inherited from Qt 4 tend to set some state, such as
enabling the depth test or culling, in initializeGL(). Newer examples
tend not to do this; they rather set the necessary state in paintGL().

This mattered little (or not at all) in the past, but with WebAssembly
and WebGL there are limitations in the GL context management in the
wasm platform plugin. Under certain conditions, esp. when
QOffscreenSurface is involved, it looks like the same native context
gets reused, which means there is a chance of unexpected changes to
the current state between calls to initializeGL() and paintGL(). (and
also between paintGL() calls) See QWasmOpenGLContext for details.

Update the textures example the same way we did for the cube one.

Add a note to the QOpenGLWidget docs about this problem.

Task-number: QTBUG-111304
Pick-to: 6.5 6.4
Change-Id: I29d2b2cdeb07bcecc5dc915d79c12b4323ca9ab3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Inho Lee <inho.lee@qt.io>
2023-04-25 18:10:44 +02:00
Laszlo Agocs
11209cfde6 gl: Check for image validity in readback
Returning a null QImage is preferable over passing a null bits()
to glReadPixels. (matters when QImage's malloc() gives null, thus
'd' is null -> isNull() == true)

Fixes: QTBUG-113127
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Ieca4d91eefdea47da5251dabe77cc31b48eb0e28
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-04-25 18:10:44 +02:00
Leena Miettinen
ab4125685a Doc: Fix issues in CMake command docs
- qt_finalize_target missed a reference to qt_add_plugin()
- qt_generate_deploy_app_script is also supported on Linux
- Use simplers examples for QT_DEPLOY_SUPPORT and
  qt_standard_project_setup()

Task-number: QTBUG-113116
Pick-to: 6.5
Change-Id: If6bfd01b9615a73ab1bafddee350e49f6902a6c0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-04-25 18:10:44 +02:00
Timothée Keller
e86fcae221 Windows QPA: Handle DPI induced geometry change for frameless windows
Make a manual call to the geometry change handling function after a
WM_DPICHANGED event if the window is frameless, since WM_SIZE and
WM_MOVE will not be called.

Fixes: QTBUG-109429
Pick-to: 6.5
Change-Id: I79b9f386fe120ee3d06d6490d3f31a7a5d7121b0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-04-25 15:53:34 +01:00
Marc Mutz
efd9e3a02b tst_qxmlstream: remove dependency on QtXml
QtXml is only DOM and SAX, not QXmlStreamReader/Writer (those are in
QtCore).

Pick-to: 6.5 6.2
Change-Id: I8454d7db90303d347d5b4be94c9f21401d1e273f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
2023-04-25 16:53:34 +02:00
Topi Reinio
4fc3f0c159 Doc: Exclude licensing header when including a .qdocinc
The \include command includes the source in its entirety when the
second parameter is omitted. This pulled in also the license header
which was visible in the generated documentation.

Add snippet tags and use them to extract only the content we need.

Pick-to: 6.5
Fixes: QTBUG-113138
Change-Id: Ie3fe2fede1e81d08201ec4353352ef069aebc388
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-04-25 15:03:03 +02:00
Marc Mutz
e1818d9e9c QXmlStreamAttributes: port value()/hasAttribute() to QAnyStringView
[ChangeLog][QtCore][QXmlStreamAttributes] Ported value() and
hasAttribute() to QAnyStringView.

Change-Id: I771b9cede1d581d3f1142246e7a25c36bcc850d6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-25 15:03:03 +02:00
David Schulz
c818acda97 Improve style drawing under DPR scaling further
Rounding distances up can result in coordinates outside of
the clip rect. So stick to always round distances down when we multiply
a scaling.

Fixes: QTBUG-109640
Pick-to: 6.5
Change-Id: I784b7c90da9b6e7f5a925d4275eb67497616001d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-04-25 09:00:24 +00:00
Ahmad Samir
0d26db5737 QEvent: fix a narrowing conversion warning
By using an iterator-based for loop.

Change-Id: I9ae12f16bc2a5c2d74c8557a0324438102fec5b1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-25 06:15:47 +02:00
Ahmad Samir
4538bbf4a6 Misc.: Fix some narrowing integral conversion warnings
Drive-by change: use QByteArrayView instead of allocating a QByteArray.

Change-Id: Iaf7acbbdb4efbb101b73b30061ce38dd1fa99ca3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-25 06:15:36 +02:00
Ahmad Samir
d8a688adf0 QEventDispatcherGlib: fix some narrowing conversion warnings
"notifier->socket()" returns qint64, but sockfd should be int, because
pollfd.fd is a gint (aka int).

Change-Id: If6618aa5e652d4284b989352d61a28b605106d09
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-25 06:15:31 +02:00
Ahmad Samir
39c191d003 QCommandLineParser: fix some narrowing conversion warnings
Drive-by change: use auto for iterator types.

Change-Id: I463f24890ee58a97e585a0596aed55543285b0a0
Reviewed-by: David Faure <david.faure@kdab.com>
2023-04-25 06:15:26 +02:00
Paul Wicking
ab636a95c3 Doc: Show correct headerfile for StringLiterals
The automatically generated `#include` statement for the
`Qt::Literals::StringLiterals` namespace contains the wrong header file
name. Use QDoc's `\headerfile` command to ensure QDoc generates the
correct `#include` statement.

Pick-to: 6.5
Fixes: QTBUG-112884
Change-Id: I825402dc9d8d451fecc120697486d4bf81e468d3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-25 04:26:43 +02:00
Axel Spoerl
72d6768ec1 Add missing nullptr check in QWidget::setFocusProxy
b1802a164b added handling for a parent to
become focus proxy of a child. The respective 'else if' branch didn't
check whether setFocusProxy() was called with a nullptr argument.

This patch adds the missing nullptr check.
It also adds functionality to tst_QWidget::tabOrderComboBox() to test
the removal of a focus proxy, as well as the complete removal of an
element from the focus chain.

Change-Id: I4cb865b9ac4497fc5e2595910738fb77694f5837
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-25 04:26:10 +02:00
Tor Arne Vestbø
ac0953c34d macOS: Handle failure to create display link or invalid display link
In some rare situations the display link may fail to create, or will
be created in an uninitialized state:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1201401#c123

When the latter happens the display link thread will crash in
CVCGDisplayLink::getDisplayTimes(). Based on the Mozilla bug
report, and subsequent patch, we can detect this situation via
CVDisplayLinkGetCurrentCGDisplay(), so we follow the same
approach, and then bail out:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1201401#c158

Once we bail out we fall back to the timer based approach
to delivering the update request. The next requestUpdate()
will try to use the display link again, which will likely
work this time around, as the display has had time to fully
initialize.

Pick-to: 6.5
Change-Id: Ib80fd792516d1e4e7f863a82755cbf00d1eb6c34
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-04-24 23:21:29 +02:00
Axel Spoerl
11f14c3b0d QDomDocument: no longer drop a provided 'standalone' attribute if 'no'
- Definition of 'standalone' attribute:
An XML declaration containing the attribute 'standalone' with its
value set to 'yes', tells the parser to ignore markup declarations
in the DTD and to use them only for validation.
The declaration attribute is optional and defaults to 'no'.

- Behavior Qt5
In qt5, DOM documents contained the standalone attribute,
regardless of whether or not it was explicitly specified.

- Behavior Qt6
In Qt6, the standalone attribute was only contained in a DOM document,
if its value was 'yes'. If it was explicitly declared with the value
being 'no', it was dropped in the DOM document.

- Expected behavior
If the source specified it overtly, then the generated XML should
contain the attribute, even when it takes its default value.

- Code base
QXmlStreamReader provides a public bool getter isStandaloneDocument().
This says whether the document is standalone or not.
The information whether the attribute was actually specified gets lost.
In consequence, the attribute was always dropped on non-standalone
documents.

- Fix
This patch makes hasStandalone a member of QXmlStreamReaderPrivate, to
record whether the attribute has been explicitly specified.

QDomParser is modified to retain the standalone attribute, if
QXmlStreamReaderPrivate::hasStandalone is true.

- Test
The patch adds a test function in tst_QDom.

Fixes: QTBUG-111200
Pick-to: 6.5 6.2
Change-Id: I06a0f230a2d69597dd6453f8fd3b036943d08735
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2023-04-24 21:49:29 +02:00
Edward Welbourne
3fd7086878 Silence MSVC warning on constructing QList from initializer_list
MSVC complains because we call Data::allocate(args.size()) and, of
course, initializer_list::size() returns unsigned std::size_type,
while the relevant Data::allocate() overload takes a signed qsizetype.

The constructor from iterators potentially has the same problem, if
the iterator type's difference_type is unsigned, so make the
type-conversion overt there, too.

Pick-to: 6.2 6.5
Change-Id: I521eca26a48aed570855b13242bf2df8bfa38f96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-24 19:49:29 +00:00
Amir Masoud Abdol
e0cec08480 Exclude files from unity build
If not excluded, some of the macros in X11.h and Xlib.h conflicts with
symbols defined in `UrlFormattingOption` and `Type` in `qurl.h` and
`qjsonvalue.h`.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ic1b056f0bcd6643394401bca464f751b3489202d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-04-24 19:19:59 +02:00
Wladimir Leuschner
787038bb1d Change to darkmode is prevented at runtine in Vistastyle
Task-number: QTBUG-112965
Task-number: QTBUG-113036
Pick-to: 6.5
Change-Id: I0049e68bbd8e83025f9f576dcd712d03206859d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2023-04-24 12:25:22 +00:00
Tor Arne Vestbø
034e9b087e Darwin: Add debug logging of locale/language key parameters
Helps debug future issues in this area.

Task-number: QTBUG-104930
Pick-to: 6.5
Change-Id: Ia3f54edfa390190bb1cf3809f0cf72b105993a6a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-04-24 14:24:51 +02:00
Alexey Edelev
f3c10280f5 Introduce the qt_internal_project_setup macro
The macro sets the required CMake variables and policies and
should be called right after the
find_package(Qt6 COMPONENTS BuildInternals... call to make sure that
the subsequent code adopt all the required policies.

Pick-to: 6.5
Task-number: QTBUG-112685
Change-Id: I9f93f728ee4d8ae7743db9fffafa26025c76dcf2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-24 14:20:25 +02:00
Tor Arne Vestbø
a92c202b49 macOS: Localize title of edit menu's NSMenuItem via AppKit
In 939b7bfe66 we synced up the NSMenuItem's
title to that of the corresponding NSMenu, as AppKit was observed to use
the NSMenuItem title for its heuristics of when to add dictation and
emoji entries to the menu.

But AppKit's heuristics are based on the localized name of the edit menu,
so we need to follow suit and look up AppKit's own localizations. This
is of course fragile, as we're relying on this localization continuing
to live in the InputManager table, but if that changes we'll just fall
back to using the title from the NSMenu, as we did before.

In addition, AppKit's heuristics also look for menu items in the menu
that match selectors such as copy:, paste:, etc, so even if our lookup
of the localized title fails, the additional heuristics would in most
cases still succeed in detecting the edit menu.

Task-number: QTBUG-53085
Task-number: QTBUG-79565
Pick-to: 6.5
Change-Id: I5e12973b86ab35f10a8f7434bcae8a4cf134ecfd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-04-24 14:20:04 +02:00
Amir Masoud Abdol
c11cfc2d8d Use QCss:: namespace when accessing Value on Integrity
There seems to be a Value already defined in Integrity, and we `#undef`
it here: `text/qcssparser_p.h:39` to avoid symbol confusion. However,
this is not robust during the unity build where we might not necessary
end up with the preferred ordered of things.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ide37ab2035f0aa482a1d53d8e1511e0ab0109b3a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-23 15:29:43 +02:00
Ahmad Samir
56aa065ab5 QLocaleData: de-duplicate some code
Not using structured bindings because those functions will be changed to
return QSimpleParsedNumber directly.

Change-Id: Ic52b6754da14b86d8ddc5f399262f227e05527ce
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-22 20:04:31 +02:00
Ahmad Samir
18f5dc3746 QStandardPaths: de-duplicate some unittests code
Shorter lines, easier to read.

Pick-to: 6.5
Change-Id: Ifd83974cce2dd03bf05bcf032da2e459f1d3f798
Reviewed-by: David Faure <david.faure@kdab.com>
2023-04-22 20:04:31 +02:00
Ahmad Samir
a7555c3306 QStandardPaths/Unix: fix writableLocation() when test mode is enabled
In commit 482a75fef9 the code was changed to return early, but that
missed appending the organization and app names while test mode is
enabled.

Issue spotted by Edward.

Pick-to: 6.5
Change-Id: Ifd220f8990874a173413dcf71d105c04b605c800
Reviewed-by: David Faure <david.faure@kdab.com>
2023-04-22 20:04:31 +02:00
Ahmad Samir
e320280f61 QStandardPaths/Unix: restore org and app names in unittests
Some unittests set a custom Organization and Application names and then
clears them. Instead used init() method to "reset" those two names to
the original values before each unittest is run.

Pick-to: 6.5
Change-Id: I359f3911dd50a2aecfd8dde22e2d591adc6e224e
Reviewed-by: David Faure <david.faure@kdab.com>
2023-04-22 20:04:31 +02:00
Ahmad Samir
b9786f21b8 QDateTime: replace a bool parameter with an enum
Change-Id: Ie72b1d482c67c83cb0e2e0bfd1e00f1be2fa4899
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-04-22 20:04:31 +02:00
Ahmad Samir
b490bd0265 QDate: fix QDebug operator<<() for dates with year > 9999
ISODate only supports years in the range 0-9999; instead of printing an
empty string, use date.toString(Qt::TextDate) instead.

This is mostly useful for debugging DateTime unittests.

Change-Id: Id09951ce0a15452e28cb41a3b918c5ef05caab09
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-04-22 20:04:30 +02:00
Ahmad Samir
fa9244700e QDate: use more constexpr vars instead of plain numbers
Change-Id: I95580c199f868d632324f7f1fcbd56fa4dc85958
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-04-22 20:04:30 +02:00
Kimmo Leppälä
9c0e0e39f0 Add Qt icon library for examples
Icon library for file and text operations.
This is private library to be used with Qt examples.
Instructions on usage found in README file.

Task-number: QTBUG-110428
Pick-to: 6.5
Change-Id: I762503c74aecc3a8efbf25877628cb8e85efe414
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-22 18:14:38 +03:00
Axel Spoerl
b1802a164b Handle parent being a child's focus procy in QWidget::setFocusProxy
When a parent became a new child's focus proxy in an existing focus
chain, the child was appended at the end of the chain.
That leads to broken tab order, e.g. with a QComboBox which became
editable after a focus chain has been set.

This patch captures the case and insertes the new child after its
parent in the focus chain.

A corresponding test function is added in tst_QWidget.

Fixes: QTBUG-111978
Pick-to: 6.5
Change-Id: I3a426c0560fa830b7b7ffead54f26dd0adef499f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-22 14:57:46 +02:00
Inho Lee
544464c3d1 QPA:EGLFS - ignore scissor and stencil when drawing the cursor
In QEglFSCursor::draw, There are two missing pipeline states
SCISSOR and STENCIL.

Fixes: QTBUG-110080
Pick-to: 6.5 6.2
Change-Id: Ifb2495de2685b7a2f80f8d39ab57d5985fe0eec1
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-04-21 23:37:24 +00:00
Lorn Potter
589c6d066f wasm: add setting type to Blob
Blobs can be any mime type, add function that sets up mime type

This allows Safari to play videos that are Blobs

Pick-to: 6.5
Change-Id: Ide63851934058935d94f42721b246d832e3bcb85
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-04-21 06:18:32 +10:00
Ahmad Samir
79b36f3bc2 QSet: fix a qdoc warning about method signature
Pick-to: 6.5
Change-Id: I34d73e588e95603579a05bd13fc55d1eab5004f8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-04-20 20:39:23 +02:00
Volker Hilsheimer
87535e4e43 QTimer: optimize single shot timers that cross thread
Amend 4d90c4e74a by clarifying why
moving the QSingleShotObject to the receiver's thread is a good
idea. Move that logic into a separate function and use that also
for the string-based connection.

Optimize the implementation by delaying the timer creation until
after we have moved the QSingleShotTimer object to the target
thread, using a queued metacall if needed to create the timer.
This avoids the creation of the timer in the wrong thread and
then the recreation of the timer in the new thread when QObject
handles QEvent::ThreadChange.

To avoid that the timer is created when it has already expired in
real time, use a deadline timer and fire timeout immediately when
it has expired by the time we get the metacall.

Since the timerId might now not be initialized in the constructor,
initialize it to -1.

Augment the crossThreadSingleShotToFunctor test function by
deliberately not starting the thread until the deadline expired.

[ChangeLog][Core][QTimer] Single-shot timers with a string-based
connection are now started in the receiver's thread, not in the
thread that creates the timer.

Task-number: QTBUG-112162
Change-Id: I3fc94c34c21d9f644da41a2e4c2da479980b8580
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-20 20:23:37 +02:00
Tor Arne Vestbø
f2b59f3138 qmake: Don't add dummy empty.lproj localization to macOS bundles
The original change from 2008 mentions that this was needed for
preventing a crash when searching the native file dialog, but
this has since been fixed.

Nor is the file needed to get localized native file dialogs,
as this is controlled by the combination of the app's supported
localization or CFBundleAllowMixedLocalizations.

And we don't do this for CMake projects.

Pick-to: 6.5
Change-Id: I3c9e5aee4707c019f733920eb088f8d84f8e4ee1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-20 20:11:02 +02:00
Mårten Nordheim
34d82aab78 Network tests: drop testing ftp proxy server
It's quite flaky, and since we currently don't have FTP support
there's no point in making sure it works

Pick-to: 6.5 6.2
Change-Id: Ice01e8d36f2b7830813119da3513cc01ec005c46
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-04-20 16:10:03 +02:00
Axel Spoerl
d4b40fa96b QTabBar: draw text within moving tab
When a tab was moved by dragging, the tab's rectangle was drawn empty,
without the tab text. When a tab was moved by animated snap back to
its original position, the tab text was already drawn on the original
position, while the rectangle was still moving due to animation.

Adds the enum value QStyleOptionTab::TabPosition::Moving
When this option is set, QCommonStyle draws the tab text at the
current position instead of the original home position of the tab.

The QMacStyle switches over the TabPosition enum. As a moving tab
is laid out like the last tab in the given orientation, the enum value
Moving is treated like End.


Fixes: QTBUG-112277
Change-Id: I42a2d9c269dadfe9819c12dbc69e3ae995a45b09
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-20 16:02:42 +02:00
Timothée Keller
3d0fb2cea9 Windeployqt: Add a check for LLVM-MinGW runtimes
The compilerRuntimeLibs now pays attention to if the user is running
MinGW, or LLVM-MinGW, before deploying the corresponding runtimes from
the Qt binary folder, or from the path if it cannot find any in the Qt
binaries.

[ChangeLog][QtTools][Windeployqt] Windeployqt now supports LLVM-MingGW
runtimes.

Pick-to: 6.5
Change-Id: I9c464cdb933795e491992f5d1adb18bcc7d69f02
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
2023-04-20 15:59:14 +02:00
Eirik Aavitsland
daa77824b3 Refix printing of dpr>1 images on Windows
This modifies 9e453dacc3 to make sure
that QPainter uses the adjusted DPR when doing the tile copying.

Fixes: QTBUG-99990
Pick-to: 6.5 6.2
Change-Id: Id9c7b5576d5036e20bb399f3c8b82d4a467dc70f
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2023-04-20 15:54:28 +02:00
Mårten Nordheim
f19147d164 tst_qnetworkreply: Don't try using ftp servers while ftp is missing
Pick-to: 6.5 6.2
Change-Id: I979e2bbb51f7bf8ec2247a4dd8975663fc80e1cf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-04-20 15:51:42 +02:00