this went unnoticed, because the only cross-module 'use' so far is that
of egl, for which the code path provided for modular builds happens to
(mostly) work due to the specs already providing the library definition.
amends cc842ca4.
Change-Id: I58c638d896eabd26f27d5cd90e3a7f8eeece9bc0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
we derive the keys from the last fragment of the parent directory, which
is potentially not globally unique.
Change-Id: I57cf13394984e6e3d902c0f1bb495bd3920bfc75
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
if a library uses another library which happens to be absent, then the
former must also fail.
amends cc842ca4.
Change-Id: I91f157a6d1ed40b66e196340a282ebe493fcf40e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
the outdated ones remain for backwards compatibility; some remain
unchanged.
Task-number: QTBUG-30083
Change-Id: Ia596b854d26b00fcb4f48df0da7ad893650ac1c8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
currently mostly for debugging purposes (especially with -verbose).
Change-Id: I8af32c61df0b19861aa79bc4bbdd3f6095dbe9b7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
also actually deletes qfeatures.txt, which was already claimed by
a668c6a6, but not actually done.
Task-number: QTBUG-58411
Change-Id: I686760632fee7c10b01bd2e83f2481b01bc2b774
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
don't attempt to hand-craft a library export any more. instead, use the
configure system's built-in mechanism, and refer to it via QMAKE_USE.
this also allows us to rely on transitive dependencies in the autotest.
as a side effect, this makes the openssl-linked feature imply the
openssl one.
Change-Id: I5dd209b63bc8fbbc62852f6ffc472d4452ea2e68
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
a header-only library in a default location would produce no variables
at all, making it appear undefined. fix this by forcing the writeout of
the QMAKE_LIBS_* variable, and use its definedness (rather than
non-emptiness) as a signifier.
this works for both QMAKE_USE and configure tests'/libraries' 'use'
entries.
Change-Id: Id7a1e23725caba1a91ea4db448b4aeb7fe632393
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
if multiple library entries provide the same export (as openssl is going
to), it makes sense to make them recognize the same input variables, as
it would be rather counterproductive to require different configure
arguments for each.
Change-Id: Ia32842e95294296d50220297f85689bc92de2d05
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
pass the library name instead of a library source object.
improves overall legibility at a marginal runtime cost.
Change-Id: I248ee9622af2b2c37daa2dbc0cc0bca5701d7925
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The this pointer cannot be null, so we can't do d->staticFunction while
d is a null pointer. This was caught by Clang 3.8's ubsan.
Change-Id: I3c0d39b88cca83d827a69ed1544a4412b18ac907
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
icc defaults to -O2, so this was causing debug code to be built like
that, making debugging very hard. This change also hardcodes -O2 for
release builds, just in case.
Change-Id: Ibc5c715fda334a75bd2efffd14a478ce539a3a3f
Reviewed-by: Robert Pancoast <RobertPancoast77@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
They are the default with icc.
Change-Id: Ibc5c715fda334a75bd2efffd14a478c20b527d7c
Reviewed-by: Robert Pancoast <RobertPancoast77@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The problem was caused by commit 0feeb6f6d2
which fixed QTBUG-58036. It reparented widget that used to be skiped.
In particular, floating widgets are skiped. But seting the parent of a
floating widget docks it. And so as a result it would not be skiped anymore.
This has two side effect: This breaks the animation (as the widget is
docked too early; and cause crash when QDockWidgetGroupWindow get
reparented as this breaks invariant that these are always floating.
So restore the skip from before commit 0feeb6f6d2,
and explicitly set the parent in all cases when the animation finishes.
Change-Id: I0e3e29ad22d6ffe4d62242d48a18dadb916fc14f
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Some format and parse tests for time and date-time depended on locale
but had test data for the C locale (so fail if the test-environment
has, e.g., LANG=de_DE@utf8). So impose the C locale (until Qt 6).
The date-time test did *some* attempts at fixing for locale, but
failed to handle am/pm; and we do have "### Qt 6" comments in
Q(Date|Time)+::fromString indicating that we intend to switch these
methods to use the C locale by default (which shall fix this once and
for all). So rip out the incomplete localization now and test we work
properly at least when the locale used *is* C. Add a comment to the
matching QDate test to rip out its (presently adequate) matching code
once we do get to Qt 6 and make fromString() use the C locale.
QDateTimeParser uses systemLocale(), which is initialized the first
time it gets accessed; so we need to frob the locale *early*; doing so
in the test-class constructor is about as early as we conveniently
can; and seems to work (while doing it in individual tests does not).
(There is no point rolling back at the end; the QSystemLocale global
has been set up by then, so the roll-back would merely leave the
global out of sync with setlocale() and the environment.)
Task-number: QTBUG-58728
Change-Id: Ifa6778a80276050a099387a6dab15a1096be7561
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The 'rules' vector is made up of all the individual {env,config,...}Rules
vectors under mutex protection whenever init() is called (only from the
QCoreApplication ctor) or, at any time, by a call to QLoggingCategory::
setFilterRules().
Yet, the writes to the individual *Rules vectors were never protected by
registryMutex, racing against the reads of the same vectors in the
updateRules() function.
Fix by protecting all access of all member variables with registryMutex.
Add some strategic comments to make analysis easier for the next guy.
Change-Id: If68d15a553ec7038693574a34f10a39f4cd480e8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
In this case we can safely return the same QSize which we accept since
it is already contains the right size for the given menu and this size
will be bounded to screen geometry before QMenu will be displayed
anyway. We also get rid of one dependency on HITheme.
Change-Id: I7502a96d180fc4a41ce3dfabe8a200b886016348
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
AİİA.pdf takes 8 QChars, but after lowercasing it takes 10, so the code cannot
assume the length to be the same.
Task-number: QTBUG-58822
Change-Id: Id6fbb99f6afd08ee420099cd66372732d7598d9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
An Acquire barrier in QReadWriteLocker::unlock was missing to synchronize
with the testAndSetOrdered on d_ptr in the lock functions.
The race is between the write of d->writerCount in tryLockForWrite,
and the read in unlock. The acquire on d->mutex is not enough because
it is not on the same object. While that race could be fixed by taking
the newly-allocate()ed d's mutex before publishing it with testAndSet,
there's another race, on 'recursive', between a newly-minted Private*
with recursive == false in tryLockForWrite(), and the read of 'recursive'
in unlock().
Task-number: QTBUG-58917
Change-Id: I10ba36573c0e57468d11e9b77d85045711feaea1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
see 5a1b4832a2 for more detail
Task-number: QTBUG-58142
Change-Id: I51851ea9b4fe7b8eeadc452bc3dbb1ea00026d29
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The _next variable need the acquire and release fence in next()
to synchronize with the equivalent operations in release() (which
already have the them)
The ordering on the _v[block] is not enough as this does not
synchronize the same object.
Task-number: QTBUG-58917
Change-Id: I17cc39e6791433348b6227363dbea92bcf03700d
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Like the lvalue QVector::append() overload, when we reallocate,
we need to take a copy of the function's argument because the
reference will get stale upon reallocation.
Add a test.
[ChangeLog][QtCore][QVarLengthArray] Fixed a bug involving
appending an item already in the container to the container
again.
Change-Id: I06eeed6cb383dd5924e47a302bb3d1666d04c8e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In QCocoaDrag::dragPixmap, it treats QDrag::source as a QWindow, but it
is not - it's just a generic QObject* of some kind (which QQuickDrag
sets to the originating QQuickItem, and the widgets stack sets to a
QWidget). This failure means that dpr stayed at 1.0.
Unfortunately it’s not possible to receive a pointer on QWindow directly
from QQuickItem because QtWidgets and QtQuick do not share the sources,
but we can use the same dpr as current focused window has because drag
can only start from active window - press on a window which is not
focused should activate it first.
Task-number: QTBUG-57942
Change-Id: Id358c181d03d519188caaa83fb4226033b8ed1ea
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Automount filesystems like /home on many operating systems (QNX and
OpenIndiana, at least) don't like if you try to mkdir in them, even if
the file path already exists. OpenIndiana even gives you an ENOSYS
error.
So instead, let's try to mkdir our target, if we fail because of ENOENT,
we try to create the parent, then try again.
Task-number: QTBUG-58390
Change-Id: Ibe5b1b60c6ea47e19612fffd149cce81589b0acd
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: David Faure <david.faure@kdab.com>
QNetworkSession's ctor has a race condition: it 1) connects signals/slots
and also 2) registers meta-types (but after these connects). Our users apparently
have a lot of per-thread QNAMs in multiple threads (and implicitly
many QNetworkSessions on different threads too). From error logs it appears
that while one thread tries to connect signals/slots and evaluates the types
of signal and slot arguments, another thread can register this type.
If the first thread extracted signal argument types, then the second
registered this type, we can end up in a 'type mismatch' error on the first
thread with seemingly the same types in a debug message (something like
"type mismatch A::Some <-> A::Some") - they have the same name, but one
has type() == 0 and another - some non-zero type().
Now we call qRegisterMetaType before connect.
Task-number: QTBUG-50901
Change-Id: Idbb9515573e174bbc5e5bf55dc3a7911a81646ea
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The library feature already covers this. As library depends on the
dlopen compile check, we can assume dlopen to be available, also on
vxworks.
Change-Id: Idcdb07ab4688c6158651d9a5ad5e2ba126bd7d9e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
It is never written after initialization, and accessed concurrently
outside mutex protection, so make sure that it never changes by
marking it as const.
Change-Id: Ib28b2e8b3067d596a95d1699165a6ebfb15fe674
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Adding 0 each time will obviously not produce a new identifier each
time...
Also use static initialization for QBasicAtomicInt.
A default-constructed static QBasicAtomicInt at function scope
will be dynamically initialized. It will still be zero-initialized,
but at least GCC adds guard variables for such objects.
When using aggregate initialization, the guard disappears.
Amends 265db5ad9b.
Change-Id: Ia71290cf26c486dcbcc74381f12cd0c4712d6019
Reviewed-by: David Faure <david.faure@kdab.com>
Use of XInput 2 may result in regressions. For example we call
XISelectEvents for each window every time a device plugs/unplugs.
It causes significant delays when there are many native windows.
Change-Id: I60b799bb667d0e4bca1f9c52cdaa07b04bcc749f
Task-number: QTBUG-57013
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
QDeadlineTimer will eventually support CLOCK_MONOTONIC_COARSE on Linux,
so let's be safe before that change appears.
Change-Id: I9b423f1b71194205b27afffd14a383a7e9f66a9d
Reviewed-by: Stéphane Fabry, Cutesoft <stephane.fabry@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
It was unnecessary, since we only cached the static types, which are all
generated by the macro anyway. The way it was implemented, this produced
data races that are strictly-speaking UB, even if all the threads were
writing the same values to the same data locations.
This commit changes a little the code to simplify, since we're changing
those lines anyway.
Task-number: QTBUG-58851
Change-Id: Idc5061f7145940f987dffffd14a30047846e3113
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Update the flightinfo example to use the new QRegularExpression class
in place of the deprecated QRegExp.
Change-Id: I2395b37170565e922500e675210c400e90ae0f73
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Update the legacy grabber example to use the new QRegularExpression
class in place of the deprecated QRegExp.
Change-Id: I1d1871b7e82cdb214fdd8ad55a606d5e7682fab1
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Update the arthur code sample to use the new QRegularExpression class
in place of the deprecated QRegExp.
Change-Id: Ic7efd4466b4c0fa50170b80ebb22fcb3624399ce
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Update the codecs example to use the new QRegularExpression class in
place of the deprecated QRegExp.
Change-Id: Ibd60b7256071f8166c4bf38e6a40935494c3cf3f
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Update the settingseditor example to use the new QRegularExpression
class in place of the deprecated QRegExp.
Change-Id: I07e34bf916bdde161c4253fca70b853061cd589b
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Update the stylesheet example to use the new QRegularExpression class
in place of the deprecated QRegExp.
Change-Id: I7061b8fd462ff012cb67bfdade656b3bfe442dd8
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
tst_QDateTime::operator_insert_extract() was setting the time-zone and
taking care to restore it at the end of the test; however, if the test
were to fail, the restore would be skipped. Package the zone-setting
and restore in a class instance, so that premature return can't bypass
the restore.
Change-Id: I3df63260da17e481ef4d0d107d9f0fdea3e147e7
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
When the QFileDialog receives a language change event, and native
dialogs are used, this code path dereference a nullptr in the qFileDialogUi member.
Protect by checking the return value of QFileDialogPrivate::usingWidgets() as
done in other places deferencing qFileDialogUi.
Fixes a crash in GammaRay
Change-Id: I3e9eb81c75d9fc983519a58c5ec06e316ac80263
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
We keep the runnables from finishing by having them block
on a QSemaphore::acquire() call inside run().
If we fail a test that precedes the call to sem.release()
further into the test, the early return will cause the
thread pool to be destroyed, which will then attempt to
wait for the runnables to finished, which, in turn wait
for the semaphore to be released.
-> dead lock
Fix by introducing a RAII object to release the semaphore
with a sufficiently large number to unblock all runnables.
That number will in some situations be too large, but that
does not matter.
Change-Id: I1ec7e29b37bc36309e93e6e30708cc7db3c9579c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In order to get reproducible runs of the test, we need to
wait in the main thread until all runnables have started
executing. Otherwise, what the cancel() loop below actually
does will vary from run to run.
Change-Id: Ib912b0943e7bbd55c9480ae6fd4011ba20ac457e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of allocating a statically-sized array on the heap,
use an automatic C array instead.
Replace some magic numbers with named constants.
Change-Id: I17d29a76a67c4a413453ac26a5dee8cd54a8a37d
Reviewed-by: David Faure <david.faure@kdab.com>