RunLoopModeTracker as one of Qt Cocoa classes was not wrapped
in namespace which limited its use in Objective-C single symbol space.
Change-Id: Ida2c62c6f543a3bf5107f28c78d27435bcb3470d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This is still not a great place for it, but this way we can
Q_REQUIRE_CONFIG(library) in qlibrary_p.h and qfactoryloader_p.h is the
only private header that doesn't require library support in plugin.pri.
Change-Id: Ia6c1ac8799822eca1e0cbeca98d1c1b8de74beae
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Make it iterate the addresses available looking for an IPv4 address,
when that's what it needs, instead of just assuming the first entry in
the list (when non-empty) is IPv4.
Based on a suggestion by Dmitry Pankratov.
Task-number: QTBUG-27641
Change-Id: I1920f68ade44a996ea5c2ed691a87ff3e686f35a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We define QT_STATICPLUGIN for the plugins in this case, so that they
define the factory functions needed to link them directly into the
test.
Change-Id: I0f2de7bf6bec5a6d53ec9ad92536817c1221b7d5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Pass classname 'exefile' to ShellExecuteEx() for UAC prompt.
This allows running executable files that do not have a .exe extension.
Task-number: QTBUG-59008
Change-Id: I88d669481e893db50edccd7b30259e5366477556
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
now that it works nicely, make use of it for the zlib deps, which are
not transitive when the detected library is built statically.
Change-Id: Iaed87a37b36f714f0b919244cd84809650102ba9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
these statements are assumed to provide dependencies for the currently
detected library. this implies that their resolved content must be
passed to the linker after the to be detected static library.
Change-Id: Ifaaee2ac71bf176e8a0033765fb979fe119deaba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
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>