Create Qt:: versionless targets for libraries and tools. So
Qt::Core will link to Qt5::Core.
Add additional feature properties to targets, with the same name
they have in Qt6: QT_ENABLED_PUBLIC_FEATURES,
QT_DISABLED_PUBLIC_FEATURES, QT_ENABLED_PRIVATE_FEATURES,
QT_DISABLED_PRIVATE_FEATURES, to be forward-compatible with Qt6.
Prefix properties with INTERFACE_ for interface libraries.
Create functions with no major version in their prefix, so qt_foo
instead of qt5_foo.
The non-versioned functions will call the versioned functions,
depending on the value of QT_DEFAULT_MAJOR_VERSION, which can be
set by an application developer before finding the Qt package.
Set QT_DEFAULT_MAJOR_VERSION to 5 if the value has not been defined
in the current scope.
Application developers can set QT_NO_CREATE_VERSIONLESS_FUNCTIONS to
TRUE before calling find_package(Qt5) to suppress creation of the
non-versioned functions.
Application developers can set QT_NO_CREATE_VERSIONLESS_TARGETS to
TRUE before calling find_package(Qt5) to suppress creation of the
non-versioned targets.
Setting these can be useful when both find_package(Qt5) and
find_package(Qt6) are in the same project.
If none of these are set by the user, then the first find_package(Qt5)
will create versionless targets with the major version being "5",
which means the second find_package(Qt6) will not create versionless
targets.
Handle versionless plugin names in qt_import_plugins, so both
Qt::QCocoaIntegrationPlugin and Qt5/6::QCocoaIntegrationPlugin
are recognized by the function.
Allow specifying multiple types in EXCLUDE_BY_TYPE in
qt_import_plugins, to be consitent with the Qt 6 version.
Make sure to set the QT_PLUGIN_CLASS_NAME property to compatible with
Qt 6.
Task-number: QTBUG-74137
Task-number: QTBUG-80477
Change-Id: Ib89d090ea6f7794d7debd64f03f29da963a17ca7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
I made a clazy automated check that replaced the use of QVariant::Type
by the equivalent in QMetaType.
This has been deprecated since Qt 5.0, but many uses were not yet removed.
In addition, there was some manual changes to fix the compilation errors.
Adapted the Private API of QDateTimeParser and QMimeDataPrivate
and adjust QDateTimeEdit and QSpinBox.
QVariant(QVariant::Invalid) in qstylesheet made no sense.
But note that in QVariant::save, we actually wanted to use the non-user type.
In the SQL module, many changes were actually reverted because the API
still expects QVarient::Type.
Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QDBusReply has an user-specified operator= but no copy constructor.
Change-Id: If7fcec3193af375f1bf2dd913d82548d6e035b48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Conflicts:
src/corelib/tools/qvector.h
Make QVector(DataPointer dd) public to be able to properly merge
5b4b437b30 from 5.15 into dev.
src/widgets/kernel/qapplication.cpp
tests/auto/tools/moc/allmocs_baseline_in.json
Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Change-Id: I929ba7c036d570382d0454c2c75f6f0d96ddbc01
Other code using these maps are not treating them like multi-maps
Change-Id: I3381fde3b3612a29110cfe890f20f96f3c0bd3a2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
By casting it, these are situations where we cannot change the type
itself to QMultiMap. For QVariant it's a public define and for dbus
it's the type of an argument to the function.
Change-Id: I0f385dc857fce5de3e8254d18268fd84a6d7707c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
[ChangeLog][QtCore][QHash] insertMulti(), unite() and
values(const Key &key) are now deprecated. Please use
QMultiHash instead.
Change-Id: Ic14907fd5fd38d585708e2dcf2c0200d221ebb25
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Don't store our string data as QByteArrayLiterals anymore, but revert
back to simply storing them as an array of char* and offsets into that
array.
This is required to be able to inline size and begin into QByteArray
itself. Once that change is done, we can then avoid creating copies of
the string data again.
Change-Id: I362a54581caefdb1b3da4a7ab922d37e2e63dc02
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Move away from using 0 as pointer literal.
Done using clang-tidy. This is not complete as
run-clang-tidy can't handle all of qtbase in one go.
Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
CMake is case-insensitive for macro and function names. Still, it is
"strongly recommended to stay with the case chosen in the function
definition." So let's make the function and macro definition lower-case,
like we also recommend in the documentation.
Change-Id: I1f64b18716f034cb696d2e19a2b380aaadd6cd07
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QtDBus caches well known interface objects when there is a non-emtpy
interface name passed to the QDBusInterface constructor.
This commit amends the constructor documentation to explain this
behavior.
Change-Id: Ic51836be6d833411500ea05fcc895cd4f6e96407
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This was used to support QFlags f = 0 initialization, but with 0 used
as a pointer literal now considered bad form, it had been changed many
places to QFlags f = nullptr, which is meaningless and confusing.
Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is almost 100% source compatible with Qt 5. Exceptions are
* Stability of references for large or non movable types
* taking a PMF for types that are now overloaded with r-value references
in QVector
* The missing prepend optimization in QVector (that is still planned
to come for Qt 6)
Change-Id: I96d44553304dd623def9c70d6fea8fa2fb0373b0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This is currently being used by dbus und our state machine framework,
and supported by hand editing moc generated code.
Get rid of that hack, and instead add support to moc to forward
the raw arguments array to the slot.
Change-Id: I0e36626f91eb01041464e6d931dc1d4660de91d2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
To get less diffs for next merges and pro2cmake changes.
Change-Id: I7fb5ff34bb884072a9964e8e3488c69f4290fca2
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
People implementing D-Bus services *should not* immediately call
QDBusConnection::send() when intending to delay their reply, as this
indeed causes a reply to be sent to the client.
Change-Id: I50817f6b91ac1a02a2a25f6d31e73ad9832f1092
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Brown paper bag for me, don't use a comma to separate parameters when
calling a function.
Change-Id: I21e16142fab4fd1c2714df13cd6a892b036e899a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This fixes the calls to add_qt_docs to include the target.
Change-Id: I2c4c807bca8faa48bb49f4b8710035f21abfca0e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Update all public Qt macros to use qt6/QT6 instead of qt5/QT6.
Change-Id: Ib178f4fa21f37dfb8da7d4d8c097aa0e96c9d9f9
Reviewed-by: Alexandru Croitor <alexandru.croitor@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>
Except in the auto-generated files.
Required to add a cast operator from QDBusObjectPath to QVariant, as the
variadic call() uses QVariant(arg) instead of QVariant::fromValue(arg).
[ChangeLog][QtDBus][QDBusObjectPath] Added explicit cast operator to QVariant.
Change-Id: I3f3004f7b9300a6340d27488f5b97981cbab3c24
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This allows to query all names that can be activated on the bus.
Change-Id: I8f894bf858eb18b67a074ca666ad3200ed99c373
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This changes many different CMake places to mention Qt6 instead of
Qt5.
Note that some old qt5 cmake config files in corelib are probably not
needed anymore, but I still renamed and kept them for now.
Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4
There were some changes done in pro2cmake, so regenerate the main
qtbase modules to keep everything up to date.
Some new whitespace got added.
Some special cases were removed (ZLIB).
Some opengl code got moved around.
Some plugin types were added.
And some other minor things.
Change-Id: Ie8cba4a9aa6b4b163c39d6cf546ea9e0bfc05c01
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Saves more than 4KiB in text size (~0.7%) on optimized GCC 9.1
Linux AMD64 builds.
Change-Id: I5b29eae620370abd91e3a7f98e660c32470aed1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
... and use a variant of the QString::multiArg() trick to pass the
variable number of arguments into an out-of-line function.
The idea of this patch is to make the lowly asyncCall() and call()
functions the principal interface for DBus calls again.
Currently, it is more efficient to build up a QList<QVariant> and pass
that to the *WithArgumentList() methods. With more efficient, I mean
that the equivalent calls with QList expand to less client code,
probably because of the need to construct eight QVariant instances,
destroy them again, and then take the hit for a function call with so
many arguments, which can all but be efficient.
Consequently, when porting the NM bearer plugin to use call() instead
of callWithArgumentList(), text size increased by ~3KiB on my machine.
So, looking for a way to avoid the overhead of so many default
arguments, while at the same time allowing to pass even more arguments
than the predefined eight, I considered the QString::arg() method, but
discarded it because it does not scale to arbitrarily
(ie. SEP-limited) many arguments.
Variadic templates scale to SEP-limited many arguments, but they are
templates and deduce the exact type, so constraining the template to
only QVariants would have broken all users of the API which pass
non-QVariants and expect an implicit con- version to resolve the call.
So I decided to make a virtue of necessity, accept all argument types
and convert them to QVariant when constructing the
QString::multiArg()-inspired QVariant array.
To bring this patch to its consequential end would require to pass the
arguments as arrays instead of QLists, but to get a feeling of how
much impact this new API has, I backed the new implementation by
converting the array to a QList and calling the *WithArgumentList()
methods.
The result is, if I may say so, satisfying. Said bearer plugin drops
from +3KiB (baseline: callWithArgumentList()) to -5KiB (2.0% and 3.2%,
resp.); the (unmodified) connman bearer plugin, which already used
call(), dropped by almost 6KiB (2.5%).
While GCC can deal with the zero-sized array in a nullary call to the
variadic templates, MSVC cannot, so an extra overload provides an
alternative for zero arguments.
[ChangeLog][QtDBus][QDBusAbstractInterface] The call() and asyncCall()
methods now accept more than eight QVariant arguments.
Change-Id: Ic85faca40949f9bb8c08756be3bfe945c9cdd952
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Generate module .pri files
* Generate qconfig.pri
* Propagate MODULE_CONFIG from the .pro files
This enables the basic use-case of simple application builds that for
example use the moc. Omitted from the patch is support for private
module configurations, prl files (should we do this?) and possibly more
hidden gems that need to be implemented to for example support building
Qt modules with qmake.
Task-number: QTBUG-75666
Change-Id: Icbf0d9ccea4cd683e4c38340b9a2320bf7951d0d
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Semi-automated, just needed ~20 manual fixes:
$ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} +
$ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} +
It can be easily improved (e.g. for store check that there are no commas
after the opening parens). The most common offender is QLibrary::load,
and some code using std::atomic directly.
Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
dbus1_linked is only evaluated to true when the dbus package is found.
If it was not found, then it makes no sense to link against the
_nolink target, because no package was found in the first place.
When the package is not found, QtDBus uses a minimal dbus header which
is included with QtDBus sources, so there is no need for the _nolink
target.
This amends cc141cc5c6 and fixes a build
failure on macOS.
Change-Id: I71dcbb7465ad13b0bf03579f51412c373125caba
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Instead of generating .html page for each file in an example
project, generate links to code.qt.io, under the correct
path and branch, where the user can browse the example source.
Store all URLs under QT_INSTALL_DOCS/config where other qt5
submodules can access them. The repository name appears in
the URL, so we cannot define a single URL for all modules.
Task-number: QTBUG-74391
Change-Id: I63d4d6d2c352877797b1ee8e057d48c0cd789bff
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Each module that has publically declared classes or structs
that are not meant to be documented is given a dontdocument.qdoc
file to tell qdoc that these classes are not meant to be
documentented. Then qdoc will not print warnings about missing
\class comments for these classes and structs.
Change-Id: I9195f0b546032e1c7642c9da34d85a0a4a9bfb08
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
And use it to clean up the reimplementations in Qt DBus.
Change-Id: I8e3fe35e8db6405cbcbfb45b42a8f2efecc1cef0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Anything that uses Qt::Dbus also needs to link to Qt::Core, so encode
that in the target.
Change-Id: Ibc984d5b5e118aae8d1c0d21117fcff1664b0ae3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This code has been there since the initial public commit, but has no
effect.
Change-Id: Iae80ae22a363b3bd0e6cf7706619b38edc47790f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove remaining handling of missing support for rvalue refs.
Change-Id: I78bab8bccfeeb9c76f464f345874364a37e4840a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The attirubtion previously only sayd 1.12, so verified up to date at
1.12.12; and tweaked the header slightly to make it easier to verify
(content is now in the same order as in the dbus sources). Updated
the list of years in which Red Hat claims copyright on various parts.
Fixes: QTBUG-72622
Change-Id: Idcec9edbf42860bca61d838e75889a55eb0859d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Enables the use of e.g. QT_NO_DEBUG in compiler flags, -fPIC, passing on of
QT_NAMESPACE, etc. pp.
Dropping a lot of custom code which handled adding imported targets for
the command-line tools (this is all being handled by CMake already).
It needs to be investigated if we need to resurrect
Qt5GuiConfigExtras.cmake.in in one way or the other.
Change-Id: I4fa141b68fddaad4f33e628c59d5d0b3a7b3a096
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This allows a user to efficiently watch for services with a common
domain prefix.
This is exposed in the API via a wildcard character in the service name.
For example creating a watcher on "org.mpris*" will match
"org.mpris.foo" "org.mpris.bar" and "org.mpris" itself. It will not
match org.mprisasdf.
Internally the argument match rules have been expanded from a single
QStringList to a struct containing args and arg0namespace. This was done
so that we can easily use argpath in match rules in the future.
Change-Id: I55882ab603cc6ba478e8c0ea9a6800f6e483a50c
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
This update eliminates ALL parsing errors when clang parses the
Qt headers to build the precompiled header qdoc needs. These errors
are often cases where an old use of Q_QDOC no longer works because
clang sees the enclosed fake declarations as erroneous.
In a few cases, clang reported errors because two dummy function
declartations under the Q_CLANG_QDOC guard were indistinguishable,
so one of them was removed, and the documentation was patched
accordingly.
Using the macro Q_DECLARE_INTERFACE(...) causes clang to report errors
because the class parametewr is abstract. These uses of the macro are
not needed, so they are removed with #ifndef Q_CLANG_QDOC.
Some declarations of default GL types that had been provided for qdoc
were no longer needed, so they are removed.
Now there are some member function signatures in QDBusPendingReply
and QDBusPendingCall that have very long template clauses and qualifiers
in their signatures. These unwieldy signatures will be unnecessary in the
documentation and will look bad there, but for now they are correct. The
ultimate solution will be to add a metacommand to qdoc, something like
\simplify-signature to tell qdoc to generate the documentation for these
member functions without the long template caluses and qualifiers.
Change-Id: I012cf17a544fbba2ebc71002f31bdc865119bb8e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
This allows others to link to QtDBus and the other libraries/tools using
doxygen.
Fixes: QTBUG-60933
Change-Id: I026895a432a328f224c40cf231ad12d109dc648f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
There's been one minor change in a struct and some minor re-ordering
of other things within their files (reflected here to simplify future
checks); and qt_attribution.json didn't document enough details to
ensure reliable review.
Task-number: QTBUG-70011
Change-Id: Iccff9cfd899e58cb42837c4628acacd7877c5b01
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This doesn't add any value and just complicates things.
Change-Id: I3a011174e330f212eda99371d2806517ceec45d7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Add it to configure.json and replace all occurrences of QT_NO_THREAD
with QT_CONFIG(thread). Add conditions for other features that depend
on thread support. Remove conditions where we can use the QMutex and
QThreadStorage stubs.
Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Adds an enumName to QMetaEnum to carry the name of the enum since for
flags that doesn't match the name of the Qt type, but is needed if the
flag is scoped.
Change-Id: I1c0f77eb9e40e6fd1eb6a59bea77caf0f33fcf43
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Without QT_CONFIG(library) qdbus_resolve_conditionally would be declared
but not defined.
Change-Id: Id90f6c736080e4c1609568b3fab1f464c0e46aa3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This flag was introduced to serve as a replacement for a dedicated "interactive" boolean
argument in method calls guarded by Polkit.
Change-Id: Ida91c9872e70f8ca6672563d0ca6642f38c498ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Adding references where applicable, as removed by
023a818738 when removing stale example.
Add example run snippet to the example landing page.
Remove stale example qdoc file that is superceded by current example.
Task-number: QTBUG-69191
Change-Id: I62dc66edc86da5efb4c79fd124edb2fa619aeb6b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
In bootstrapped mode QDBusMessage isn't available, so looking up the type
via QMetaType wont work. QDBusMetaTypeId has this special-cased, but that
alone isn't enough for qdbuscpp2xml to produce the same result as in non-
bootstrapped mode.
The effect of this has also been described here before in detail:
http://lists.qt-project.org/pipermail/development/2017-February/028756.html
Change-Id: Id309a3a910f971c6150cdc6d06f2b48f1b95c787
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][Third-Party Code] Libdbus-1 code in Qt D-Bus is now properly
documented. The code is licensed under AFL-2.1 OR GPL-2.0-or-later.
Change-Id: I38bd6f38175562fff03ae84fc7a5c435de4cb972
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Follow the example of the other modules and explicitly mention
the valid licenses on each module landing page, optionally
combining it with trademark information.
Change-Id: I9f1fea0f002e0ab607da89a0cbfe7c53060582d7
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
After including windows.h, interface is a define that expands to
"struct" (unless WIN32_LEAN_AND_MEAN is defined). This name is
used as a normal identifier in multiple places within Qt.
This has already been worked around in a number of places
(in e.g. 3ba61d9baa and
786d23bb49).
After qrandom.h was included in <QtCore/QtCore>, this header
implicitly includes <random>. In libc++ on windows, this header
then transitively includes windows.h, exposing the clash with
the name "interface" in even more locations than before.
For cases within qtbase internals, it could also alternatively be
handled by defining WIN32_LEAN_AND_MEAN while building QtDbus, but
for occurrences in public headers, the undef trick needs to be
used.
Change-Id: I89754f38f55ae7f2145255a2c8a71b23492be6a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Added many template clauses to \fn commands. Also added or
modified some uses of Q_CLANG_QDOC in some dbus include files
to work around some seriousl ugly template clauses that could
not be added to \fn commands. Also modified a few parameter
names in the documentation.
The first attempt at making this change caused syncqt to fail
to create QtDBus/QDBusPendingReply. This second attempt works.
Change-Id: I96c1fb9bcb1d9debf9409f6baf8c42e18fb9e75d
Reviewed-by: Martin Smith <martin.smith@qt.io>
Changed some uses of Q_QDOC to Q_CLANG_QDOC;
eliminated some uses of Q_QDOC; correct some
function signatures used for qdoc; added docs
for swap() functions.
Change-Id: I0d3c62d462bd3b10fd35d411bdfb93d952e6423d
Reviewed-by: Martin Smith <martin.smith@qt.io>
Update the list of highlighted examples for modules in qtbase, based on
which examples have been updated to use C++11 features, the new
signal/slot connection syntax, and documentation improvements.
Not all the modules have highlighted examples yet as some of the
work is still ongoing.
Task-number: QTBUG-60641
Change-Id: If28d59c10ca1a30e5db408970f20159434ac94f8
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
In c2049f67e4, all DBus I/O was
moved into a service thread. The dispatch lock used to protect
DBus I/O in the threading setup before that commit. It is not
needed anymore.
No discernible difference in QtDBus benchmarks, roughly 500
bytes code size reduction on AMD64. The main point is to reduce
confusion from unnecessary code.
Change-Id: Idcbdd2b7e2b317cf6da0b5bfc5ec70afed1f1b48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Unique begins with a "y" sound, hence a unique is correct.
Change-Id: I9eb6b4d4c9ddab45af931e97c041c24edf163eca
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
In order to reduce surprises when using DBus, also register QVector
where QList is pre-registered.
Change-Id: I7fdc0a52b11cdc4ebb8338f9a8ba00c8a46c3ed5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remaining uses of Q_NULLPTR are in:
src/corelib/global/qcompilerdetection.h
(definition and documentation of Q_NULLPTR)
tests/manual/qcursor/qcursorhighdpi/main.cpp
(a test executable compilable both under Qt4 and Qt5)
Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Remaining uses of Q_DECL_OVERRIDE are in:
src/corelib/global/qcompilerdetection.h
src/corelib/global/qglobal.cpp
doc/global/qt-cpp-defines.qdocconf
(definition and documentation of Q_DECL_OVERRIDE)
tests/manual/qcursor/qcursorhighdpi/main.cpp
(a test executable compilable both under Qt4 and Qt5)
Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Conflicts:
src/widgets/kernel/qwidget.cpp
This merge also extends the expected output of the pairdiagnostics
teamcity output (added in dev in commit
c608ffc56a) after the recent addition of
the flowId attribute to the teamcity output (commit
8f03656211 in 5.9).
Change-Id: I3868166e5efc45538544fffd14d8aba438f9173c
The current code fetches currentOwner in the constructor, then sets up
a connection between a service watcher and _q_serviceOwnerChanged() in
initOwnerTracking(). But an owner change notification could arrive
after we fetch the current owner and before the connection is made.
In this case the owner change notification will be lost, and the
interface will keep reporting being invalid permanently.
The fix is to delay initializing currentOwner until after the connection
is made.
Task-number: QTBUG-62284
Change-Id: I92b9d61004e14fd2ee2543488740a542dc7a9b7a
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
CMake gained support for running AUTOMOC on generated headers,
so we need to mark them with SKIP_AUTOMOC since we're generating
moc files for those already. Otherwise we get duplicated symbols.
Change-Id: Iabd387832cfc74809fc5e6ff4782f4fc83cc07d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Stephen Kelly <steveire@gmail.com>
This reverts commit daeb334039.
The commit was causing race conditions, and random failures in CI.
Task-number: QTBUG-60792
Change-Id: I6e49b733965632a1a268f0e88809794098465ec0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It's possible that some code executes after QDBusConnectionManager is
destroyed and still tries to access QtDBus. Protect against such
crashes.
Change-Id: I87e17314d8b24ae983b1fffd1453c13fbd3cf48e
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This allows us to get rid of two Q_GLOBAL_STATIC in QtDBus, which means
fewer opportunities for screwing up the order of destruction. And since
QDBusConnectionManager now ensures that the types are initialized, we
don't need to re-initialize them everywhere.
The Q_GLOBAL_STATIC for QDBusConnectionManager ensures the proper
thread-safe locking, so we don't need to lock for every type that we're
trying to register. This should make things faster.
But as a side-effect, trying to register a D-Bus metatype will cause the
QDBusConnectionManager thread to start too.
Change-Id: Ifea6e497f11a461db432ffff1449a4e535234485
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This has been there probably forever, likely from the time when the code
was derived from upstream CMake. Since this is just copying one variable
to another and the latter has a wrong name (_qt4_*) just drop it.
Change-Id: Ica74f3bc9a6b0a6669d80cfc0ebafc003f5b908e
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
For the windows file system engine, we add an extra macro to use
library loading if configured to do so, but avoid it on WinRT, as
none of the symbols would be found.
We also QT_REQUIRE_CONFIG(library) in the library headers and
exclude the sources from the build if library loading is disabled.
This, in turn, makes it necessary to clean up some header inclusions.
Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Clang 3.8's undefined-behavior sanitizer checks that the
declared type of the object is a base class of the
dynamic type of the object on each access to a member
of a class type.
It therefore requires the typeinfo for these types,
which for polymorphic types is emitted in the TU where
the vtable is emitted, too.
QDBusConnectionPrivate is a polymorphic non-exported class,
so this failed at link-time. Ditto for the other case.
Fix by autotest-exporting the classes.
Also, where applicable, de-inline the dtors, so the
vtable (and typeinfo) are pinned to one TU, and the
ctor, just because it's the correct thing to do.
Change-Id: I991f81f88d2a48e85d94d9f3ac61473c0b7056d3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... to make user code buildable with gcc [-Werror=zero-as-null-pointer-constant].
Change-Id: Ifef52e406c1f7d5a260612ec27922d1805aea6e2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
... instead of sequential .arg(const QString &) callings.
It saves memory allocations and prevents unexpected results
if replacing strings contain place markers.
Found with clazy's qstring-arg check.
Change-Id: I3912275a6e11c6fb7559ff5623f2e8cde9b7f07a
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This pertially reverts commit 3ec57107ce
and brings back the hack to prevent the DLL from being unloaded. It
should have been enough, but we've got reports that it's still causing
trouble. Since it causes not much harm to keep the DLL loaded (worst
case scenario is that QtDBus and QtCore remain loaded after a plugin
gets unloaded), we'll keep it.
Note: Microsoft is aware that their way of killing threads on process
exit is a flaw. See https://blogs.msdn.microsoft.com/oldnewthing/20070502-00/?p=27023/
Task-number: QTBUG-53031
Change-Id: I2962773739e34633b033fffd1493dce695b008c0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Any amount of whitespace between elements is now reported as an error
starting with 5.8. This is (a) wrong and (b) very confusing for users.
Change-Id: I2530b2138f95912e5be07e94b7d7fdab49dedbb1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Don't use C++11 nullptr in 5.6.
Change-Id: I57e9595b2e1cede995eed09878bf02ee30482659
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
Also bump minimum required Qt version for Android: Ministro updates.
Conflicts:
src/android/java/src/org/qtproject/qt5/android/bindings/QtActivityLoader.java
src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
src/plugins/platforms/android/androidjnimain.cpp
Change-Id: I966f249bebf92da37bfdeb995ad21b027eb03301
QtDBus is compiled with exceptions disabled, but checkers
don't know that, and it's not 100% certain it will stay
that way until eternity.
So do the simple change and hold the new'ed pointer in a
QScopedPointer until handing it off to create().
Coverity-Id: 154477
Change-Id: I91a763ca4e93585c97cb9e794312b53046971161
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
it does not appear that the tests actually use these flags in any way;
they don't include any (actual) d-bus headers and have no ifdefs.
and the qdbus module already pulls in the flags via QMAKE_USE (in the
case where they are defined at all, i.e., dbus-linked).
Change-Id: Ie6bc6da7d1dd96da7b73f2d0fe45576936715874
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
To correct following type of error message:
Cannot find 'isValidPartOfObjectPath(...)' in \fn ....
Change-Id: I25850c69307511dc9a24a0c937fd219d4d3cb084
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Implements behavior for the --verbose switch already specified
but never implemented. Without this switch you would have to rebuild
qdbusxml2cpp to see error output. Using -V will now produce error output such as:
dbus.parser: unknown token "" "Characters"
dbus.parser: Invalid D-BUS interface name 'com.qt-project.dbus' found while parsing introspection
dbus.parser: unknown token "" "Characters"
dbus.parser: skipping unknown element "method"
dbus.parser: xml error "Opening and ending tag mismatch." doc "..."
Task-number: QTBUG-34126
Change-Id: Ie5b7ec78007ddc305b1e7ddbffb1436920721c9c
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
5971b88e is not needed in new configure.
This merge also reverts "fix QMAKE_DEFAULT_*DIRS resolution with
apple SDK", 2c9d15d7, because it breaks iOS build with new
configure system.
Conflicts:
mkspecs/features/default_pre.prf
mkspecs/features/mac/toolchain.prf
mkspecs/features/toolchain.prf
src/dbus/qdbusconnection.cpp
src/plugins/sqldrivers/mysql/qsql_mysql.cpp
src/sql/drivers/mysql/qsql_mysql.cpp
src/widgets/widgets/qmenubar.cpp
src/widgets/widgets/qmenubar_p.h
tools/configure/configureapp.cpp
tools/configure/environment.cpp
tools/configure/environment.h
Change-Id: I995533dd334211ebd25912db05b639d6f908aaec
This function sends D-Bus messages directly (in huntAndEmit), so it
should only be called from the QDBusConnectionManager thread. Somehow, I
missed this in the Qt 5.6 refactoring of QtDBus.
Being called in the wrong thread means that there's a visible behavior
change compared to Qt 5.5: if the user code sent a method call or method
return/error and then emitted a signal, we'd have two threads racing to
send the D-Bus messages. This was observed in Telepathy-Qt code: certain
signals arrived before a method return, even though they were clearly
emitted by a queued QMetaObject::invokeMethod.
In addition to that, we have has an internal problem (though not
observed): the libdbus-1 timer and socket callbacks would be called in
the wrong thread and we no longer have protection against that.
Unit testing not possible since this is a race condition.
Change-Id: I9e96ecd4f6aa4ff0ae08fffd1471d002142613d6
Reviewed-by: Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
It's a namespace containing only private things, but some of those get
used in some QtDBus tools. By adding a macro that expands to nothing,
findclasslist.pl will notice the namespace and add it to the ELF version
script.
Task-number: QTBUG-55897
Change-Id: I371f5b01e24a4d56b304fffd1472748cde56f0c3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The move constructor as well as member-swap were dealing with the
'unused' field as if it would be usable. But as the comment in the
default ctor suggests, the field can never be used in Qt 5, due to
the inline dtor.
So, don't bother with the field. Doing so only triggers checkers
such as Coverity.
Also mark the field for removal in Qt 6.
Coverity-Id: 154503
Coverity-Id: 154510
Change-Id: If42c5ed66d1133e651de7477f3313b3989b64bc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QString::fromLatin1 always allocates memory, but there are
cases where we can avoid/reduce allocations or/and reduce
text size, e.g.:
QStringBuilder expressions
Fix: replace QString::fromLatin1 with QL1S
QString::fromLatin1().arg(String) pattern
Fix: replace with QStringBuilder
Overloaded functions with QL1S arg
Fix: replace QString::fromLatin1 with QL1S
In rare cases if there is no overloaded function
with QL1S and we have deal with string literal,
replace QString::fromLatin1 with QStringLiteral.
Change-Id: Iabe1a3cc0830f40ef78a0548afa4368583c31def
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We must ensure that QDBusServer's newConnection() signal has been
processed by the application, before starting processing messages on it.
Task-number: QTBUG-55087
Change-Id: I595329b2f98788dbf9f40558b8c230c0c0817ef8
Reviewed-by: Timo Jyrinki <timo.jyrinki@iki.fi>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Don't create QString from QL1S, just iterate over QL1S directly.
Change-Id: I35196991224c206841efb11894a9baf736ead97e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Replaces our mix of comments for annotating intended absence of break
in switches with the C++17 attribute [[fallthrough]], or its earlier
a clang extension counterpart.
Change-Id: I4b2d0b9b5e4425819c7f1bf01608093c536b6d14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use the new qtConfig macro in all pro/pri files.
This required adding some feature entries, and adding
{private,public}Feature to every referenced already existing entry.
Change-Id: I164214dad1154df6ad84e86d99ed14994ef97cf4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
this migrates the cases where the build system already made (some) use
of variables (possibly) set by configure.
Change-Id: I43a08caed481d5f887a3a40821e71a4797760e7e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QDBusConnection::connect() behaves like QObject::connect with a
connection type of Qt::UniqueConnection | Qt::QueuedConnection. So
return false if it's already connected.
[ChangeLog][QtDBus][QDBusConnection] Fixed a bug that would cause
QDBusConnection::connect() to return true if a slot was already
connected to the same D-Bus signal. QtDBus does not support multiple
connections.
Change-Id: I87e17314d8b24ae983b1fffd1453aef5a7c9ad0b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The class doesn't exist and should not be forward declared nor declared
as private of QDBusVirtualObject
Change-Id: Icf3ca2b2be5ae0a8111785af485a0b6601002a25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The new modular configuration system requires one global
header per module, that is included by all other files in
this module.
QtDBus already had such a header, but its name (qdbusmacros.h) was
not in line with what's being used in all other modules. So
add a qtdbusglobal.h header, and turn qdbusmacros.h into a a forwarding
header to that new global header file.
Change-Id: Ib7eb2484c7b8b588eb89bf3290cb6c1c7c391fe2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This is needed for generic property access to work correctly.
Change-Id: I76613ace730985001fc5fe1bb1b3fa5c6a8bdf70
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit also reverts fecaa6aae8.
The Microsoft documentation says _beginthreadex and _endthreadex are
used to initialize the C/C++ runtime and are necessary when linking to
libcmt(d).lib (that is, when using the -MT or -MTd options). For regular
builds linking against the .dll runtime, there should be no impact.
Inspection of the CRT source code which gets installed with Visual
Studio or Windows SDK proves that.
It's preferable to use CreateThread directly as _endthreadex will try to
call FreeLibraryAndExitThread, which can cause a deadlock if we try to
wait for the thread to exit from a global destructor.
For -MT builds, since there can be no DLLs, it's not a problem to
continue to use _beginthreadex and follow Microsoft's recommendation.
Task-number: QTBUG-53031
Change-Id: Id5480807d25e49e78b79ffff144af62c3c59dfe0
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This reverts commit 5f542f3cca,
since it breaks streaming of types derived from QList and
the docs state that this should be possible without providing
custom op<</>> for such types.
Task-number: QTBUG-53376
Change-Id: I2bde714ac384f2aed67ad30decea702fb79aef1b
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This was seen in the wild for QList, but, as described
in the documentation note, it's a common problem.
[ChangeLog][QtDBus][QDBusArgument] Deprecated relying on a streamable
Base to stream a Derived without providing operator<</>>() for Derived.
No diagnostic provided.
Task-number: QTBUG-53376
Change-Id: If845574f731b537c20641dc7c49fa4369e85db5a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Examples in binary packages now directly match the install path.
Change-Id: Ic1487bc766cfd3b0a0a340cc4ae4ba49d953eaa6
Task-number: QTBUG-52953
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Port the last remaining Q_FOREACH user in QtCore to
C++11 range-for and mark QtCore, QtSql and QtDBus as
Q_FOREACH-free, using QT_NO_FOREACH.
Change-Id: Ia6f99139cb1ca4a8bbe9e445421592242e048b0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Because the moment we disconnect from the object's destroyed() signal,
it may get destroyed in another thread. If the same object appears more
than once in the object tree or in the signal hook table, we could be
accessing a dangling pointer.
Task-number: QTBUG-52988
Change-Id: Ifea6e497f11a461db432ffff14496f0f83889104
Reviewed-by: Weng Xuetian <wengxt@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We don't know why it happens, so let's apply a workaround. See the
comment for more details.
Task-number: QTBUG-53031
Change-Id: Ifea6e497f11a461db432ffff144972e892fbbda5
Reviewed-by: Roland Winklmeier <Roland.M.Winklmeier@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Don't use QString::prepend() in the loop. Just compose
temp string by appending, and then prepend whole temp string.
Change-Id: I6efb2d20e03f6a3526103d3a9494d5d1b0fbbf81
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Replace substring functions that return QString with
corresponding functions that return QStringRef where
it's possible.
Create QString from QStringRef only where necessary.
Add overloaded functions with QStringRef arg
in QDBusUtil:
- isValidUniqueConnectionName()
- isValidMemberName()
- isValidPartOfObjectPath()
Change-Id: I4a24a298702728ba7d3a65c39e25c3a9c759e07f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
libdbus will send a local signal if connection gets disconnected. When
this happens, end all pending calls with QDBusError::Disconnected.
Task-number: QTBUG-51649
Change-Id: I5c7d2a468bb5da746d0c0e53e458c1e376f186a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Make the destructor of QDBusArgumentPrivate virtual as it may store
other types (QDBusDemarshaller). Suggested by Thiago.
Fixes a "new-delete-type-mismatch" error reported by AddressSanitizer.
Task-number: QTBUG-52176
Change-Id: I9ac19050840530ca9cae893b10093185d31e0448
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
If a QObject is added or passed as receiver to QDBusConnection::connect()
and it is managed by Q_GLOBAL_STATIC or similar mechanism, it is
possible that when that its destructor is called after the dbus daemon
thread ends. In that case, QObject::destroyed connected via
Qt::BlockingQueuedConnection to QDBusConnectionPrivate will cause dead
lock since the thread is no longer processing events.
Task-number: QTBUG-51648
Change-Id: I1a1810a6d6d0234af0269d5f3fc1f54101bf1547
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Most libs use QMAKE_LIBS/CFLAGS, but some have other naming
conventions. Unify them into using QMAKE_LIBS/CFLAGS.
Change-Id: I39b188adc1f9a223a83b294c5315c3095a9c68de
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Update files using old header.LGPL3 to header.LGPL
Update files using old FDL template to use new one
Update files using old BSD template to use new one
Change-Id: I36a78272516f9953d02956522f285b40adfc8915
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Whenever a message spy was installed, we failed to actually process
looped-back messages by queueing them for processing by the spy. That
had as a consequence that the caller got an error reply. Worse, since
the message had been queued, QtDBus would attempt to deliver it later.
Since that message had isLocal==true, bad things happened inside the
manager thread.
The correct solution is not to queue the message for the filter. If the
message is local, then simply deliver directly, as we're still in the
user's thread. This used to be the behavior in Qt 5.5.
Task-number: QTBUG-51676
Change-Id: I1dc112894cde7121e8ce302ae51b438ade1ff612
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Jan Kundrát <jkt@kde.org>
The printf-style version of QDebug expands to a lot less code than the
std::ostream-style version. Of course, you pay in type safety (but
compilers warn about it these days), you cannot stream complex Qt
types and streaming QStrings is awkward, but in many cases you
actually improve on readability.
But the main reason is that something that's not supposed to be
executed under normal operation has no business bloating executable
code size.
This is not an attempt at converting all qWarnings() to printf-style,
only the low-hanging fruit.
In this first part, replace
qWarning() << ""
with
qWarning("...").
Had to fix broken qImDebug() definition. Instead of defining it as
a nullary macro in the QT_NO_DEBUG case and as a variadic macro in
the other, define it in both cases, as is customary, as a non-function
macro so that overload selection works without requiring variadic
macro support of the compiler.
Saves e.g. ~250b in text size in QtPrintSupport on optimized GCC 5.3
AMD64 builds.
Change-Id: Ie30fe2f7942115d5dbf99fff1750ae0d477c379f
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This change partially reverts 1bfc7f68 about QT_HAS_BUILTIN define
and undef in src/corelib/tools/qsimd_p.h.
This change is also squashed with "Fall back to c++11 standard
compiler flag for host builds" which is done by Peter Seiderer.
Conflicts:
mkspecs/features/default_post.prf
src/3rdparty/sqlite/0001-Fixing-the-SQLite3-build-for-WEC2013-again.patch
src/3rdparty/sqlite/sqlite3.c
src/corelib/tools/qsimd_p.h
src/gui/kernel/qevent.cpp
src/gui/kernel/qwindowsysteminterface.cpp
src/gui/kernel/qwindowsysteminterface_p.h
src/plugins/bearer/blackberry/blackberry.pro
src/plugins/platforms/cocoa/qcocoasystemsettings.mm
src/plugins/platformthemes/gtk2/gtk2.pro
src/plugins/styles/bb10style/bb10style.pro
src/sql/drivers/sqlite2/qsql_sqlite2.cpp
tools/configure/configureapp.cpp
Task-number: QTBUG-51644
Done-with: Peter Seiderer <ps.report@gmx.net>
Change-Id: I6100d6ace31b2e8d41a95f0b5d5ebf8f1fd88b44
this fixes static builds by ensuring that all dependencies are exported.
Task-number: QTBUG-51071
Change-Id: Icbce502dcbcb4d4b4d922c42679f44e2cc930bf3
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Commit 1f6fa1f37a added a way of
suspending delivery of messages to standard buses when they connect and
resuming delivery when the main loop starts. As a side-effect, we caused
an attempt to do dispatching even after the connection failed. The D-Bus
library doesn't like that.
Task-number: QTBUG-51299
Change-Id: I0c94a5c2846b48c8aea7ffff143564f7fcede890
Reviewed-by: David Faure <david.faure@kdab.com>
This also reverts commit 018e670a26.
The change was introduced in 5.6. After the refactoring, 14960f52,
in 5.7 branch and a merge, it is not needed any more.
Conflicts:
.qmake.conf
src/corelib/io/qstandardpaths_mac.mm
src/corelib/tools/qsharedpointer_impl.h
tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
interface is a define under wince. This define is included even
with standard header includes already. It needs to be undefined
for using it.
Task-number: QTBUG-50853
Change-Id: Ie44681f03709848e9747a8aec11835c8d62aa409
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The deprecation was introduced in 5.6
Change-Id: Ief6b749b40ec75c3c9f904caed8447bfb5ef5439
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
qfeatures.txt says that it depends on PROPERTIES, so this condition will
never happen.
Change-Id: I42e7ef1a481840699a8dffff1409e2e63c6857fa
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Whenever there are spies installed, we call out to the main thread to
call to the kded/kiod message spies. This allows the spy code to do just
about anything, where previously it was restricted in what it could do
to avoid deadlocking or triggering assertions if it recursed back into
QDBusConnection code in the manager thread. After the spies are done,
the message is re-inserted into the QDBusConnection processing pipeline.
This commit moves the spy handling to after the check for disabled
dispatching, as doing otherwise would mean the message could get
postponed again for no good reason. It's also possible that the main
thread isn't done installing the hooks, so waiting until the dispatching
is enabled is a good idea.
For simplicity, this commit also restricts spying to method calls
only. Signals are no longer spyable.
Change-Id: I3d11545be52c43119f0fffff142b0e9d447415c2
Reviewed-by: David Faure <david.faure@kdab.com>
I wrote a script to help find the files, but I reviewed the
contributions manually to be sure I wasn't claiming copyright for search
& replace, adding Q_DECL_NOTHROW or adding "We mean it" headers.
Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Not that we require it, but since The Qt Company did it for all files
they have copyright, even if they haven't touched the file in years
(especially not in 2016), I'm doing the same.
Change-Id: I7a9e11d7b64a4cc78e24ffff142b4c9d53039846
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)
Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new LGPL header instead of LGPL21 one
(in those files which will be under LGPL v3)
Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Saves a bit more than 0.5KiB in text size on optimized
GCC 4.9 Linux AMD64 builds.
Change-Id: I3b7e4751c4799c3e2c9f8f23b769e1659d863579
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It just prevents the compiler from synthesizing move
special member functions, something that is very much
desired, seeing as there's a QVector member.
Change-Id: I4daabb380cd73dcacf3f514827b84562767a7a20
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This reverts commit 618e2cc081. The
original commit has a section of code that I failed to review properly
and is of questionable functionality.
Change-Id: I61c53d7b8b2aa7c3312292b017a18aba7da11bc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is a false positive because the only offset that can be outside the
bounds was the last one (-1), which could not be reached in this line
because of the qBound on the line before limiting the maximum value.
The -1 wasn't generated by the Perl script embedded in the file anyway.
qdbuserror.cpp:142:64: error: offset outside bounds of constant string [-Werror]
Change-Id: I24a735698d3c4a719fc9ffff1425f8aad5e5978e
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
The reply serial is displayed for method call returns and errors,
while the serial is displayed for all message types.
To see a message serial it is required to dump messages after
sending, not before.
Task-number: QTBUG-44490
Change-Id: I859f50d739ed059d5b2dfe1a2efdf04b906891a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch includes setup of class member 'msg' in
QDBusMessagePrivate::toDBusMessage() to be able to get the
serial after message sending.
Testcases for comparing the 'reply serial to' with the 'serial'
are included.
Task-number: QTBUG-44490
Change-Id: Iae7c48f5b0c70a6c5ae500904072b38b46dfd876
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... and remove misleading comments (these are overloads, not specializations).
The QList overloads do nothing different from the generic container
overloads. Remove them.
Only leave the QVariantList overload, because that converts to
QDBusVariant before serializing. Which means that this should
probably be templated on the container type, otherwise you get
different behavior for QList<QVariant> and, say, QVector<QVariant>,
which is surely wrong.
Change-Id: I215ba9891235b51304c2ed4041d3dbd003d69581
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
To retain a bit compatibility with applications developed in the last 9
years that expect that QDBusConnections won't process their events until
the event loop runs, we now suspend the handling of incoming messages
in the two default buses (and only in them) and resume when the event
loop starts. This is required because the new threaded QtDBus would
otherwise process incoming messages that the application didn't expect
it to.
For example, if the application first acquires names on the bus and only
after that registers objects with QtDBus, there's a small window in
which the name is acquired and visible to other applications, but no
objects are registered yet. Calls to those objects may be received,
would then be processed in the QDBusConnectionManager thread and fail.
The work around is to disable the actual handling of method calls and
signals in QDBusConnectionPrivate::handleMessage. Instead, those
messages are queued until later.
Due to the way that libdbus-1 works, outgoing method calls that are
waiting for replies are not affected, since their processing does not
happen in handleMessage().
[ChangeLog][Important Behavior Changes] QtDBus now uses threads to
implement processing of incoming and outgoing messages. This solves a
number of thread safety issues and fixes an architectural problem that
would cause all processing to stop if a particular thread (usually the
main thread) were blocked in any operation. On the flip side, application
developers need to know that modifications to a QDBusConnection may be
visible immediately on the connection, so they should be done in an
order that won't allow for incomplete states to be observed (for
example, first register all objects, then acquire service names).
Change-Id: I39cc61d0d59846ab8c23ffff1423c6d555f6ee0a
Reviewed-by: David Faure <david.faure@kdab.com>
So we can do
connect(&watcher, SIGNAL(finished()), receiver, SLOT(foo()));
Change-Id: I39cc61d0d59846ab8c23ffff14241d33fecf2d53
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
They're never pending, since we add them immediately since commit
186d881440.
Change-Id: I39cc61d0d59846ab8c23ffff14241be6785ad5a0
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
QList of pointers is optimum, but QVector should provide the same
performance (we aren't using the beginning-of-list feature that QList
has and QVector doesn't).
But since we're using QVector elsewhere, this should be better.
Change-Id: I39cc61d0d59846ab8c23ffff14241c6715e2eb00
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Calling QVector::erase(it) in a loop consitutes quadratic
behavior (O(N) function called O(N) times).
Fix by using std::remove_if(), which is linear.
Change-Id: I39c11231d604bc2d9506427bc3411b71d71b5569
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If, after checking a condition, we issue a qFatal()
or a qCritical(), by definition that check is
unlikely to be true.
Tell the compiler so it can move the error handling
code out of the normal code path to increase the
effective icache size.
Moved conditional code around where possible so that
we could always use Q_UNLIKELY, instead of having to
revert to Q_LIKELY here and there.
In some cases, simplified the expressions newly wrapped
in Q_UNLIKELY as a drive-by.
Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>