Emitting a signal executes an unknowable amount of code. We shouldn't
hold a mutex while doing so. E.g., if the signal emission causes
another call to QGuiApplication::setFont(), the old code would
deadlock, since applicationFontMutex is not recursive.
Fix by taking a copy of the application font under mutex protection,
then dropping the lock for the emission of the signal.
Change-Id: Ib2569b3a08af6ef5f38459a19f74cb0db27b7772
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This should help when things are moving fast, and downloads and
network object are destroyed before the callbacks finishes.
Change-Id: I1f65965bd61efc2e641d03eb071f23e684dd5c44
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This allow halfway transparent windows, even with a border, which is
a bit of a weird use-case, but matches what we do on other platforms.
We don't need the explicit call to NSDrawWindowBackground in the
QNSWindowBackingStore implementation, as the NSThemeFrame will draw
this background on our behalf.
Fixes: QTBUG-77637
Change-Id: I012d845fa957c40aa713adaecbb1601a848e3534
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Using WASM_OBJECT_FILES does not allow memory growth, so we need to just
explicitly check for QMAKE_WASM_TOTAL_MEMORY
Change-Id: I447113972dfc3df4ee4073e8cc25481646d1507b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Given that this is an exception, it doesn't invalidate the general
thread-safety of static meta objects, and putting a locking mechanism
into Qt for this would be complete over- (and performance-)kill.
Task-number: QTBUG-70915
Change-Id: I4a538b977f5c2e8173cb236023e5d9ca34add5b5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Because it allocates memory, it may call system functions that set errno
or Win32's GetLastError().
[ChangeLog][QtCore] Fixed a bug that made qErrnoWarning() say there was
no error when generating the error message.
Fixes: QTBUG-77322
Change-Id: Ife213d861bb14c1787e1fffd15b811a4f83cf3e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The source code is still only using the old negative define check.
Change-Id: I7e2775d6d4664cb5b802b0a40fb3f1711c8f6915
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It can happen that AppKit calls -mouseDown: on a popup's view, but
we consider the click to be outside of popup's area (happens on the
1-pixel edge of a 'geometry', QRect::contains() returns false).
If we send close event to essentially 'self', m_platformWindow
is becoming nullptr. So we bail out early, no further processing
is needed.
Fixes: QTBUG-77348
Change-Id: I224943e6bcf4ae052412ef7dc7b23a94f999aa19
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Makes the code a little cleaner, avoiding an issue caused
by UB and/or optimization bug in msvc2019.
Fixes: QTBUG-77119
Fixes: QTBUG-77230
Change-Id: I9bc8f427a90e6fe32b3c26301bbb703a3c4ad846
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
The paths to the libraries and prl files should have the "_debug"
suffix for the debug configuration. This prefix is added to the TARGET
when by qt_module.prf when doing a debug build, but not during a
debug_and_release build.
Make sure to strip the _debug suffix if it's there, and re-add it later
always, to be consistent in both debug_and_release builds and in
debug builds.
Amends a12b6e7bf6.
Task-number: QTBUG-38913
Task-number: QTBUG-75520
Task-number: QTBUG-77092
Change-Id: I29e88f2b991e2be06b23652d64edc768fa35a5ae
(cherry picked from qt/78d67d17a6c108a419816b8bd47f78864ddbb07f)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
While there is likely no example of it in Qt itself, applications can
use QOpenGLShaderProgram instances on different threads. These instances
have nothing to do with each other but they do share a global cache object.
This becomes problematic without proper synchronization.
Change-Id: I80faf73f34af7e67349eee916bb3f216e22c07fd
Fixes: QTBUG-77469
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Observed infrequently in the QDBus tests, it would deadlock when
destroying QDBusServer at the same time as qDBusNewConnection was being
executed as they were locking the same locks, but in opposite order.
QDBusServer locks d->lock, then QDBusConnectionManager::instance()->mutex.
While qDBusNewConnection locks QDBusConnectionManager::instance()->mutex,
then serverConnection->lock (and serverConnection here
is QDBusServer's d-pointer).
QOrderedMutexLocker cannot be used in this situation because it
operates on QMutex*, which d->lock (QReadWriteLock) is not.
Change the code to lock QDBusConnectionManager's mutex before d->lock
and then unlock the QMutexLocker where it would previously destruct.
If QDBusConnectionManager has already been destroyed then we pass a
nullptr to the QMutexLocker which is fine and will not do anything.
Fixes: QTBUG-74635
Change-Id: I7f02d7759da67377996ef042c81b0969ccb8aadb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
As is said in RFC7301 in section 3.1 [1]:
Protocols are named by IANA-registered, opaque, non-empty byte strings
[...]. Empty strings MUST NOT be included and byte strings MUST NOT be
truncated.
[1]: https://tools.ietf.org/html/rfc7301#section-3.1
Change-Id: I38168ac570a433807e16121d5dec46d4ac73c4bf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
As is said in RFC7301 in section 3.1 [1]:
Protocols are named by IANA-registered, opaque, non-empty byte strings
[...]. Empty strings MUST NOT be included and byte strings MUST NOT be
truncated.
[1]: https://tools.ietf.org/html/rfc7301#section-3.1
Change-Id: I2c41fa99984a53cc58803e5a264d06edac964cc6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Qt for QNX is, by default, built without the clipboard feature.
Change-Id: Ie8a36ceb0c0f0a695ae7d0fcf6f0bd70d2a43e0c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Rafael Roquetto <rafael@roquetto.com>
Follow up to 091a386eaf
Defaulting to querying from the egl config is fine, but dropping support
for the "format" key in the output list in the json config file is not
ideal.
Task-number: QTBUG-76748
Change-Id: I25dc99369d118c300cdef25b464426f6be85453b
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Add support for astc format files as an experimental feature.
To enable, configure with "-feature-texture_format_astc_experimental"
(Backported from commit 5a4db421bd94acd12a4ac1f77031996b95f85dbf)
Change-Id: I9a2f7b1fa20ba344b79637bafb50ff2bd0596747
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Turns out that kern.uuid is not as unique as we thought. Googling for
mine finds other instances of the same being used.
Fixes: QTBUG-75371
Change-Id: I95ecabe2f50e450c991afffd159850cc975ec0da
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
...with a failing test case for QTBUG-77299.
Task-number: QTBUG-77299
Change-Id: I42c4fc4bb96f8660f8ff9bea97e6096ca6cec972
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
With things like sample count reducing a format (16 -> 8 -> 4 -> ...)
and trying again is perfectly fine. There is no need to show warnings
in this case. Even some of our own examples in qtdeclarative do a
setSamples(16) which is rarely supported. These all show warnings since
8ec98fc2dc. Avoid this.
Change-Id: Ice83d5720b02e92f77cfd63918c98ad222513b6a
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Avoid unreasonable threshold values for extremely wide pens, since
that can lead to a very high processing cost.
The rare usecases where this would make a noticeable difference will
necessarily also be using scaling, and so is anyway depending on
setting a suitable curve threshold manually.
Fixes: QTBUG-77241
Change-Id: I27cea7d566d144389bb430739fde4f6033c4a28c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Some servers seem to be unable to properly calculate our window size
from a delta we send via WINDOW_UPDATE frame immediately after our
client preface and the SETTINGS frame. The remote replies with a
GOAWAY frame blaming flow control error. Guessing what's this
magic number they use seems to be not feasible, we now use a
half of what we had before.
Fixes: QTBUG-77308
Change-Id: I41dacfd25a395a27003f330d01b6d8d60b8f407c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QTreeView allowed to set the sort column to -1 which shows the data in
it's natural order (when the model supports it). This functionality was
removed during the porting away from the deprecated sortByColumn(int)
functionality done in d0f909f8db
Readd the functionality and also allow it for QTableView.
Fixes: QTBUG-77419
Change-Id: I96b0c09ab9da36ca0a9de58fe0f37e2c56b1d51b
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: David Faure <david.faure@kdab.com>
It doesn't work since it relies on cups to do the heavy lifting and cups
is not used when printing to PDF
Task-number: QTBUG-77351
Change-Id: I1bdda58b50112b9bb3d7991f3cfd860d6b4f4fc4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
QTRY_IMPL() exercises QTRY_LOOP_IMPL() twice, once directly, the
second time via QTRY_TIMEOUT_DEBUG_IMPL(); and QTRY_LOOP_IMPL()
deliberately doesn't bound its scope (e.g. with the canonical
do{...}while(0) trick) so that the latter can access its local
variable. Unfortunately, this means the local's declaration in the
second use of QTRY_LOOP_IMPL() shadows the first. So enclose the first
in braces to bound the scope.
Fixes: QTBUG-77297
Change-Id: I849bfe0b8abfb517ed3e783abf86c602163db137
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This is necessary in order to use the properties of QCompleter that use
these enums.
Change-Id: I9f7edfc1137f200810b6bc98d27709695f37de5d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>