Commit Graph

59884 Commits

Author SHA1 Message Date
Edward Welbourne
bd3d082679 Improve readability of calendrical calculations
Use names that give some clue to the meanings of variables and
constants. Provide some commentary to help the reader. Extract some
functions and constants shared by the Roman-based calendars into a new
namespace in qcalendarmath_p.h

Purge some unnecessary headers in the process.

Change-Id: I6fce18dc29a645f5a6e80ddfea4fd28dd6ecfe73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-31 17:35:13 +01:00
Edward Welbourne
19c913b43d Deploy QRoundingDown::qDivMod() in date-time calculations
This saves duplicate computations and incidentally now fixes some
overflow issues. In the process, simplify some calendrical
calculations.

Fixes: QTBUG-109845
Change-Id: Iee331803e8281bbf822a001722a6faa3e66f6322
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-01-31 17:35:13 +01:00
Edward Welbourne
0e653246b1 Shift the base date for the Gregorian calendar's calculations
Internally it was using the start of March 4801 BCE and then adjusting
the year by 4800; instead, use the start of March 1 BCE and save those
adjustments. This incidentally aligns better with the Milankovic
calendar's calculations.

Change-Id: Ic64b4e1d4f65bbf1973a77f830e68f05f7949f4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-31 17:35:13 +01:00
Edward Welbourne
5a91b734f2 Shuffle QGregorianCalendar's parts
Before I embark on some cleanup in the calendrical calculations, move
julianFromParts() to alongside partsFromJulian() - they're the static
methods used to bypass virtuals internally - and pull out a duplicated
comment from them to put before both.

Move julianDayToDate() to sit with its fellow virtual shim, each
calling one of the above, dateToJulianDay().

Change-Id: I581c08bae4c921c4a5cd48eebb66d46035d7d046
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-01-31 17:35:13 +01:00
Edward Welbourne
1cc4ca3e2c Avoid overflow when computing remainders from QRoundingDown::qDiv()
For a value in the partial interval just before the type's minimum,
multiplying the qDiv() result back up by the factor overflows; so take
care to adjust the values away from the bound. Introduce qDivMod() to
take care of that; in due course, we can also use it where both
quotient and remainder are wanted.

Done-With: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I541dae559f4f13ddec5b14376d3e22790b78311a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-31 17:35:13 +01:00
Mikolaj Boc
1737dfa34a Remove dead code from QWasmCompositor
Some of the fields and functions are not used now. Remove those.

Change-Id: I9313eee37374d82de2a1982a54843a70c58af426
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-01-31 17:35:13 +01:00
Edward Welbourne
24f3e0f21c Improve documentation of data-driven tests
Mention addRow() as well as newRow(), even though the example only
uses the latter. Link the best-practice section to the fuller story.

Fixed a minor grammar glitch in the manual while I was about it.

Pick-to: 6.5
Change-Id: Ib1c52cd8d2b6a04ea944d24d9d26c901b6cdf4e7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-01-31 17:35:13 +01:00
Edward Welbourne
2d73cc2b1d Rewrite the QtTest best practice guide on testing for warnings
It previously only covered ignoring them; we can now turn them into
errors. Expand the section to include some motivation for why it is
best practice to purge warnings from test output. That prepares the
scene for how to suppress what's expected and make errors of the rest.

Pick-to: 6.5
Change-Id: Ieb4b14b2b048d1db2fead004ee7471b82507722f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-01-31 17:35:13 +01:00
Edward Welbourne
2d1fd400fc Object to creating duplicate entries in a test-data table
Tero Heikkinen caught tst_QQuaternion() using a duplicated test data
tag and was surprised that testlib let it get away with that. That
seems like a reasonable thing to discourage. While I'm at it,
duplicate columns should be discouraged.

[ChangeLog][QtTest] Duplicate data tags are now warned about. Every
call to QTest::newRow() or QTest::addRow() should result in a distinct
data tag. If they do not, a warning is produced. Likewise, duplicate
column names are forbidden; each call to QTest::addColumn() should use
a distinct name.

Fixes: QTBUG-107185
Pick-to: 6.5
Change-Id: Idfdb7cdfdd71e1fe3db5cadb243eeecc83032922
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2023-01-31 17:35:12 +01:00
Allan Sandfeld Jensen
7c84550f3b Avoid unneccessarily long text scans
Limit the scans to the processed length.

Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-109838
Change-Id: If4b19bf6f97d788d0a227af3a80962bef26016fd
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-01-31 12:58:36 +01:00
Mårten Nordheim
4cd0716c39 Replace cargo-cult winrt snippet with unified header-include
Pick-to: 6.5
Change-Id: Ide9ec7e4d6c31220fa445d8acb63f7eeca60ab7c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-01-31 12:56:53 +01:00
Mitch Curtis
f2b22a2945 Doc: explicitly mention C++ when discussing linking to C++ libraries
Fixes: QTBUG-108325
Pick-to: 6.2 6.4 6.5
Change-Id: I7282c8a8df0bf8f403a4e7a9d4512e7bdf6c9979
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-01-31 09:46:49 +00:00
Friedemann Kleint
a14dcc7ad1 QtCore/Windows: Fix inconsistent linkage of helper qAppFileName()
MSVC is complaining about inconsistent linkage in CMake Unity (Jumbo)
builds since the export is not declared.

Since it is neither used nor declared in any header, remove the export.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ie6dbad0188b7fa42c0abd40c48cb50129badb38e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-31 10:46:49 +01:00
Friedemann Kleint
6c5939b167 QtGui: Remove superfluous macro qreal_to_fixed_26_6()
It appears to be unused in qpaintengine_raster.cpp and causes
clashes in CMake Unity (Jumbo) builds.

Pick-to: 6.5
Task-number: QTBUG-109394
Initial-patch-by: Amir Masoud Abdol <amir.abdol@qt.io>
Change-Id: I51585153ff99812b6539b6268e337e410f2ecc76
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-01-31 09:46:49 +00:00
Friedemann Kleint
960430556c QtGui: Disambiguate static variables in markdown code
It causes clashes in CMake Unity (Jumbo) builds.

Pick-to: 6.5
Task-number: QTBUG-109394
Initial-patch-by: Amir Masoud Abdol <amir.abdol@qt.io>
Change-Id: I7d8c7a15dd8d3b7198b5ac1924a0f2bcf4415e06
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-01-31 09:46:49 +00:00
Friedemann Kleint
e63278bb38 QtCore/QCalendarRegistry: Move helper CaseInsensitiveAnyStringViewLessThan out of anonymous namespace
It causes a warning in CMake Unity (Jumbo) builds:

src/corelib/time/qcalendar.cpp:46: warning:
QtPrivate::QCalendarRegistry has a field QtPrivate::QCalendarRegistry::byName whose type uses the anonymous namespace [-Wsubobject-linkage]

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ie9598c3e87dd835b06cafe5392766bddc258b5ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-31 10:46:49 +01:00
Mikolaj Boc
38b726830c Remove the unused QWasmWindow::m_pointerMoveCallback
Change-Id: Ife43bb8d10b0d89f8364b5e2b4dd5349a7ad1110
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-01-31 10:46:48 +01:00
Eskil Abrahamsen Blomfeldt
bfe080debb Update Harfbuzz to version 6.0.0
Note: This requires an update to the tst_qtextlayout test, because
the test assumed that the Arabic string would always yield a run
of two glyphs. This was a side effect of how Harfbuzz handled
Qt's test font, which has zero font tables and cannot be used for
shaping. With the Harfbuzz update, the Arabic text here yields a
single cluster instead, which actually makes more sense, so the
test has been made a bit more robust to support both cases.

Pick-to: 6.2 6.5
Task-number: QTBUG-110338
Change-Id: I93d4cf8e3046dc93224e144d4c81d86bef4918d1
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-31 08:20:03 +00:00
Inho Lee
da898fca02 Free the GLX framebuffer configurations
Adds missing XFree for a glXChooseFBConfig

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I4c30341f90666170dac5d90b0c65d1deff4e0818
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-01-31 09:20:03 +01:00
Antti Määttä
3bffd2e01b tracegen: Give warning if flag value is npot2
Flag values can have mask values, which have multiple bits set.
Give warning instead of panic if a flag value is not power of two.

Pick-to: 6.5
Change-Id: Ie67a5d820203219ce2eb91faf5dea8d6051a5e08
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
2023-01-31 07:33:17 +02:00
Edward Welbourne
9a756e3e01 Cross-reference newRow() and addRow() in QTest docs and improve wording
Mitch helpfully pointed out, in review of my change to the "Data
Driven Testing" doc that the two functions didn't \sa each other, so I
added that. Which naturally prompted a review of their language.
Also, split a long line in the code.

Pick-to: 6.5
Change-Id: I5f3e973052e0107bd5bdaeecaebe218e043380ff
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2023-01-31 04:46:58 +01:00
Mikolaj Boc
9d5035be9f Don't implicitly cast BATCHED_TEST_NAME to qstring
Some tests disable implicit casts from char * to qstring. Use
QStringLiteral in qtest.h to avoid compilation problems with such
tests.

Change-Id: I977b6d90e5a7a8f23298b13789302501606f63d3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-01-31 02:59:17 +01:00
Ahmad Samir
f360aa8bbf QString: move more code to append_helper
This simplifies the append overloads.

Change-Id: I76b56cb24fdd73018fdffd0ea288024a455bfc4b
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-31 03:18:20 +02:00
Ahmad Samir
9b8e3eeb59 Use QLatin1 QStringConverter methods
Change-Id: Ie28168250f3cd2a6ffe83f5ed783a1c21b754ee2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-31 03:18:20 +02:00
Ahmad Samir
04ac810ed0 QString: remove private replace_helper() member function
It was private method, only used internally; replaced by a static
helper, which allows changing its signature more freely without
worrying about BC.

We can pass it "this" by reference and the d-pointer via data_ptr().

It can be removed now without breaking BC because we can[1]:
Remove private non-virtual functions if they are not called by any
inline functions (and have never been).

[1] https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C++#The_Do.27s_and_Don.27ts

Change-Id: I7c4db42ae332af528e65ffd272f1149b92c01fba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-31 03:18:20 +02:00
Kai Köhne
d1a92a8f2d Doc: Fix spelling of QT_TARGETS_FOLDER
Pick-to: 6.5
Change-Id: Ibbbf5629893e7f6b3e4f8dbea7d42deb388c8861
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-31 00:20:32 +01:00
Volker Hilsheimer
b36f126668 QUtiMimeConverter: document as public and fix \since
It's a new public API, so don't document it as internal. Fix the \since
to 6.5 - it's an old class under a new name, and make a small language
improvement in related documentation.

Pick-to: 6.5
Change-Id: I57bfa868f19aa293c01d6a1f8bbbff1bebe7541a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-01-30 23:20:32 +00:00
Volker Hilsheimer
cb0bf5ad68 Merge "undo" and "undoframework" examples
The "undo" example didn't show anything that the "undoframework"
example doesn't, and the latter is more comprehensive and properly
documented. "undoframework" also uses QGraphicsView instead of
inventing its own diagram widget.

However, the "undo" example created a nicer UI with toolbuttons,
icons, and the undo view in a dock widget, so reuse those elements
in the "undoframework" example instead.

Update the documentation quoting tags accordingly, and clean up
a bit.

Pick-to: 6.5
Change-Id: I3c91feecbd5fe3e5900838b0b51f9fe7bd190280
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-01-31 00:20:31 +01:00
Ahmad Samir
26f8ea1224 QString: don't detach in replace(QChar, QChar, case)
If the string is shared, instead of detaching, create a new string and
copy the characters from this string, replacing the ones matching "before"
with "after", to the new string.

Change-Id: I2c33690230d40f3121e60e242666460559258b7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-30 23:52:42 +02:00
Ahmad Samir
482a75fef9 QStandardPaths/Unix: minor cleanup
- Better readability by returning early
- Make a QRegularExpression static const so that the regex pattern is
  compiled only once

Change-Id: Ic0d6bd4b068624c4ff60c6e71d09f20393adaa64
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-30 23:52:42 +02:00
Thiago Macieira
e2b303124f QVarLengthArray: implement ### Qt 7 remarks
The header qvarlengtharray.h isn't listed for the Bootstrap lib, but it
is used by several .cpp files that are in that lib (like qstring.cpp).

Change-Id: I69ecc04064514f939896fffd172f78e0f4e37391
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-30 12:26:28 -08:00
Edward Welbourne
21cb05bef7 Remove QResourceGlobalData::resourceSearchPaths
The means to add entries to this QStringList were deprecated in 5.13
and removed in Qt 6, so the list is always empty and the one place
that still references it only needs to check the empty path it adds to
the list.

Pick-to: 6.5 6.4 6.3 6.2
Change-Id: Ie1b3f13b33c04458bd03a4a1e3db0e33a76e89f6
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2023-01-30 20:26:28 +00:00
Christian Ehrlicher
021906f6c9 QToolButton: Elide text when constraints prevent from showing whole text
Follow-up of b2a282d7c7 - elide the text
also when the QToolButton has no icon (=text only)

Pick-to: 6.5 6.4 6.2 5.15
Fixes: QTBUG-64132
Change-Id: If4d3758452f37df411931a6628846988a3418d8e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-01-30 21:26:28 +01:00
Amir Masoud Abdol
95ba368806 Update qt_policy and add documentation
- If no version specified, policy version is set to 6.0.0, therefore
  warnings will be shown, encouraging users to set a policy.
- Update qt_policy() documentation
- Update qt_standard_project_setup() documentation
- Update the policy warning message
- Added the missing comment to clarify the extra_code region

Pick-to: 6.5
Task-number: QTBUG-96233
Change-Id: I8358fdeb880a34c96f13fc2a6cbef6afe048c4d6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-30 20:45:11 +01:00
Ahmad Samir
a4f18c6d0d QtMiscUtils: add isAsciiDigit helper
This logic is used in various places in qtbase, put it in one place.

Change-Id: I731b1ce0c7b38fd42a91799a0565aafa94d4e9d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-30 21:45:11 +02:00
Ilya Fedin
763884cfb7 Pass short time format to GetTimeFormat from GetLocaleInfo
TIME_NOSECONDS doesn't really switches to short time format,
just removes the seconds from long time format

Fixes: QTBUG-110627
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Ie799958f3942c657f00bc8196588258661ddc1d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-30 23:10:25 +04:00
Mikolaj Boc
0eea2238f3 Quasi-support for offscreen surface on WASM
Since context sharing is not currently supported with WebGL, offscreen
contexts have a limited usability on Qt for WASM.

If a context is shared, use the same underlaying WebGL context so that
the two can actually share resources. This is not full-blown context
sharing by any means but it makes e.g. the Open GL widget work as the
readback texture for it is 'shared' between the virtual Qt contexts.

If no sharing is desired, we use an OffscreenCanvas and actually create
a separate WebGL context.

Fixes: QTBUG-107558
Pick-to: 6.5
Change-Id: If57e44739ddb57c167d5f8881a74d8dee52531f6
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-01-30 20:10:25 +01:00
Mårten Nordheim
39daa368d4 Torrent example: Use QByteArray toPercentEncoding
The hand-rolled loop produced incorrect output and was subsequently
rejected by trackers.

The torrent example doesn't support modern features though, so it's
still a bit hit-or-miss whether a torrent will work. E.g. downloading an
Arch iso does not work since it relies on DHT, PeX and HTTP seeds.

Fixes: QTBUG-109798
Task-number: QTBUG-110622
Pick-to: 6.5
Change-Id: Ica40fb9205f09d135407a160a28a45d06a418176
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-01-30 20:10:25 +01:00
Mårten Nordheim
6c90c04fb9 Torrent example: don't try to announce to an empty URL
Task-number: QTBUG-109798
Task-number: QTBUG-110622
Pick-to: 6.5
Change-Id: I3603232eb094387388da6421bf5525a3ba54fe03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-30 20:10:25 +01:00
Timur Pocheptsov
f932be58d5 qnetworkproxy_mac: use API available both on iOS and macOS
To extract system proxies, the one we used previously, was not available
on iOS and thus we could not obtain system proxies there. Support is
limited - no such things, as SOCKS/FTP/etc. proxies, only PAC (auto
configuration), and HTTP/HTTPS. There are no keys to extract info
about HTTPS, so instead we'll use CFNetworkCopyProxiesForURL (
looks like this enables exclusion lists (which are hidden)
functionality and apparently from the system point of view HTTP/HTTPS
are the same.

Fixes: QTBUG-39869
Change-Id: I73af719a2e2b5cded706e6b3faa4b8eaa879352b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-01-30 20:10:25 +01:00
Oliver Wolff
ade96ff644 Revert "Windows: use MSG timestamps for input events"
This reverts commit baa5888807.

The change caused breakages in qtdeclarative's auto tests. Current
assumption is that we need the system timestamps for other events as
well. Reverting now to unblock CI.

Fixes: QTBUG-110596
Change-Id: I9583627bc058ff0d6cadfa622eed119fb41ca4a1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-30 16:39:19 +01:00
Ahmad Samir
817151c70d QString: use a docs snippets for fromStd*String() methods
Change-Id: Ia9c0c965725aa76c5be6353fe0d1d44674a4d4be
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-01-30 15:27:11 +02:00
Shawn Rutledge
78ba5056e6 Make tst_QFocusEvent::checkReason_ActiveWindow pass on macOS
It seems that on macOS 13.2 and newer, it requires explicit activation,
just as on the offscreen and minimal platforms.

Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-110703
Change-Id: I519eec872505ea3673111ae300c2494113f85c36
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-30 13:19:41 +00:00
Fab Stz
979a21dc4e Add support for MultiABI with custom install dir of the android-build
Right now, "multi abi builds" of android projects works only if the
android-build installation doesn't use custom install dirs
(INSTALL_PREFIX, INSTALL_BINDIR...)

At the same time, it fixes QTBUG-106533. The patches are the same as the
ones in that bugreport.

Add new items to android-*-deployment-settings.json:

    qtDataDirectory
    qtLibsDirectory
    qtLibExecsDirectory
    qtPluginsDirectory
    qtQmlDirectory

Update androiddeployqt to be able to get files from their install location

BTW (fixes QTBUG-106533):
    Install src/android/templates into INSTALL_DATADIR
    Install src/3rdparty/gradle into INSTALL_DATADIR
    Install src/android/java files into INSTALL_DATADIR
    Install all jars into INSTALL_DATADIR

Add missing path to target_qt.conf
    Update target_qt.conf to have all path. Otherwise qmake wouldn't have
    the path when installing the android-build with custom install dirs
    like INSTALL_LIBDIR & friends

Add support for a new cmake variable that can be set at build time of the
android projects: QT_ANDROID_PATH_CMAKE_DIR_${abi} (Name chosen as
brother of QT_HOST_PATH_CMAKE_DIR)

Pick-to: 6.5
Fixes: QTBUG-106533
Fixes: QTBUG-107207
Change-Id: Ia3751362ab1b5f877ecafbe02f263feac167119c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-30 14:08:14 +01:00
Kai Köhne
958dc5c1cd Doc: Use \keyword for alternative name of CMake command
\target will let the browser jump right below the title. Instead,
open the page from the start.

Pick-to: 6.5
Change-Id: Ia58664aa2696aca4f299d57b8dbaa9b6cda90f27
Reviewed-by: Pranta Ghosh Dastider <pranta.dastider@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-01-30 13:56:16 +01:00
Mikolaj Boc
d552558170 Allow filtering of test functions to run in WASM testrunner
Just proxy any non-standard arg to the WASM module and let it use
the arg as a filter

Change-Id: Ia77a30ca872497425017edb8fa8961b6d687ca68
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
2023-01-30 13:55:58 +01:00
Marc Mutz
cde904b38a Q<Typed>Permission: don't use external state
There's no point in using the full implicit sharing machinery when the
type's state consists of two enums, a bool or, indeed, if the type has
no state at all. QRect has more state and isn't implicitly shared.

To remain extensible in the future, all that is required is that the
type contains space for an eventual d-pointer and that all access to
members (except swapping, and, as a consequence, the move SFMs, but
including the copy SMFs, ctors and dtor) is confined to out-of-line
functions.

So define a ShortData (name stolen from QDateTime) nested struct in
each of the stateful Q<Typed>Permission classes, of the same size as a
pointer, holding the trivially-relocatable fields we currently have.

If, in the future, fields are added such that the reserved[] space in
any given class' ShortData no longer suffices to hold them, or said
fields are not of Q_RELOCATABLE_TYPE, then the full d-pointer pattern
(with an actually defined Private, and detach()ing) can be implemented
_for that one class_.

The new-style classes are externally indistinguishable from the
implicitly-shared old-style ones, just a lot more efficient.

Inline the move-ctor, now that we can. This doesn't break
encapsulation, even when we eventually activate the d-pointer.

As a drive-by, drop the noexcept on the dtors - dtors are implicitly
noexcept, anyway.

Pick-to: 6.5
Change-Id: Id90a39227277c6554ddd5895e8205485da1e39ca
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-01-26 17:44:19 +01:00
Kristoffer Skau
ce9d708d51 Add missing underlying type and Q_ENUM to QOpenGLWidget enums
The enums are QOpenGLWidget::UpdateBehavior and
QOpenGLWidget::TargetBuffer. The latter is a new addition to 6.5.

Pick-to: 6.5
Change-Id: I9e73413a944bf4b55e8e308055d79e560ac8668d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-01-26 17:39:10 +01:00
Vladimir Belyavsky
de704b633d Windows: fix warning on opening FileDialog after changing filters
Destroy native file dialog on Windows as soon as it closes.
Currently the instance of native file dialog on Windows may stay live
even when a FileDialog control was closed and won't be opened anymore
in the app session. At the same time, when the FileDialog is opened
again, the instance of native file dialog is recreated so we don't
need to keep previous instance, because this may lead to situation
when QQuickFileDialog configures old instance of the native dialog,
which is causing problems.

Fixes: QTBUG-61042
Fixes: QTBUG-77211
Pick-to: 6.4 6.5
Change-Id: Ia537264e8494b83dec7d5139744838242b281f1f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-01-26 15:07:47 +00:00
Jan Arve Sæther
2db23e151f Adhere to https://wiki.qt.io/Qt6/Example-Guideline
* Remove "Example" suffix in title

Pick-to: 6.5
Change-Id: I5da311850ab8f725da363969d7a8d8a1a85f8d70
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2023-01-26 16:07:47 +01:00