Commit Graph

62307 Commits

Author SHA1 Message Date
Allan Sandfeld Jensen
7c6be5e884 Make while iterations over height safer
Changing the repeating pattern to one that can survive negative numbers,
even if most places it isn't possible.

Pick-to: 6.6 6.5
Fixes: QTBUG-115003
Change-Id: I636e246b00a9dda65c147dff3e1f1d1a748d1879
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-07-05 01:25:53 +02:00
Axel Spoerl
a7deddba51 QIbaseResult: qWarning, when disallowed null parameter becomes zero
QIbaseResult turns null into zero when database field doesn't
accept a null argument.

This patch adds a warning in that case. It would be better to return
with an error, but that breaks existing behavior with code relying on
it.

Fixes: QTBUG-114683
Pick-to: 6.6 6.5
Change-Id: Ib50b7b6b4dd6c51489ba8b355f7baa8b1b14dc15
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2023-07-04 23:31:51 +02:00
Marc Mutz
3748b194d4 QEventLoopLocker: defend against nullptr arguments
The class would previosuly produce a crash when the QEventLoop* or the
QThread* were nullptr or if no QCoreApplication existed. We want,
however, the out-of-line constructors of the class to be noexcept, and
for that, they should neither allocation nor have preconditions. The
former is for another patch; this patch deals with the latter.

[ChangeLog][QtCore][QEventLoopLocker] Is now a no-op on nullptr
QEventLoop*, QThread*, QCoreApplication::instance() (was: crash).

Task-number: QTBUG-114793
Pick-to: 6.6
Change-Id: I4246f74008df6ad7fcbfde56403397b065fbe861
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-07-04 18:29:36 +00:00
Marc Mutz
d18a9dd977 QEventLoopLocker: use visit() to DRY ctors
Collapse all three Private ctors into one (void*, Type) one.

Task-number: QTBUG-114793
Pick-to: 6.6
Change-Id: Ia5c67c0ffdcddfdecb38fe3e095d60f6761f1160
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-07-04 18:29:28 +00:00
Marc Mutz
586e07785c QtNetwork: replace clashing statics with lambdas II: isSeparator
Detected with -unity-build-batch-size 103.

Here, we just replace one of the static functions with a lambda,
because the transformed function was far away from the use site while
the unchanged instances (in qhsts.cpp) had several brethren isFoo()
functions and the use was close to the definition.

Pick-to: 6.6 6.5
Task-number: QTBUG-115031
Change-Id: Ib84a64cd8b9f20cad7806659990df76552c0c5e4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-07-04 18:16:38 +02:00
Marc Mutz
5b7c8eb984 QtNetwork: replace clashing statics with lambdas I: downloadBufferDeleter
Detected with -unity-build-batch-size 103.

Pick-to: 6.6 6.5
Task-number: QTBUG-115031
Change-Id: Ia67082efbdb3f403a8c8010ec15f9f796f97feb6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-07-04 18:16:37 +02:00
Alexey Edelev
f0ae4b07eb Fix handling of QT_PATH_ANDROID_ABI_xxxx in android multi-abi tests
Fix 'IN_LISTS' typo, should be IN LISTS.

Pick-to: 6.5 6.6
Change-Id: Ia0bd1bf45922b2c9c1779e03b40dad6eab97eef1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-07-04 16:53:16 +02:00
Alexey Edelev
97268742e4 Install the missing deprecated header files
Deprecated Qt header files generated by syncqt were missing in
installation package of Qt, after migration to cpp based syncqt.
Restore them.

Note: we didn't receive bugs since 6.5 release so far. I would check
the existing files and remove them completely in 6.7. See QTBUG-115029.

Pick-to: 6.5 6.6
Fixes: QTBUG-112956
Change-Id: I2e5375ee0dbd87a76135594cd489bb67f6d3456d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-07-04 16:53:16 +02:00
Marc Mutz
8c2c4f178a QEventLoopLocker: add a visit() member
Still suffers from a bit of an impedance mismatch, because it's the
first step in making QEventLoopLocker shed its Private, but will be
used in a subsequent commit to DRY more code.

Task-number: QTBUG-114793
Pick-to: 6.6
Change-Id: Ia14effb6255961edae68eaf941fece9dca0cb844
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-07-04 16:53:15 +02:00
Marc Mutz
c70257e9b2 QEventLoopLockerPrivate: store the tag in the pointer variable
There's enough space in the LSB of the three pointers to encode the
type.

Saves sizeof(void*) in the Private class, but, more importantly, paves
the way for the next patch to get rid of the Private class and its
memory allocation altogether, turning QEventLoopLocker::d_ptr into
what this patch still calls QEventLoopLockerPrivate::p.

Neither QTaggedPointer nor QML's QBiPointer apply here. QTaggedPointer
only supports a single T, plus flags; QBiPointer supports only two Ts,
and one flag; we need three Ts and no flags. This could be a

    QVariantPointer<QEventLoopPrivate, QCoreApplicationPriivate*, QThreadPrivate*>

I'm thinking about it; just would want to find a second use-case for it.

Task-number: QTBUG-114793
Pick-to: 6.6
Change-Id: I0e21bd8745cc75a9c04b71343c398ad953283857
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-07-04 14:53:15 +00:00
Marc Mutz
97adda8675 QEventLoopLocker: unexport
Non-polymorphic classes should not be exported wholesale. Luckily, in
this case, all SMFs are either out-of-line or (implicitly or
explicitly) deleted, so we don't need to wait for Qt 7 to do the
change.

This is a prerequisite of adding move semantics to the class, as well
as some other optimizations that require non-exported functions.

As a drive-by, collapse ctor declarations into single lines, because a
follow-up patch will need to touch the original lines, anyway, to add
noexcept, so there's no point in keeping separate lines to optimize
the API review diffs.

Task-number: QTBUG-114793
Pick-to: 6.6
Change-Id: Iccfcc11d37aa9274e48345a1e01e0f827e465644
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-04 14:53:15 +00:00
Marc Mutz
093a0b4f6e Unity-build: exclude qrandom.cpp (#undef's Q_ASSERT/_X())
qrandom.cpp #undef's Q_ASSERT/_X(), breaking TUs that happen to use it
after qrandom.cpp has processed.

Exclude it.

Pick-to: 6.6 6.5
Fixes: QTBUG-115031
Change-Id: Ie419f4ed2323f9c9e91f4dceaf8fecc097673d0e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-07-04 14:53:15 +00:00
Marc Mutz
b8dd99a1b2 Unity-build: exclude qdebug.cpp (#undef's qDebug())
Like qlogging.cpp, qdebug.cpp also #undef's qDebug, breaking TUs that
happen to use it after qdebug.cpp has processed.

Exclude it.

In CMakeLists.txt, also mention qlogging.cpp undef's qInfo() and
qDebug(), too.

Pick-to: 6.6 6.5
Task-number: QTBUG-115031
Change-Id: I4c910f051f1578f27cac8e5e6b358e7ee2eeb97e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-07-04 14:53:15 +00:00
Fabian Kosmale
d49c19b216 QtVFS: Attempt to fix compilation error on Yocto
The yocto compiler finds no matching function for some reason.

Change-Id: I9fb7c00aeb3bd00b24bcf7513f68f6c8cffc5cbd
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2023-07-04 16:53:15 +02:00
Morten Sørvig
7620c7b26e wasm: add preload config for shared libraries build
Preload Qt plugins and QML imports by default. The json
files contain file listings generated by scripts in
qtbase/util/wasm/preload.

Pick-to: 6.6
Task-number: QTBUG-63925
Change-Id: I123b7a46fa19fa75ef214e8edb92e15ef635e5ba
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-07-04 15:42:02 +02:00
Morten Sørvig
64007c7497 wasm: add "preload" qtloader config property
Add support for downloading files from the web server
to the in-memory file system at application load time.

See included documentation for usage.

This preload functionality is different from Emscripten's
--preload-file and --embed-file in that the files are
not packed to a single data file or embedded in the
JavaScript runtime. Instead, the files are downloaded
individually from the web server, which means that they
can be cached individually, and also updated individually
without rebuilding the application.

Any file type can be preloaded. The primary use case
(at the moment) is preloading Qt plugins and QML imports.

Pick-to: 6.6
Task-number: QTBUG-63925
Change-Id: I2b71b0d6a2c12ecd3ec58e319c679cd3f6b16631
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-07-04 13:42:01 +00:00
Morten Sørvig
d659c93068 wasm: add "qtdir" qtloader config property
This points to the location where qtloader should find
the Qt installation when loading Qt shared libraries
and plugins.

The path is relative to the path of the html file which
contains the application, and is set to "qt" by default.

Deployment of the Qt installation to the web server is
left to the app developer, since this depends on the
exact use case. One possible way to deploy is to create
a "qt" symlink to the Qt installation, for instance:

  html/myapp/myapp.html
  html/myapp/myapp.wasm
  html/myapp/qt -> /path/to/qt

Pick-to: 6.6
Task-number: QTBUG-63925
Change-Id: I76b129dffc75c06ff6bc67d8c20ce12557b32f31
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-07-04 15:42:01 +02:00
Morten Sørvig
3f8f79ddaf wasm: introduce virtual processPostedEvents()
Don't re-use processEvents() for the case where we
get a callback from the native event loop and want
to send events. This makes it clearer that these are
two different cases.

Align with the Core Foundation event dispatcher where
processPostedEvents() is virtual and is overridden
by the Gui event dispatcher to send window system events.

Pick-to: 6.6
Change-Id: I3ea9c55c1d9c03195c1937c4dcc0e5b689e15448
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-07-04 15:42:01 +02:00
Eirik Aavitsland
8aa0d71d06 Update bundled libpng to version 1.6.40
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.40

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Id10d61fc4c3b8cccdcca9042097d4dc470aa0067
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-07-04 15:42:01 +02:00
Inho Lee
1652687d34 QXkbCommon::isLatin1 : Add a lower bound of Latin1
The range of the Latin1 key is from 0x20 to 0xff
in both xkb_keysym and Qt::Key.

Task-number: QTBUG-113387
Task-number: QTBUG-74479
Pick-to: 6.6 6.5 6.2
Change-Id: I2eaba3129bead9526910f716c211f637804ab592
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-07-04 13:42:01 +00:00
Mårten Nordheim
af9c02234b QMetaType[docs]: fix 'constructor' typo
Pick-to: 6.6 6.5
Change-Id: I7dedf635b9a5e85f6af49bf0a5e0348dde32e80d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2023-07-04 15:17:34 +02:00
Volker Hilsheimer
b3608700f9 Android: Downgrade OpenSSL configure error to warning
Amend 9d5a8162a5, after which building Qt
for Android locally required an OPENSSL_ROOT_DIR variable to be set.
Instead of making it harder for everyone to build Qt for Android (even
if no intention to work on or test network code locally), downgrade the
fatal error to a warning.

Pick-to: 6.6 6.5
Change-Id: I6f2176a40663cc9f55aa3066af78499af1f20894
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-07-04 10:46:23 +02:00
Amir Masoud Abdol
86e0c111fd CMake: Avoid creating empty directories when installing Find*.cmake
Surprisingly, CMake copy/install empty directories when `file` or
`install` are used with `FILES_MATCHING PATTERN` argument.
In order to avoid this, we can exclude the empty directories using a
PATTERN EXCLUDE argument.

Pick-to: 6.5 6.6
Change-Id: I17a22f9b9e317bc4a66cee3df39815659ddb4c04
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-07-04 07:34:14 +02:00
Ahmad Samir
520b4d3ca6 CMake: make tst_qlogging depend on qlogging_helper
So that building tst_qlogging also builds qlogging_helper. Helps with
local testing where you only build and run tst_qlogging instead of the
whole repo.

Change-Id: Ib36ff3e55e04794534d6cb7a23f243aae61d0005
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-04 00:07:08 +03:00
Alexey Edelev
afc8260359 Remove redundant qt_no_master_include from deprecated headers
qt_no_master_include is not used  in the deprecated headers since
are generated by syncqt, are never scanned and master include logic
is controlled by syncqt.

Pick-to: 6.5 6.6
Change-Id: If6f737938abe67349c8f88387ccb5efdb95afabd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-07-03 23:01:58 +02:00
Marc Mutz
bd40a67aab QCoreApplication: mark instance() as noexcept
QEventLoopLocker's own noexcept depends on this.

Task-number: QTBUG-114793
Pick-to: 6.6
Change-Id: If1ba3aaa2f0bbb6334d52dd44db84d138890f4bb
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-03 23:01:57 +02:00
Marc Mutz
f71f0312d6 QEvent: add strategic [[maybe_unused]] to Q_IMPL_EVENT_COMMON
Apparently, in unity-builds Q_ASSERT does not always compile its
argument, so I'm getting -Werror,-Wunused-variable on Clang 15.

Fix by adding [[maybe_unused]].

Amends da0f72ebb8.

Pick-to: 6.6 6.5
Change-Id: I2de810aded1226ce4e5651de8c2e9464de3f274f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-03 19:21:17 +02:00
Amir Masoud Abdol
c90cc8c900 Unity Build: Resolve a variable redefinition error
The `qvk_sampleCounts` variable is defined in `qrhivulkan.cpp` as well.
This causes an issue when building with unity build. To resolve the
problem, I renamed the variable in `qvulkanwindow.cpp`.

Fixes: QTBUG-114918
Pick-to: 6.5 6.6
Change-Id: I0b38c6b3e30792dd6f770d4dea8cb4c7789961d1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-07-03 17:16:26 +00:00
Morten Sørvig
be7b748b7e wasm: add shared library preload scripts
Add scripts which generates Qt plugins and QML imports
preload lists, for use with the "preload" functionality
form qtloader.js.

The preload lists downlad plugins and imports from $QTDIR/
to /qt/ at application load time, where $QTDIR is configurable
using the qt.qtdir qtloader configuration property (set
to "qt" by default).

Sample directory structure:
  app.html
  app.js
  qtloader.js
  qt_plugins.json     [generated]
  qt_qml_imports.json [generated]
  qt -> /path/to/qt   [symlink]

The json files are generated by the scripts in this commit.
app.html configures qtloader.js to use the json files
as preload lists, which instructs it to preload from
"qt", which again is a symlink to or a copy of the Qt
installation.

Pick-to: 6.6
Task-number: QTBUG-63925
Change-Id: I53bd197f22057dbb70e9a9bee43b9d9b969aa072
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-07-03 19:02:48 +02:00
Mikolaj Boc
73c0c798a0 Remove leftover code in QWasmWindowClientArea
Switch cases for EventType::PointerEnter and EventType::PointerLeave
are never reached.

Change-Id: I02f31c2d7064db740f21b014c9e0f4735a7a1a91
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2023-07-03 18:25:13 +02:00
Ievgenii Meshcheriakov
77a4ff4036 Fix invalid closing XML tag
Pick-to: 6.6 6.5 6.2
Change-Id: I1785fe855f69d7dc7d043b235ed4f3b99a6057fc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-07-03 12:29:54 +00:00
Volker Hilsheimer
79abdd3cd4 QPixmapCache: ignore insertion or searches with empty key
When a key for a pixmap cannot be generated, then the only meaningful
way to indicate that failure is to return an empty string. Instead of
plastering checks for the generated key being empty all over our styling
code, reject attempts to insert a pixmap with an empty key string in the
QPixmapCache, and fail to find immediately. Such a key makes no sense
either way.

[ChangeLog][Gui][QPixmapCache] Trying to insert or find a pixmap with
an empty key string now always fails immediately.

Pick-to: 6.6
Task-number: QTBUG-114473
Change-Id: I15bf8064ac7a4fe715722d98f2df2b8608809c7f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-07-03 10:39:46 +02:00
Morten Sørvig
9c9aca3b43 wasm: don't use on qGlobalPostedEventsCount()
There is no guarantee that it will return 0 after one call
to sendPostedEvents(), since more events may have been
posted during that call. This can in turn cause infinite
looping since the wait() isn't called.

Move sendPostedEvents to the top of processEvents()
to make sure we send events before waiting, in line
with the implementation for the other event dispatchers.

Pick-to: 6.5 6.6
Fixes: QTBUG-112893
Change-Id: Iba7d87cf1c08cd302884782cb135d758afeb9e4b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-07-03 05:56:58 +00:00
BogDan Vatra
e84dc809e2 Say hello to QtVFS for SQLite3
This patch allows to open databases using QFile. This way it
can open databases from RW locations as android shared storage
or even from RO resources e.g. qrc or android assets.

[ChangeLog][QtSql][SQLite3 driver] QtVFS for SQLite3 allows to open
databases using QFile. This way it can open databases from RW
locations such as android shared storage, or even from read-only
resources e.g. qrc or android assets.

Fixes: QTBUG-107120
Change-Id: I889ad44de966c96105fe1954ee4eda175dd5a886
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2023-07-02 17:12:02 +00:00
Jøger Hansegård
a8792feaaa Fix crash in QVariant::convert and QVariant::view
`QVariant::convert` may lead to crash or produce garbage data when
attempting to convert a gadget between a pointer type and a value type,
for example from a variant holding a QLocale gadget to a QLocale*
pointer and vice versa. Similarly, `QVariant::view` may crash under the
same conditions.

The reason is that conversion is implemented through copy construction
assuming that both source and target types are either both pointers or
both values. If converting from pointer to value type, the result is
crash during destruction of the QVariant. If converting from value to
pointer type, the result is a QVariant holding a pointer to garbage
data (and possibly crash if pointer is dereferenced).

Similarly, if attempting to convert a pointer to a QObject derived type
to its value type, the system crashes, with a slightly different failure
mode. During `QVariant::convert`, a temporary `QVariant` of the target
type is created. Since objects that can not be copy constructed are
invalid for `QVariant`, the temporary is left empty without constructing
the target value. Then, when attempting to convert from a pointer type
to a value type, the temporary's destructor is incorrectly called on the
owned object. Since the owned object is never constructed, this leads to
a crash.

The proposed fix is to return false from `QMetaType::view`,
`QMetaType::canView`, `QMetaType::convert`, and `QMetaType::canConvert`
if the target type is of different 'pointedness' than the source type.

After this fix, converting and viewing gadgets and QObjects behaves the
same way as primitive types and core types, which already returned false
when converting between value type and pointer type.

Fixes: QTBUG-114797
Pick-to: 6.5 6.6
Change-Id: If5ad764a60f2f3c912070198073b28999d995f17
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-07-02 16:01:15 +02:00
Liang Qi
8b98c0a4c2 tests: blacklist tst_QAbstractItemView::selectionAutoScrolling() on Wayland
because it's flaky in current CI setup.

Task-number: QTBUG-109776
Pick-to: 6.6 6.5
Change-Id: I3e432e632622f47b8125344187daf238a03a7372
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-07-02 11:37:28 +02:00
Liang Qi
81ae227614 tests: blacklist tst_QMenu::pushButtonPopulateOnAboutToShow() on Wayland
Task-number: QTBUG-114997
Pick-to: 6.6
Change-Id: Ic6f0e9e3ec550b9d08cb70102bbe553328b29273
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-07-02 08:01:10 +02:00
Mårten Nordheim
e1b2af4d02 invokeMethod: replace a local RAII struct with qScopeGuard
Change-Id: I3991c6f212cf78ef5cbdf562168817ae87d5c703
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-01 23:36:57 +02:00
Safiyyah Moosa
efc6b9946b Docs: Add link to OPenGL examples to OpenGL index
Task-number: QTBUG-112824
Pick-to: 6.5 6.6
Change-Id: Ib507e8c32518442fd211f3486c4317b4907ea414
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-06-30 18:46:55 +02:00
Kai Köhne
9c43bb6134 Network: Remove unneeded Q_QDOC check for http feature
http is enabled by default if you have threading support, which is true for qdoc. There is therefore no reason to believe that a normal
qdoc configuration won't have it configured, and hence no need to
check also explicitly for Q_QDOC.

Pick-to: 6.6
Change-Id: I118388fedaa87225ce81a211d361d593da61105d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-06-30 16:46:54 +00:00
Kai Köhne
3040eadd83 Doc: Fix license of foreignwindows example
Example source code should be LicenseRef-Qt-Commercial OR BSD-3-Clause

Pick-to: 6.5 6.6
Change-Id: Ia9cf6f4783fde0e25f72a31bbe6d809118fd4240
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-06-30 18:46:54 +02:00
Volker Hilsheimer
cf5da33367 Silence compiler warning about unreachable code
The warning has been reported by users, but never observed in CI, even
though the only path that can lead to the last return statement becoming
unreachable is very common in Qt: if a QDebug stream operator exists,
then we always return early.

Nevertheless, rewrite the code to have a single return statement.

Task-number: QTBUG-112371
Fixes: QTBUG-114944
Pick-to: 6.6 6.5
Change-Id: Iaf9ec683ceceedb00771fb0743a09dcc8f50ba3f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
2023-06-30 17:41:20 +02:00
Tor Arne Vestbø
bc64864120 macOS: Respect QDir::Hidden for native file dialogs
The default for showsHiddenFiles is NO, so we were not showing hidden
files unless the user toggled them via the keyboard shortcut.

Pick-to: 6.5 6.6
Change-Id: I796144452cf8f5a6cc46f1ba6747affcd0a35879
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-30 12:05:18 +00:00
Tor Arne Vestbø
90345459fc macOS: Avoid triggering TCC permission dialogs in file dialogs
In our NSOpenSavePanelDelegate we respond to panel:shouldEnableURL: by
checking the file dialog's filter options. As part of this, we pulled
out the file's attributes using [NSFileManager attributesOfItemAtPath:],
but this API triggers the TCC (Transparency, Consent, and Control)
machinery to ask the user for permission to access the path in question.

We could replace the directory check with fileExistsAtPath:isDirectory:,
but this would still leave the checks for writable/readable/executable.

Luckily for us, the plumbing for QFileInfo uses lower level CoreFoundation
APIs that don't have these issues (except for isBundle, which we should
fix separately).

This also means we can remove the custom isHiddenFileAtURL helper, as
it was based on the same kCFURLIsHiddenKey as the QFileInfo plumbing.

Fixes: QTBUG-114919
Pick-to: 6.5 6.6
Change-Id: I9ebefaeb1ef7bcc5bb9a1c5cd4b993ce230cf506
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-30 14:05:16 +02:00
Tor Arne Vestbø
8fbce6b4a0 macOS: Enable dirs in file dialogs, also when treating bundles as dirs
In our NSOpenSavePanelDelegate we respond to panel:shouldEnableURL:
with YES if it's a directory or symlink to a directory, which matches
the native behavior.

But the panel has a special flag to treat bundles as directories instead
of files. We were checking this flag, but ignoring the case where it
was actually set (which it normally is not), and as a result would
go on to filter directory names as well.

We now handle both cases, and only call [NSWorkspace isFilePackageAtPath:]
if needed (when the treatsFilePackagesAsDirectories flag is not set).

Pick-to: 6.5 6.6 6.2
Change-Id: I2b9a16ff99b4b643389acc042c032813f432ac59
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-30 14:05:13 +02:00
Joerg Bornemann
d766caa429 Remove syncqt.pl
This script has been superseded by a C++ implementation.

Change-Id: I2a9b55dbf7fabbb422040f601d9ba1035d88bba4
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-06-30 13:23:46 +02:00
Amanda Hamblin-Trué
15a7e108aa Contiguous cache example: minor cleanup
Modernised contiguous cache example.

Change-Id: I88d67b03ed95a61484873149da16f0d814b26cd8
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-30 12:55:01 +02:00
Amir Masoud Abdol
f1db0ca251 Look for MoltenVK headers if there are installed separately using Brew
Homebrew offers a formula for `vulkan-headers`, which does not include
the MoltenVK headers. MoltenVK does include the vulkan headers, but if
someone passes the vulkan-headers path to CMAKE_PREFIX_PATH, then our
module cannot pick up the MoltenVK headers. Brew's MoltenVK
installation is a bit odd as well, as in, one needs to point the
CMAKE_PREFIX_PATH to `HOMEBREW_PREFIX/molten-vk/libexec/` instead of
the directory head.

Pick-to: 6.6
Change-Id: I933faeb16b3f54597e3a0af0af584d79b3c0a344
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-30 10:55:01 +00:00
Friedemann Kleint
bdc8dc5138 Fix typo in QXmlStreamReader error message
Amends 6326bec46a.

Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-109781
Task-number: QTBUG-114829
Change-Id: Ib5189dc908cd61c6c6fa23024776a4a5baa75ca5
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2023-06-30 11:55:13 +02:00
Tor Arne Vestbø
72a153a7f5 Move simple widget mapper example to manual test
Pick-to: 6.5 6.6
Change-Id: I703843b5ee935794c2e2fd0407f9a1508b088ab6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-30 08:51:06 +02:00