The old code simply called readEnvironment() from the
constructor. That function locks the QReadWriteMutex for writing, but
the constructor call is already protected against concurrent runs by
Q_GLOBAL_STATIC, so the constructor doesn't need protection.
There's even a slight chance for deadlocks because the critical
section calls qgetenv(), which itself is mutex-protected. So if we're
called from a qEnvironmentXx() function that already holds
environmentMutex... deadlock. This can still happen on LocaleChange,
but that is much rarer than application startup.
Fix by Extract Method on readEnvironment() to create a private method
that does not lock the mutex, and then have readEnvironment() and the
constructor call it.
All these qgetenv() calls hammer on the environmentMutex good, of
course, so at some point, we should either move this code into
qenviromnentvariables.cpp (like qTzSet()) or expose environmentMutex
so the code can lock it once, do all the non-q-getenv() calls and then
unlock it once at the end. Filed QTBUG-138582 to keep track of this
issue.
Amends 5b6741c39a.
Task-number: QTBUG-138582
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ibdd8cf4415d167aa8a88b71344e73871a0af9005
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
"The application" was a bit vague: as a Qt user, I write an application;
but here, the QApplication object is what was apparently meant (although
by saying that, we omit the private detail that QApplicationPrivate has
a pointer to QGestureManager which actually takes ownership).
Investigation prompts changing the comment by the instance() method:
it's declared in QGestureManager, defined in qapplication.cpp.
Task-number: QTBUG-123585
Pick-to: 6.10 6.9 6.8
Change-Id: I50900697db8798c1ab4b9c5abaa9d2102a3cbcf4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
QVarLengthFlatMap is more efficient in this hot path, since it does
not allocate and has contiguous memory.
Now that QRhiPassResourceTracker is a big struct, we use emplace_back()
instead of append(QRhiPassResourceTracker()) to avoid a copy when
creating a new tracker, and store the list as a QVector instead of QVLA.
As a drive-by, add a couple of Q_UNLIKELY to put the warning paths in
cold section.
Change-Id: Ib7df6d6ef618d138774d60a359a482cd9aeb34d9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Taking addresses of library functions is usually not a good idea. The
C++ standard makes it UB for its own symbols, and while I didn't check
whether ICU explicitly allows it, the answer would probably be that
no-one ever thought about this...
Port from passing pointers to library functions to passing an enum
{Upper, Lower}.
As a drive-by, wrap most of the functions in a namespace
QtIcuPrivate. I did this initially to keep the enum name manageable,
but it looks kinda stupid to have just the enum in the namespace and
not the function taking it as an argument now.
Task-number: QTBUG-138583
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I31b21737468bf05f52f695279dd071117420736e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
In a top-level build, when Qt repos are skipped with the -skip argument,
we read qt_cmdline.cmake and configure.cmake.
Now we're ignoring such files in skipped repositories.
This isn't a big problem at the moment, but it's relevant for a
subsequent change that will generate a vcpkg manifest from these files.
We don't want to add dependencies of skipped Qt repositories to a vcpkg
manifest.
Change-Id: Ib0558d972b24133ad746b6c8d18a09e11c3faf83
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
ICO images lack animation metadata, so QMoviePrivate::infoForFrame()
assigns a default nextFrameDelay of 1000 ms. QMoviePrivate::next()
scales this value according to playback speed (100 ms), and subtracts
the time spent processing the frame.
The test previously asserted that nextFrameDelay is exactly 100 ms,
which is only true if processing time is zero. On real hardware this
usually holds, but under QEMU (especially for VxWorks Intel), processing
may take 0–40 ms, reducing the effective delay and causing test
failures.
This commit relaxes the strict check, allowing a range of 50–100 ms to
accommodate minor variation in processing overhead.
Task-number: QTBUG-137564
Change-Id: I859612bd2c684df830c5ea8665be1a1763b4f2e0
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The two functions are always called together from the constructors,
first one and then the other. Calling copyArgValues() without calling
allocArgs() first makes no sense.
So move the allocArgs() call into copyArgValues(), and move the code
next to each other.
Amends f6211c079f.
Change-Id: Ib9c38509eb2c48dc314b95bd5300997a75f56198
Reviewed-by: Aurélien Brooke <aurelien@bahiasoft.fr>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Apart from Idle (not started) and Closed (nothing more will happen),
it is quite likely that we benefit from sending an RST_STREAM
if we are done with it in more states than just
Open (started, but no one has finished their part) or HalfClosedRemote
(the peer has finished their part).
Specifically HalfClosedLocal (we finished sending our stuff) makes a lot
of sense to send, seeing as it means we have likely sent our HEADERS
and are waiting for a response. Without marking the stream as locally
reset we would treat any incoming HEADERS as unexpected, and invalid,
closing the connection.
Fixes: QTBUG-138660
Task-number: QTBUG-138156
Pick-to: 6.10 6.9 6.8
Change-Id: I9ac6144ee85915f8f6a02e73909cdb01a73fe409
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Splash screen (or blank launch screen) is shown when exiting the
Android application caused by hiding shown windows and destroying it's
surface before application exit. On application exit all windows are
first set to invisible then surfaces destroyed and finally removed from
layout. Also window opacity change can show underlying splash screen as
it is set as theme for the application.
When pressing Android device's back button application either should
hide current window or exit the application.
When exiting current window should be visible during application exit.
Add AtomicBoolean m_canBeDestroyed to QtWindow for blocking normal
surface removal.
Set false by default from QtActivityDelegate.addTopLevelWindow and
changed from QAndroidPlatformWindow::setVisible() dependent on if
there are more visible windows present. Destroy last window with
delay so it can be shown during app exit.
Set full screen flags for current window on pre Android 11 so
it's decor view can scale to full screen on multi-window mode view
is when updated.
In QtActivityDelegate.setUpSplashScreen() set layout to use android
device's DayNight theme colors to not show splash screen theme if
window opacity is changed.
Previous reverted change caused crashed tst_qmltc_examples test.
Previous SHA e40d9d4361
Fixes: QTBUG-127705
Task-number: QTBUG-124140
Pick-to: 6.8 6.9 6.10
Change-Id: Ifda904c08c3b4363005e953e5ba9ff15a46e5195
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The function implementations were accidentally swapped, leading to
confusion and incorrect order of the CPEs.
The Qt generic CPE should be computed first, followed by the Qt
repository CPE.
That's because most vulnerability databases like the NVD use the qt
one.
Pick-to: 6.8 6.9 6.10
Change-Id: Ic67c00288318fdff3172b413eccfb413072480c8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
When building in a non-prefix build, we put synced headers into the
qtbase build dir, aka the prefix dir. In that case these source files
are neither in the source dir nor in the build dir.
Map such paths with the /install_dir marker, to make the paths
reproducible, regardless of the build dir.
Also add a DEBUG message to more easily detect such cases in the
future if needed.
Fixes: QTBUG-136163
Pick-to: 6.8 6.9 6.10
Change-Id: Id0b515d50adc8e8da384fe481641f171517b9150
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Fixed each file and added to the build system. Also updated docs.
Task-number: QTBUG-137566
Change-Id: I8e75b9b089167c427bab236c4792fd1056432be9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Made all snippets in these files compilable
Also fixed some documentation related to the snippets change.
Removed qdebug docs file since it was not used
anywhere except one file. Obviously, moved the text to that file.
Task-number: QTBUG-137566
Change-Id: I914afc96d58617a04d03d4f6e9545ec1aa2a8eb8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Created CMakeLists.txt file with all compilable snippets by now,
and added it to the build system.
Also fixed some previous files to make them build correctly.
And fixed some documentation related to the snippets change.
Task-number: QTBUG-137566
Change-Id: Ibf4321dd243bdf774c508bc1e43f9019a9074c30
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Use gradle based signing mechanism for the modern Android bundles.
From the interface perspective signing remains unchanged:
QT_ANDROID_SIGN_<AAB|APK> flags control if the package should be
signed. The credentials are taken from the QT_ANDROID_KEYSTORE_*
environment variables.
Signing is done in separate CMake script to avoid storing passwords
inside build scripts. Scripts reads passwords from the environment
when the respective signing rule is running.
Change-Id: Id1097b2b6d011a63c58e5a441c5360a1a5d97e8f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Forward the values of QT_USE_ANDROID_MODERN_BUNDLE and
QT_USE_TARGET_ANDROID_BUILD_DIR to Android CMake tests.
Drive-by make the keytool command error more verbose.
Change-Id: I8313d04ed89f545548a29463f39b5aa755f015e3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Extend the 'test_android_signing' test so it now supports checking both
AAB and APK outputs.
Change-Id: Ia0dfd09a240691f65c78658a572527cd4ab94119
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
_qt_internal_android_get_gradle_property makes the same generator
expression as the one created manually for the ROOT_PROJECT_NAME
substitution. Generalize this.
Change-Id: I4c17d5fa2ac75b057b0ed98dc1a92142cb1ea20e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
androidtestrunner expects that Android package name is stored as an
attribute in the AndroidManifest. The value is required to run android
application and grant the required permissions, so it makes sense to
add the early exit and provide the clear error message if the package
name is missing.
Change-Id: Icfeb80f79c4540dd4829add0c1b61e2d61fcec8e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Optimisation bit, read and process AndroidManifest only once.
Change-Id: Iaf66c748d98e67c9eebfabdf7357aa480929b8de
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Grant permission precisely using 'adb shell pm grant' command. This
also unifies the permission granting for aab and apk packages.
Change-Id: Iff5e45703830afed7c6fd98c940cb63626fe66f4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
It's only in the .cpp.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ia6425134773dac442932fffd51a43a1fe637b715
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
It's the same thing. Amends a0c4a71226
("Inital port of QSystemLocale on BlackBerry 10") from Qt 5.2 which
removed a bunch of older QNX classes.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Idd39bc44956bd82356b6fffdf63dbdc775bb7fa3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
For Qt Quick item views, changing role names is the same as a full
reset of the model data, invalidating all delegates and persistent
indexes.
Pick-to: 6.10
Change-Id: I04f07ed0e02f7a9e843d647f75b4d84a60c495c2
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The semikludgy trick of accessing a copy's d pointer is no longer
needed, and actually fails to utilize caching when it is enabled (seen
in qpainterpath benchmark test). Simplify by only taking a copy when
the cache is anyway not enabled.
Pick-to: 6.10
Change-Id: I713c2d37609a8d6129c1b12100d881fee59e1100
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We can move the result object into *out, so do that.
Coverity also found this.
Coverity-Id: 424945
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I4fbc3a827d104a495df71cace4ddd7a51c853bbe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Those should be rejected, but the one with an embedded NUL is not.
Task-number: QTBUG-138562
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I6a0103307fb868afba997334a37b31b637cd7473
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... as public API for QTemporaryFileEngine::renameOverwrite().
This operation (to atomically rename a temp file to the final file) is
a building block in various safe I/O patterns and QTemporaryFile
should therefore have public API for it, not just a private one.
Adding similar functionality to QFile is orthogonal to this change, and
a lot more elaborate, since its rename() already overwrites, always,
even if non-atomic.
QTemporaryFile, OTOH, already guarantees atomicity. But its rename()
never overwrites (except when it does (QTBUG-132646)). So it's the
natural place to add this functionality, and helps write platform-
independent code in the face of QTBUG-132646.
[ChangeLog][QtCore][QTemporaryFile] Added renameOverwrite().
Fixes: QTBUG-132617
Fixes: QTBUG-132646
Task-number: QTBUG-132646
Task-number: QTBUG-2082
Change-Id: I405f554335005ec8c6f1762385a19ed3fac51217
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
See bc5b7e218f for original logic.
We create a wrapper cmake file that checks the skip logic and
includes the original RunCMakeTest.cmake if the logic allows it.
We pass the wrapper script to add_RunCMake_test via an outer-scope
variable.
Pick-to: 6.8 6.9 6.10
Change-Id: Ia85e8d5d6e23250f8138156fe8ec070485f390f7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This propagation is used for including header files and linking to
the Windows App SDK library.
Pick-to: 6.10
Task-number: QTBUG-124800
Change-Id: Ib5132de3bd673a57f55dda92381315070b6ecb99
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
... ie. init().
This helps share common code between the different constructors in
order to change the way the timer is allocated in a follow-up patch.
Pick-to: 6.10 6.9 6.8
Task-number: QTBUG-131448
Change-Id: Ie31ccdcab77ac615872836ea743d3c184a59a16a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QMovie owns the QImageReader, so hold it in a unique_ptr instead of a
raw one.
Be extra careful and, at least for the cherry-picks, don't change the
point of deletion of the object.
Pick-to: 6.10 6.9 6.8
Task-number: QTBUG-131448
Change-Id: Ib2811d78e824055f30b71b36be16d9e5d0bffc72
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
tst_QWidget::synthMouseDoubleClick is flaky on Opensuse. The touchEvent
is not received when the test fails. The window's
position/framePosition taken is the un-updated one as it is offset
by the frame height.
Verify that the window's position/framePosition have been updated
before sending the touchEvent.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I32ccea55131d32f21288cfa64dbabf43deb8a8d3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
mid() got deprecated already in Qt 6.0 . Use sliced() instead.
This also fixes warnings like
qt5/qtbase/src/corelib/text/qstringview.cpp:730: (qdoc) warning: Can't link to 'mid()'
qt5/qtbase/src/corelib/text/qstringview.cpp:705: (qdoc) warning: Can't link to 'mid()'
qt5/qtbase/src/corelib/text/qstringview.cpp:718: (qdoc) warning: Can't link to 'mid()'
Pick-to: 6.5 6.8 6.9 6.10
Change-Id: I5fced4082195aacc2c3e54ab6ca4419e7aeec180
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Update the list based on QImageReader::supportedImageFormats(),
QImageWriter::supportedImageFormats() output, and sort alphabetically.
Also mention that further formats are supported if Qt Image Formats
module is available.
Pick-to: 6.10 6.9
Change-Id: I52635bcf6c98533252f051a72800af1488f6e0c5
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
From 0.5.0 (October 2014) to 0.9.0 (Octobre 2019, used in RedHat 8).
[ChangeLog] xkbcommon minimal required version now is 0.9.0.
Change-Id: I9e2afc745c33e67f995da6913f1ed9486a496f5c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Add a macro, QT_ANYSTRINGVIEW_TAG_IN_LOWER_BITS, to explain what the
QT_VERSION check is all about, and for possible reuse elsewhere.
Since it's properly namespaced, don't undef it again at the end of the
header. While I don't plan to use it outside this header, I do note that
several inline implementations exist in various other headers, so it
would probably be surprising if the define was invisible outside this
header.
Amends 8be744df8a.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I73599b84740f63e17ac58c58c661fb35e6d72435
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since 3dcd6b7ec9, the class can only
store up to three (alphabetical) characters, not four arbitrary
ones.
Fix the comment that still claimed four.
Pick-to: 6.10 6.9 6.8
Change-Id: Ibcef6fa5ddb78a347f6df1e9ea1eea5a93a02b0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of passing the Qt6_DIR variable to the RunCMake tests one by
one, we can now pass them in the wrapper qt_internal_add_RunCMake_test
function.
Pick-to: 6.8 6.9 6.10
Change-Id: I5f48e185a28a866763152e2ffeb7b8663aec7772
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This allows us to decouple some of the Qt specific setup from the
upstream files, reducing the maintenance burden when updating
the upstream CMake files.
Repos that haven't been ported to the new
qt_internal_add_RunCMake_test and include(QtRunCMake) will continue
to work using the old QtRunCMakeTestHelpers and RunCMake files.
Pick-to: 6.8 6.9 6.10
Change-Id: I4c3cfb7179b8cb34e5e55b380fd27733c582d0dd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>