Commit Graph

832 Commits

Author SHA1 Message Date
Alexandru Croitor
e9a797799e CMake: Add Qt6 forward compatible CMake API and targets
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>
2020-01-25 18:10:26 +01:00
Leander Beernaert
502d3d6744 Merge remote-tracking branch 'origin/dev' into merge-dev
Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
2020-01-24 13:17:33 +01:00
Olivier Goffart
73d1476fb1 Replace most use of QVariant::type and occurrences of QVariant::Type
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>
2020-01-23 16:46:51 +01:00
Qt Forward Merge Bot
35a461d026 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I68702c9f9680772d332b5bb777ddd2663168abd5
2020-01-19 01:00:10 +01:00
Qt Forward Merge Bot
3e9f8b5249 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I12148e7b20bcdb72d9b328035d528c99633b1e92
2020-01-18 01:00:08 +01:00
Nico Vertriest
28f95d4688 Doc: Fix qdoc compilation errors qtbase
Task-number: QTBUG-79824
Change-Id: I5a39525e3e735415ba96e2d585c5de754deb15de
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2020-01-17 12:56:08 +00:00
Qt Forward Merge Bot
d14fd32d40 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/auto/network/access/spdy/tst_spdy.cpp

Change-Id: I3196c5f7b34f2ffc9ef1e690d02d5b9bb3270a74
2020-01-15 10:14:05 +01:00
Olivier Goffart
2cbc5f6f7a Fix -Wdeprecated-copy warning
QDBusReply has an user-specified operator= but no copy constructor.

Change-Id: If7fcec3193af375f1bf2dd913d82548d6e035b48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-14 16:52:34 +01:00
Liang Qi
a503bf5470 Merge remote-tracking branch 'origin/5.15' into dev
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
2020-01-04 15:32:34 +01:00
Olivier Goffart
d6266c757d Replace usages of QVariant::value by qvariant_cast
This is done automatically with a clazy check

Change-Id: I3b59511d3d36d416c8eda74858ead611d327b116
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-15 12:30:52 +01:00
Mårten Nordheim
40f28b1a8a Don't use QMap::unite for merging maps
Other code using these maps are not treating them like multi-maps

Change-Id: I3381fde3b3612a29110cfe890f20f96f3c0bd3a2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-12 15:25:47 +01:00
Mårten Nordheim
43837f38b2 Change some uses of QMap::insertMulti to QMultiMap::insert
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>
2019-12-12 15:25:41 +01:00
Lars Knoll
9c124b1b0a Qt 6: Deprecate QHash::insertMulti
[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>
2019-12-12 15:25:26 +01:00
Qt Forward Merge Bot
bef74b6c3a Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
2019-12-09 10:16:01 +01:00
Lars Knoll
e58b44d557 Change representation of string data in the meta object
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>
2019-12-08 18:19:58 +01:00
Allan Sandfeld Jensen
ece0c0a5e7 Tidy nullptr usage
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>
2019-12-06 12:13:20 +01:00
Qt Forward Merge Bot
0c29ebe374 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I4134c0c6b6c9911950f58b3b5c86e789d28a185b
2019-12-04 01:00:23 +01:00
Kai Koehne
b6632443d4 CMake: Use lower-case macro/function names
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>
2019-12-03 12:51:10 +01:00
Elvis Angelaccio
c0fb2a8173 QDBusInterface: mention QtDBus caching in documentation
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>
2019-11-30 15:24:14 +01:00
Qt Forward Merge Bot
58c69df4d3 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/tools/qhash.h
	src/gui/kernel/qevent.h
	src/widgets/kernel/qshortcut.cpp
	src/widgets/kernel/qshortcut.h

Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
2019-11-25 11:30:04 +01:00
Allan Sandfeld Jensen
af2daafde7 Deprecate constructing QFlags from a pointer
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>
2019-11-20 19:43:38 +01:00
Leander Beernaert
26e8769124 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
2019-11-19 13:53:21 +01:00
Alexandru Croitor
e9a58ba9e5 Regenerate src/*
Change-Id: I0314b4faa1e4860e86198eea4189987e527dfec2
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-14 09:05:48 +00:00
Alexandru Croitor
cb6f92c481 Regenerate everything under ./src
Change-Id: Ibdbdc17f8c2ee41356f490dd839a47e1bcf4c586
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:27:29 +00:00
Lars Knoll
66b6e28c01 Use QMultiHash::insert() instead of insertMulti()
Change-Id: I5daeba708a9efcf60e92cfc9a04e80546e9ae6a2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-11-05 17:32:34 +01:00
Lars Knoll
5357231c0a Make QList an alias to QVector
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>
2019-10-30 11:52:48 +01:00
Alexandru Croitor
440286655e Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
2019-10-14 17:46:34 +02:00
Qt Forward Merge Bot
e164d61ca8 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I129dd579f92cb2592a38ca043472b45cb926ae12
2019-10-14 01:00:34 +02:00
Alexandru Croitor
f4b4c4f79b Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I3a1d7673c3c20019ab12a2ea0a60f1619920a34c
2019-10-11 16:23:19 +02:00
Liang Qi
9c84b7786c Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/plugins/platforms/xcb/qxcbscreen.h
	src/src.pro

Change-Id: I4e1981e69a1ddcbe4078ec6ab2a64b0da6a445de
2019-10-10 09:13:49 +02:00
Lars Knoll
4c571032f8 Add support for slots to receive the raw void ** arguments array
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>
2019-10-07 20:40:51 +02:00
Leena Miettinen
0c1d23db7b Doc: Add info about QDBusConnection::ExportChildObjects
Child objects need QObject::objectName.

Fixes: QTBUG-17740
Change-Id: Iebf8bcd7252f8a441d7c265aae3d4dd81b3cfa54
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-07 10:56:45 +02:00
Qt Forward Merge Bot
2c4b44d750 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ife31dad3c8dc43c5ff4d266e6d646230c5d20a50
2019-10-06 01:01:08 +02:00
Albert Astals Cid
3afe4a402c Convert a few sizeof(array)/sizeof(element0) fors to range fors
Increases readability

Change-Id: I81ea915517fd2cd6bc2780f37ba8d8097c63f44b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-04 09:00:24 +02:00
Qt Forward Merge Bot
4c8814a341 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ideaa64d583746f1ce8265997131fb1ce3a9acbcf
2019-10-02 08:39:15 +02:00
Alexandru Croitor
0e14bd586a Regenerate qtbase/src projects
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>
2019-09-30 18:41:11 +00:00
Alberto Mardegan
20b823f5a7 Doc: remove wrong documentation for Qt D-Bus delayed replies
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>
2019-09-29 00:33:48 +03:00
Alexander Volkov
388d539865 doc: Fix variable name in QDBusArgument snippet
Change-Id: I751802d3f9f389e80cbb9aabcdb637d4742d3832
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-27 18:27:17 +03:00
Simon Hausmann
ceb2937498 Fix add_qt_docs calls
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>
2019-09-19 07:43:13 +00:00
Simon Hausmann
655b2ed90c Re-generate main module CMake files
This fixes the calls to add_qt_docs to include the target.

Change-Id: I2c4c807bca8faa48bb49f4b8710035f21abfca0e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-09-18 09:45:23 +00:00
Liang Qi
6a36fe904c Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/codecs/qicucodec.cpp
	src/dbus/qdbusserver.cpp
	src/gui/painting/qbezier.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
	src/plugins/printsupport/cups/qppdprintdevice.cpp

Change-Id: I2703128bb64baf5580fbc2c2061b55b0f0611d2a
2019-09-04 07:03:54 +02:00
Leander Beernaert
bf298499a0 Update public CMake macros' version
Update all public Qt macros to use qt6/QT6 instead of qt5/QT6.

Change-Id: Ib178f4fa21f37dfb8da7d4d8c097aa0e96c9d9f9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-23 10:04:30 +00:00
Marc Mutz
e913b690b9 QtDBus: port all QMutexLocker users to qt_{scoped,unique}_lock
Change-Id: Ibba27351a81b0b132ce702c1dfd49d56f23bd8c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-08-23 08:44:03 +02:00
Paul Olav Tvete
2f52e1da0d Merge remote-tracking branch 'qt/5.12' into 5.13
Conflicts:
	src/gui/configure.json
	src/gui/util/qtexturefilereader.cpp
	src/gui/util/util.pri
	tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp

Change-Id: I2bc4f84705b66099e97330cda68e0b816aceb9cc
2019-08-20 10:41:56 +00:00
Mårten Nordheim
6d3a454693 DBus: fix deadlock when destroying QDBusServer
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>
2019-08-16 20:47:33 +00:00
Alexandru Croitor
c7ec7cd2a1 Merge branch 'wip/qt6' into wip/cmake
Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
2019-08-15 16:53:19 +02:00
Marc Mutz
80179e3b7e Port users of QDBusAbstractInterface::(async)callWithArgumentList() to new variadic (async)Call()
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>
2019-08-07 20:09:17 +00:00
Thiago Macieira
3183e428a9 Mark QDBusError::ErrorType a Q_ENUM
Easier qDebugging.

Fixes: QTBUG-77183
Change-Id: Ife213d861bb14c1787e1fffd15b63a1f8d64cc30
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-05 20:41:51 -07:00
Alexandru Croitor
4dac45c9ee Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
2019-07-11 17:17:51 +02:00
Kai Uwe Broulik
777c98ad9f QDBusConnectionInterface: Add activatableServiceNames
This allows to query all names that can be activated on the bus.

Change-Id: I8f894bf858eb18b67a074ca666ad3200ed99c373
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-07 12:16:11 +02:00
Liang Qi
25eb97d2d4 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	.qmake.conf
	src/network/ssl/qsslsocket_openssl.cpp

Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
2019-06-27 14:38:03 +02:00
Liang Qi
aedc59b1c3 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/io/qstorageinfo_unix.cpp
	src/network/ssl/qsslsocket_openssl.cpp

Change-Id: Ibc9ce799bef62d60d616beaa9fbde8ebeadfbc20
2019-06-25 15:47:42 +02:00
Liang Qi
ef37ab9970 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	.qmake.conf
	src/gui/painting/qdrawhelper.cpp
	src/gui/text/qdistancefield.cpp
	src/gui/text/qdistancefield_p.h
	src/network/ssl/qsslsocket_openssl.cpp
	src/plugins/platforms/android/qandroidinputcontext.cpp
	src/widgets/styles/qstylesheetstyle.cpp

Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Ia7daad21f077ea889898f17734ec46303e71fe6b
2019-06-25 13:04:27 +02:00
Alexandru Croitor
fe3bd212fc Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
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
2019-06-14 16:31:09 +02:00
Kai Koehne
29670528d8 Qt D-Bus: Document CMake commands
Task-number: QTBUG-72159
Change-Id: I4b2f29a9d976f4b81acef3170b90016d2e8b5ef8
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-06-21 11:04:05 +02:00
Alexandru Croitor
891c897b80 Regenerate the main qtbase modules
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>
2019-06-05 07:39:14 +00:00
Marc Mutz
f8f4a75d82 QtDBus: use new QLatin1String::arg()
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>
2019-06-03 23:28:18 +02:00
Marc Mutz
08103d3a52 QDBusAbstractInterface: make call() and asyncCall() variadic templates
... 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>
2019-06-21 09:18:13 +02:00
Alexandru Croitor
e4079eca49 Merge remote-tracking branch 'origin/dev' into wip/cmake
Take 5.

Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
2019-06-03 15:14:42 +02:00
Simon Hausmann
8fa646dbe2 Add basic support for compiling applications with qmake
* 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>
2019-05-31 12:53:09 +00:00
Giuseppe D'Angelo
34fe9232db Port from QAtomic::load() to loadRelaxed()
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>
2019-06-20 20:48:59 +02:00
Alexandru Croitor
0711d497d9 Regenerate dbus
And add the first version of the .prev file.

Change-Id: I8375591a8cfc087291774370b8308c808dd5f0b4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-20 09:36:37 +00:00
Alexandru Croitor
0efe6fc90f Don't link against dbus-1_nolink when dbus_linked feature is off
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>
2019-05-08 12:32:53 +00:00
Tobias Hunger
cc141cc5c6 CMake: Fix dbus build after dbus library detection update
Change-Id: If4d773136b1aa01204e012c6900458673a4c5670
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-05-07 15:07:07 +00:00
Tobias Hunger
42648ff993 CMake: Regenerate src/dbus
Change-Id: Iff9890ead883bac5f75425a2d0367e639d648399
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-05-06 14:22:36 +00:00
Topi Reinio
4ad915425d Doc: Replace example file lists with links to code.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>
2019-05-03 14:24:42 +02:00
Tobias Hunger
6630937e63 Merge commit 'dev' into 'wip/cmake-merge'
Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
2019-04-16 16:32:08 +02:00
Martin Smith
0e2c013a45 doc: Add dontdocument.qdoc files
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>
2019-05-07 16:58:09 +02:00
Allan Sandfeld Jensen
1ef274fb94 Replace qMove with std::move
Change-Id: I67df3ae6b5db0a158f86e75b99f422bd13853bc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-06 11:00:38 +00:00
Qt Forward Merge Bot
ed485243b5 Merge "Merge remote-tracking branch 'origin/5.13' into dev" into refs/staging/dev 2019-04-04 23:01:17 +00:00
Allan Sandfeld Jensen
8d7c97d428 Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usage
Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-04 18:01:38 +00:00
Lars Knoll
999c26dd83 Add a QAbstractMetaCallEvent
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>
2019-03-29 13:46:22 +00:00
Tobias Hunger
432f7232e3 CMake: Add public dependency from Qt::Dbus to Qt::Core
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>
2019-03-20 12:29:53 +00:00
Liang Qi
b1a216649e Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	qmake/generators/makefile.cpp
	qmake/generators/unix/unixmake2.cpp
	src/corelib/thread/qthread_unix.cpp
	tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp

Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
2019-06-14 13:45:18 +02:00
Kevin Funk
41e7b71c41 More nullptr usage in headers
Diff generated by running clang-tidy's modernize-use-nullptr checker on
the CMake-based Qt version.

Skipping src/3rdparty, examples/, tests/

Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-03-14 07:37:52 +00:00
Tobias Hunger
bfca573f87 CMake: Re-generate CMakeLists.txt file for dbus
Change-Id: I13ce987d4db99e160bf579ea3a785ac45cc1417b
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-03-04 09:24:37 +00:00
Edward Welbourne
241533962c Add ### Qt6 comment requested in code-review
Task-number: QTBUG-73484
Change-Id: I7c1c5faf3d32fa21d8d2277ec434084450290156
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-02-25 09:29:14 +00:00
Chris Adams
d7afd8bb38 Remove dead code from qdbusintegrator.cpp
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>
2019-02-22 16:57:27 +10:00
Joerg Bornemann
ce1830fd21 Migrate Windows system libs to external dependencies
Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I211ce3252b836894aeeac1c85eb316d9596bca57
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-08 08:30:02 +00:00
Allan Sandfeld Jensen
b32b61f17e Remove handling of missing Q_COMPILER_RVALUE_REFS
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>
2019-05-01 20:24:45 +00:00
Edward Welbourne
1c55948ee8 DBus: verify up to date with dbus-1.12.12
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>
2019-02-21 13:25:58 +00:00
Kevin Funk
43ff1b568a cmake: Fix more old-style CMake macros
Use the proper target name for the Qt tools

Change-Id: I04b3aed7b58d44e60597223340d66ac97ea083cb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-12 14:20:32 +00:00
Kevin Funk
988162eaf8 cmake: Start to use ConfigExtra.cmake files
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>
2019-02-12 13:37:08 +00:00
Friedemann Kleint
e209321966 Use Q_DISABLE_COPY_MOVE for private classes
Change-Id: I3cfcfba892ff4a0ab4e31f308620b445162bb17b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-12-12 07:23:54 +00:00
Liang Qi
5d5c00c676 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/gui/painting/qdrawhelper.cpp

Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
2018-12-04 09:58:43 +01:00
Kirill Burtsev
030b17ecc0 QDBusConnection: prevent leaking connection/server on destroy
Amends fix 68964b1023

Change-Id: I05816f4b4d2128ed0b669e124d9c9eef92122ec0
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-28 11:19:34 +00:00
David Edmundson
d761c62783 QDBusServiceWatcher namespace prefix support
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>
2018-11-06 09:52:09 +00:00
Martin Smith
81d8319276 doc: Fix all clang parse errors in QtBase during PCH build
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>
2018-11-05 13:10:11 +00:00
Simon Hausmann
e9c45bbddd Begin port of qtbase to CMake
Done-by: Alexandru Croitor <alexandru.croitor@qt.io>
Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Done-by: Kevin Funk <kevin.funk@kdab.com>
Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Done-by: Simon Hausmann <simon.hausmann@qt.io>
Done-by: Tobias Hunger <tobias.hunger@qt.io>
Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-by: Volker Krause <volker.krause@kdab.com>
Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
2018-11-01 11:48:46 +00:00
Frederik Gladhorn
102a919b73 Generate documentation .tags files for all of the docs
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>
2018-10-31 08:38:02 +00:00
Liang Qi
e28e91ae99 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/animation/qpropertyanimation.cpp
	src/gui/image/qicon.cpp
	tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp

Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
2018-10-25 07:21:53 +02:00
Edward Welbourne
c14103be50 Update dbus header and document its provenance
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>
2018-10-19 12:15:51 +00:00
Mikhail Svetkin
b472e73b02 qdbuserror: Use qOffsetStringArray instead of script generated code
Change-Id: I2498702bcf4706cb717a7481cf6f81ceebb29ae8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-16 18:32:18 +00:00
Frederik Gladhorn
eb4d39ada0 Remove separation of headers into two lists
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>
2018-10-16 14:42:44 +00:00
Qt Forward Merge Bot
295cd87c6d Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I66c7f18a2abd13601da0947919436f7da3549ae9
2018-09-07 01:00:21 +02:00
Venugopal Shivashankar
059b10f295 Doc: Check before including the \snippet from a .pro file
Change-Id: Icc7552b46a2657c81958e40f33596ddeee045172
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-08-30 09:23:42 +00:00
Ulf Hermann
0a06e1baf9 Modernize the "thread" feature
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>
2018-08-17 00:34:36 +00:00
Allan Sandfeld Jensen
1c623bc6d1 Fix QMetaObject naming of class enum flag
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>
2018-08-11 07:59:15 +00:00
Frederik Gladhorn
ff78e6fe35 Fix build without 'library'
Without QT_CONFIG(library) qdbus_resolve_conditionally would be declared
but not defined.

Change-Id: Id90f6c736080e4c1609568b3fab1f464c0e46aa3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-07-16 15:23:27 +00:00
Kai Uwe Broulik
d743df975d Support interactive authorization flag in DBusMessage
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>
2018-07-10 19:46:40 +00:00
Paul Wicking
7f7ceb567f Doc: Add references to QDBusAbstractAdaptor implementation example
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>
2018-06-29 05:16:04 +00:00
Paul Wicking
023a818738 Doc: Remove old and broken QDBus adaptor example
Task-number: QTBUG-69091
Change-Id: I991a5bc01c316a5e23204550618d730af755292c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-28 07:37:25 +00:00
Paul Wicking
8bd73ad989 Doc: Add missing full stops in briefs
Task-number: QTBUG-68933
Change-Id: I3f2a9f8c562f9a44bb32bddd31d75abbfe6de04d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-06-21 14:23:30 +00:00
Qt Forward Merge Bot
552c45bea9 Merge remote-tracking branch 'origin/5.11.0' into 5.11
Change-Id: Id6e2acd5e31c1ac858ddf1d8873a6f10694141de
2018-05-09 13:48:42 +02:00
Volker Krause
9ac9bea16c Fix handling of QDBusMessage in qdbuscpp2xml in bootstrapped mode
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>
2018-04-29 16:44:32 +00:00
Kai Koehne
c579a77f84 Document libdbus-1 code in Qt D-Bus
[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>
2018-04-20 06:45:12 +00:00
Rolf Eike Beer
25956a1e7c DBus: merge calls to set_source_files_properties() in CMake functions
This can handle multiple files at once just fine.

Change-Id: I9dcf7b0c72df432f02200ac7f3967f36a408f306
Reviewed-by: David Faure <david.faure@kdab.com>
2018-03-23 16:38:56 +00:00
Liang Qi
305dd1b61f Merge remote-tracking branch 'origin/5.9' into 5.11
Conflicts:
	.qmake.conf
	src/corelib/animation/qvariantanimation.cpp
	src/corelib/global/qglobal.cpp
	src/corelib/global/qlogging.cpp
	src/corelib/io/qprocess_win.cpp
	src/corelib/json/qjsonarray.cpp
	src/corelib/tools/qsimd_p.h
	src/corelib/tools/qtimezoneprivate_p.h
	src/corelib/xml/qxmlstream_p.h
	src/gui/kernel/qsimpledrag.cpp
	src/gui/kernel/qsimpledrag_p.h
	src/plugins/generic/generic.pro
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/widgets/styles/qmacstyle_mac.mm
	tests/auto/concurrent/qtconcurrentmap/BLACKLIST
	tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
	tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
	tests/auto/gui/kernel/qwindow/BLACKLIST
	tests/auto/widgets/dialogs/qmessagebox/BLACKLIST

Change-Id: I508d686cf20f7f8cc6a7119b9bc7c3bbb505c58e
2018-02-14 12:51:24 +01:00
Kai Koehne
c4b596fb79 Document licenses for all Qt modules
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>
2018-01-24 13:19:24 +00:00
Liang Qi
65a97fccc6 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: If089d5010d15c33b3c1f13912d4386207456c1a9
2018-01-20 22:36:19 +01:00
Martin Storsjö
5eaecaa966 Undef interface in more places, fixing builds with libc++ on windows
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>
2018-01-18 04:44:44 +00:00
Martin Smith
bcc1eaab70 doc: Fix remaining qdoc warnings in QtDBus
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>
2018-01-15 15:00:58 +00:00
Friedemann Kleint
9031069e12 Add more Q_FALLTHROUGH()
Silence g++ 7.X warnings.

Change-Id: Id06d06e7e3b5be2cf3934d81f1891da58dea2649
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-12 07:10:25 +00:00
Friedemann Kleint
3439f523b8 QtDBus: Raise minimum supported MSVC version to 2015
Remove code for older versions and streamline #ifdefs.

Task-number: QTBUG-51673
Change-Id: I0c0ba4e914a1f3b7a324c68c59544a5074f7b075
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-04 20:24:09 +00:00
Lars Knoll
0f315adf91 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	.qmake.conf
	sc/corelib/io/qfsfileengine_p.h
	src/corelib/io/qstorageinfo_unix.cpp
	src/platformsupport/eglconvenience/qeglpbuffer_p.h
	src/platformsupport/input/libinput/qlibinputkeyboard.cpp
	src/platformsupport/input/libinput/qlibinputpointer.cpp
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/plugins/platforms/ios/qiosscreen.h
	src/plugins/platforms/ios/qioswindow.h
	src/plugins/platforms/ios/quiview.mm
	src/printsupport/dialogs/qpagesetupdialog_unix_p.h
	src/printsupport/dialogs/qprintpreviewdialog.cpp
	src/printsupport/widgets/qcupsjobwidget_p.h
	src/widgets/widgets/qmenu.cpp
	tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
2018-01-02 09:58:44 +01:00
Martin Smith
a942721edc doc: update dbus sources for clangqdoc
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>
2017-12-08 17:38:06 +00:00
Martin Smith
929ea50393 doc: Document remaining anonymous enums
This change adds qdoc comments for the remaining nameless
enum types.

Change-Id: I4da8b67883c8020323437cf74c938d3655d8c384
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-06 07:11:48 +00:00
Liang Qi
153e8b49ad Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/network/access/qhttp2protocolhandler_p.h
	src/network/kernel/kernel.pri
	src/network/ssl/qsslkey_qt.cpp
	src/plugins/platforms/cocoa/qcocoascreen.mm
	src/plugins/platforms/windows/accessible/iaccessible2.cpp
	src/plugins/platforms/windows/accessible/iaccessible2.h
	src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
	src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
	src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h
	src/widgets/widgets/qmenu_p.h
	tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/auto/other/qaccessibility/tst_qaccessibility.cpp
	tests/auto/testlib/selftests/expected_cmptest.lightxml
	tests/auto/testlib/selftests/expected_cmptest.teamcity
	tests/auto/testlib/selftests/expected_cmptest.txt
	tests/auto/testlib/selftests/expected_cmptest.xml

Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I4217cc7d840cbae3e3dd28574741544469c4c6b9
2017-11-23 09:36:03 +01:00
Topi Reinio
0817e2a81e Doc: Update the list of highlighted examples
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>
2017-11-22 07:39:53 +00:00
Andreas Hartmetz
eeca8895fc Remove obsolete DBus dispatch lock
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>
2017-11-08 05:38:39 +00:00
Liang Qi
17d5141113 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/plugins/platforms/windows/qwindowswindow.cpp
	tests/auto/widgets/kernel/qaction/tst_qaction.cpp

Change-Id: Ia017a825ed2ca2d53ac586f4ae48df6f65818d40
2017-10-30 08:54:05 +01:00
Friedemann Kleint
5eb508a317 Fix clazy-strict-iterators
Change-Id: I9276a85f0a8061b2636687cf694b8ed1abaa18b8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-10-25 09:19:19 +00:00
Allan Sandfeld Jensen
fa9d12f4a2 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/plugins/platforms/windows/qwindowsmousehandler.cpp
	src/plugins/platforms/xcb/qxcbimage.cpp
	tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/manual/qtabletevent/regular_widgets/main.cpp

Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io>
Done-with: Mårten Nordheim<marten.nordheim@qt.io>
Change-Id: I5b2499513a92c590ed0756f7d2e93c35a64b7f30
2017-10-24 13:40:55 +02:00
Liang Qi
01afc8c810 Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
2017-10-16 22:21:52 +03:00
Jędrzej Nowacki
2d4fe257ca Remove some unused, local variables
Change-Id: I453162d2d396bb3427064d3b1593bb6c71376605
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-14 07:04:39 +00:00
Kai Koehne
f6cca6ab8a Replace 'an unique' with 'a unique'
Unique begins with a "y" sound, hence a unique is correct.

Change-Id: I9eb6b4d4c9ddab45af931e97c041c24edf163eca
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-11 18:44:57 +00:00
Frederik Gladhorn
2b1ab81eda Register QVector with basic DBus types
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>
2017-09-25 12:56:32 +00:00
Kevin Funk
58c14c4a7e Replace Q_NULLPTR with nullptr where possible
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>
2017-09-19 11:53:55 +00:00
Kevin Funk
47c92fbb0b Replace Q_DECL_OVERRIDE with override where possible
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>
2017-09-19 11:53:42 +00:00
Thiago Macieira
883dfb3d15 Merge remote-tracking branch 'origin/5.9' into dev
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
2017-08-08 11:48:10 +02:00
Romain Pokrzywka
02b0f44fab Fix race condition in QDBusAbstractInterfacePrivate::initOwnerTracking()
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>
2017-08-04 18:47:55 +00:00
Oswald Buddenhagen
ee07b912a1 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/plugins/platforms/xcb/qxcbconnection.h
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
	src/plugins/styles/mac/qmacstyle_mac.mm
	src/widgets/widgets/qdockarealayout.cpp
	src/widgets/widgets/qmainwindow.cpp
	src/widgets/widgets/qmainwindowlayout.cpp
	src/widgets/widgets/qmainwindowlayout_p.h
	tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
	tests/auto/other/macnativeevents/BLACKLIST
	tests/auto/widgets/widgets/qmenu/BLACKLIST

Change-Id: Ic8e724b80a65e7b1af25511b0e674d209265e567
2017-08-02 22:52:32 +02:00
Alex Blasche
2e2fa2a283 Fix documentation for QDBusError::Other
Change-Id: I12c29833599793f0d42de6742109926ba78d5a6d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-24 06:14:10 +00:00
Gabriel de Dietrich
d38fe875c7 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
    src/widgets/widgets/qmainwindowlayout.cpp

Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
2017-07-13 16:36:10 -07:00
Kevin Funk
9db09b4700 Fix modernize-use-bool-literals issues
Reported by clang-tidy. Skipped fixes in implementation files, only
changed headers.

Change-Id: I5cfd266b3d4046f90baebc0c538b1b6ab03a02d2
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-07-08 11:49:55 +00:00
Liang Qi
7f269a5db8 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	.qmake.conf

Change-Id: I43531e087bb810889d5c1fbfcdffb29b78804839
2017-07-06 13:54:25 +02:00
David Faure
f7aaff01de Fix Qt5DBusMacros.cmake for CMake 3.9
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>
2017-07-05 17:11:59 +00:00
Friedemann Kleint
9656e972d1 Remove remains of wince in .pro files
Task-number: QTBUG-52590
Change-Id: I444fc9eedc8a8e4ad2ede224d66e7c410bedbb48
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-03 05:32:51 +00:00
Jesus Fernandez
e400b7e326 Ensure QDBusConnectionPrivate pointer initialization
Change-Id: Id7ca5b412462b5d7a18d12f9a227fdf9ef7b2344
Coverity-Id: 180869
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-06-06 20:26:23 +00:00
Lars Knoll
51f095e655 Revert "Merge the QDBusMetaType's custom information to QDBusConnectionManager"
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>
2017-05-17 13:42:47 +00:00
Thiago Macieira
67f466505e Fix some QtDBus crashes during application destruction
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>
2017-05-11 08:35:33 +00:00
Thiago Macieira
daeb334039 Merge the QDBusMetaType's custom information to QDBusConnectionManager
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>
2017-05-11 08:35:24 +00:00
Rolf Eike Beer
6ef07e0902 Qt5DBusMacros: remove intermediate variable
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>
2017-04-11 14:07:29 +00:00
Liang Qi
d51c3ecf8e Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	examples/network/network.pro
	mkspecs/features/mac/default_post.prf
	src/corelib/io/qfilesystemengine_win.cpp
	src/corelib/io/qprocess.cpp
	src/corelib/io/qprocess.h
	src/corelib/io/qprocess_p.h
	src/corelib/io/qprocess_unix.cpp
	src/corelib/io/qprocess_win.cpp
	src/corelib/thread/qmutex.cpp
	src/platformsupport/fontdatabases/windows/windows.pri
	src/plugins/platforms/eglfs/eglfsdeviceintegration.pro
	tests/auto/corelib/io/io.pro

Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
2017-03-13 15:55:44 +01:00
Ulf Hermann
d6330a19b2 Use QT_CONFIG(library) instead of QT_NO_LIBRARY
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>
2017-03-06 11:27:20 +00:00
Marc Mutz
593a707ba3 Remove unused QDBusConnectionPrivate::checkReplyForDelivery()
It's referenced nowhere, and wasn't even implemented.

Change-Id: I3c43c4733f82f98f2af451460270b519474be6ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-01 21:07:14 +00:00
Liang Qi
dd756011da Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	configure.json
	mkspecs/win32-icc/qmake.conf

Change-Id: Ibf40546b024d644c7d9ed490bee15b82597f4d3f
2017-02-08 15:49:18 +01:00
Marc Mutz
dbc3d8e15e Unbreak ubsan developer-build
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>
2017-02-07 08:32:53 +00:00
Alexander Volkov
0e168f2c4e Use nullptr in qDBusRegisterMetaType
... to make user code buildable with gcc [-Werror=zero-as-null-pointer-constant].

Change-Id: Ifef52e406c1f7d5a260612ec27922d1805aea6e2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-02-03 20:24:45 +00:00
Liang Qi
318b58562a Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	.qmake.conf
	mkspecs/common/msvc-desktop.conf
	mkspecs/common/msvc-version.conf
	mkspecs/common/winrt_winphone/qmake.conf
	mkspecs/features/mac/default_post.prf
	mkspecs/features/mac/sdk.prf
	mkspecs/features/qt.prf
	mkspecs/features/uikit/default_post.prf
	mkspecs/features/winrt/default_pre.prf
	mkspecs/winphone-arm-msvc2013/qmake.conf
	mkspecs/winphone-x86-msvc2013/qmake.conf
	mkspecs/winrt-arm-msvc2013/qmake.conf
	mkspecs/winrt-x64-msvc2013/qmake.conf
	mkspecs/winrt-x86-msvc2013/qmake.conf
	qmake/generators/win32/msvc_vcproj.cpp
	src/gui/kernel/qwindowsysteminterface.cpp
	src/network/kernel/qhostaddress.cpp
	src/plugins/platforms/mirclient/qmirclientplugin.cpp
	src/plugins/platforms/mirclient/qmirclientplugin.h
	src/widgets/util/qsystemtrayicon.cpp
	tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
	tools/configure/Makefile.mingw
	tools/configure/Makefile.win32

Done-with: Jake Petroules <jake.petroules@qt.io>
Done-with: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I4be3262d3994e11929d3b1ded2c3379783797dbe
2017-01-25 20:06:06 +01:00
Liang Qi
00935bf8c2 Merge remote-tracking branch 'origin/5.8.0' into 5.8
Conflicts:
	src/gui/painting/qcoregraphics.mm

Change-Id: I4d49535cd75f2cdf0151c1dbff312cce5e159760
2017-01-14 22:02:55 +01:00
Alexander Volkov
dcec1420ea Use QString::asprintf(), QStringBuilder, and the multi-arg overload of QString::arg()
... 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>
2017-01-12 17:54:28 +00:00
Thiago Macieira
9449325f2b Partially revert "Windows: stop using _beginthreadex on regular builds"
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>
2017-01-03 13:28:24 +00:00
Albert Astals Cid
59ae55e12e Q_ENUMS -> Q_ENUM and Q_FLAGS -> Q_FLAG
Change-Id: I3cdc7338354da40ab20bdaeb9d5745264ea27228
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-01-02 10:31:25 +00:00
Robert Griebl
f55db6738b Silence bogus whitespace "errors" from the DBus XML parser
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>
2017-01-02 07:56:29 +00:00
Liang Qi
6755ec891a Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	configure
	qmake/Makefile.unix.macos
	qmake/Makefile.unix.win32
	qmake/generators/win32/msvc_vcproj.cpp
	src/3rdparty/pcre/qt_attribution.json
	src/corelib/io/qsettings.cpp
	src/corelib/kernel/qdeadlinetimer.cpp
	src/platformsupport/kmsconvenience/qkmsdevice.cpp
	src/platformsupport/kmsconvenience/qkmsdevice_p.h
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
	tests/manual/qstorageinfo/printvolumes.cpp
	tools/configure/configureapp.cpp

Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
2016-12-13 09:39:20 +01:00
Jesus Fernandez
3c4febf557 Fix using 0 as null pointer
Fixes: error: zero as null pointer constant.

Change-Id: I850d51075263dac6dd135d3cadc136cbd08b40ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-06 15:32:26 +00:00
Liang Qi
d7e4980132 Merge remote-tracking branch 'origin/5.8' into dev
Blacklist tst_QMenuBar::taskQTBUG46812_doNotLeaveMenubarHighlighted() on macOS.

Conflicts:
	mkspecs/features/mac/default_post.prf
	mkspecs/features/mac/sdk.prf
	mkspecs/features/uikit/default_post.prf
	mkspecs/features/uikit/sdk.prf
	src/angle/src/libEGL/libEGL.pro
	src/platformsupport/fontdatabases/fontdatabases.pro
	src/platformsupport/platformsupport.pro
	src/plugins/platforms/cocoa/qnswindowdelegate.mm
	src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
	src/plugins/platforms/ios/ios.pro
	src/plugins/platforms/ios/kernel.pro
	tests/auto/widgets/widgets/qmenubar/BLACKLIST
	tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp

Task-number: QTBUG-56853
Change-Id: If58785210feee3550892fc7768cce90e75a2416c
2016-11-02 09:24:11 +01:00
Liang Qi
a732576a66 Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	config.tests/win/msvc_version.cpp
	configure.pri
	mkspecs/macx-ios-clang/features/default_post.prf
	mkspecs/macx-ios-clang/features/resolve_config.prf
	mkspecs/features/uikit/default_post.prf
	mkspecs/features/uikit/resolve_config.prf
	src/corelib/io/qsettings_mac.cpp
	src/corelib/json/qjsondocument.cpp
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/cocoa/qnswindowdelegate.h
	src/plugins/platforms/cocoa/qnswindowdelegate.mm
	src/plugins/platforms/ios/ios.pro
	src/plugins/platforms/ios/kernel.pro
	src/plugins/platforms/ios/qiosintegration.h
	src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
	tests/auto/gui/painting/qpainter/tst_qpainter.cpp
	tools/configure/environment.cpp

Change-Id: I654845e54e40f5951fb78aab349ca667e9f27843
2016-11-01 06:02:55 +01:00
Liang Qi
28628a5d5e Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/platforms/eglfs/qeglfshooks.cpp

Change-Id: I483f0dbd876943b184803f0fe65a0c686ad75db2
2016-10-22 21:19:57 +02:00
hjk
983d9e0c1a Fix DBus compilation
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>
2016-10-18 08:04:45 +00:00
Liang Qi
6370c3aa71 Merge remote-tracking branch 'origin/5.6' into 5.7
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
2016-10-13 15:18:02 +02:00
Liang Qi
dfc177e3a9 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	qmake/library/qmakeevaluator.cpp
	(cherry picked from commit 1af6dc2c8fb4d91400fddc5050166f972ae57c9a in qttools)
	src/corelib/kernel/qcore_mac_objc.mm
	src/gui/painting/qcolor.h
	src/plugins/platforms/cocoa/qcocoawindow.mm

Change-Id: I5b3ec468a5a9a73911b528d3d24ff8e19f339f31
2016-10-13 09:49:38 +02:00
Marc Mutz
eade394e99 QtDBus: compile with GCC 7
GCC 7 warns about implicit fall-throughs now.

Fix by adding the missing comments.

Change-Id: I629fb3aced9296c81496f19f6ff78c7a5a12e991
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-12 08:16:49 +00:00
Liang Qi
905329200f Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	src/gui/image/qpixmap.cpp
	src/widgets/kernel/qformlayout.cpp

Change-Id: I8a8391a202adf7f18464a22ddf0a6c4974eab692
2016-10-11 07:40:32 +02:00
Liang Qi
3e71810cf3 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/network/access/qhttpnetworkconnection.cpp
	src/network/access/qhttpnetworkconnection_p.h

Change-Id: I11f8641ef482efa8cee1b79977d19cc3182814b4
2016-10-08 17:15:55 +02:00
Marc Mutz
0f21e0bc19 QDBusDemarshaller: use RAII in duplicate()
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>
2016-10-06 16:39:01 +00:00
Oswald Buddenhagen
0fcd842cec remove unnecessary references to $$QMAKE_CFLAGS_DBUS
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>
2016-10-04 20:21:28 +00:00
Nico Vertriest
fe2ddd8ba4 Doc: bool inline to inline bool
To correct following type of error message:
Cannot find 'isValidPartOfObjectPath(...)' in \fn ....

Change-Id: I25850c69307511dc9a24a0c937fd219d4d3cb084
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
2016-10-04 13:13:09 +00:00
Andreas Wilhelm
cd78457c6d qdbusxmlparser: Enabled error output
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>
2016-09-27 15:48:45 +00:00
Liang Qi
7555a92581 Merge remote-tracking branch 'origin/5.7' into 5.8
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
2016-09-21 11:57:52 +02:00
Liang Qi
d148019f16 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp

Change-Id: I0af32ee55936d523cbd259b6fe82eb9c409f9074
2016-09-16 23:16:25 +02:00
Thiago Macieira
ebf0b12108 Make QDBusConnectionPrivate::relaySignal be called in the right thread
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>
2016-09-16 04:11:54 +00:00
Thiago Macieira
8ceab12814 Fake exporting of the QDBusUtil namespace
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>
2016-09-15 23:12:42 +00:00
Marc Mutz
258e4d05ed QDBusError: don't bother dealing with unusable 'unused' field
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>
2016-09-15 10:10:34 +00:00
Anton Kudryavtsev
6aa935cd92 Use QString::fromLatin1() less to avoid string allocations
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>
2016-09-15 15:55:57 +00:00
Alberto Mardegan
a32217cb55 QDBusServer: delay processing of D-Bus messages
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>
2016-09-06 18:22:58 +00:00
Anton Kudryavtsev
057793a841 qdbusxmlgenerator.cpp: reduce allocations in typeNameToXml()
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>
2016-08-23 05:08:05 +00:00
Oswald Buddenhagen
d314819fc0 Merge dev into 5.8
Change-Id: I41ee7b50534b01cf042bed8bb8824ba2e5026a29
2016-08-22 11:30:01 +02:00
Allan Sandfeld Jensen
9f888d2fde Support C++17 fallthrough attribute
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>
2016-08-19 18:38:53 +00:00
Lars Knoll
60985aa42b Use qtConfig throughout in qtbase
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>
2016-08-19 04:28:05 +00:00
Oswald Buddenhagen
d5dc46d319 employ QMAKE_USE: LIBS += $$QMAKE_LIBS_FOO
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>
2016-08-19 04:26:36 +00:00
Thiago Macieira
6f275a4beb Make sure QDBusConnection::connect() returns false if already connected
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>
2016-08-09 02:41:22 +00:00
Jędrzej Nowacki
33ec04d299 Cleanup QDBusVirtualObjectPrivate
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>
2016-08-04 08:47:40 +00:00
Lars Knoll
24f770ba24 Add qtdbusglobal.h and qtdbusglobal_p.h
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>
2016-07-14 06:06:43 +00:00
Liang Qi
3cb56800d5 Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp

Change-Id: If899cda251b4dc8b8a7c6764520e88ab719737cd
2016-06-17 10:53:42 +02:00
Volker Krause
3726aed788 Add Q_FLAG for QDBusServiceWatcher::WatchMode.
This is needed for generic property access to work correctly.

Change-Id: I76613ace730985001fc5fe1bb1b3fa5c6a8bdf70
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-06-03 09:57:55 +00:00
Thiago Macieira
3ec57107ce Windows: stop using _beginthreadex on regular builds
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>
2016-06-02 22:16:47 +00:00
Liang Qi
56d6e000f7 Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	mkspecs/wince80colibri-armv7-msvc2012/qmake.conf
	qmake/generators/win32/msvc_vcproj.cpp
	src/corelib/global/qnamespace.h
	src/corelib/global/qnamespace.qdoc
	src/corelib/io/qfsfileengine_win.cpp
	src/corelib/tools/tools.pri
	src/network/ssl/qsslconfiguration_p.h
	src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
	src/plugins/platforms/windows/windows.pri
	src/src.pro
	src/tools/bootstrap/bootstrap.pro
	src/tools/uic/cpp/cppwriteinitialization.cpp
	src/widgets/dialogs/qfilesystemmodel.cpp
	tests/auto/testlib/selftests/expected_cmptest.teamcity
	tests/auto/testlib/selftests/expected_cmptest.txt

Change-Id: I4d2ac78f0dcc97f008186bbbc769c6fe588ab0e5
2016-05-23 21:09:46 +02:00
Oswald Buddenhagen
36c025a8d6 Merge 5.7 into 5.7.0
Change-Id: I416c79d9afde98efc9e78b3a74e17dfbb2409602
2016-05-20 19:31:19 +02:00
Marc Mutz
d55f2b1fb9 Revert "QDBusArgument: remove useless op<< overloads"
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>
2016-05-20 07:09:52 +00:00
Liang Qi
818014b449 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	configure
	src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
	src/network/access/qnetworkaccessmanager.cpp
	src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h
	src/widgets/widgets/qlineedit_p.cpp
	src/widgets/widgets/qlineedit_p.h
	src/winmain/winmain.pro
	tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
	tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
	tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h
	tests/auto/testlib/selftests/expected_cmptest.teamcity
	tests/auto/testlib/selftests/expected_cmptest.txt
	tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
	tools/configure/configureapp.cpp

Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
2016-05-19 12:55:27 +02:00
Marc Mutz
c7d4858c92 QDBusArgument: deprecate relying on a streamable Base to stream a Derived
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>
2016-05-15 10:00:19 +00:00
Topi Reinio
72e3fcce38 Doc: Remove repository name from examplesinstallpath
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>
2016-05-12 12:15:52 +00:00
Liang Qi
990969655c Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	config_help.txt
	configure
	src/corelib/io/qprocess_wince.cpp
	src/plugins/platforms/windows/qwindowstheme.cpp
	src/plugins/platforms/xcb/qxcbbackingstore.cpp
	tests/auto/corelib/tools/qtimezone/BLACKLIST
	tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
	tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp

Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
2016-05-12 08:33:08 +02:00
Marc Mutz
e2e0dfee7c QtCore/QtDBus/QtSql: port the last remaining Q_FOREACH loop and add QT_NO_FOREACH
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>
2016-05-11 16:55:37 +00:00
Thiago Macieira
ad66dbe305 Disconnect signals from each QObject only once in QDBusConnectionPrivate
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>
2016-05-09 05:30:46 +00:00
Liang Qi
dbef41f43e Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	examples/qtestlib/tutorial5/containers.cpp
	examples/widgets/tools/tools.pro
	src/corelib/io/qprocess.cpp
	src/corelib/io/qprocess_unix.cpp
	src/corelib/io/qprocess_win.cpp
	src/network/kernel/qdnslookup_unix.cpp
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/testlib/qtestcase.cpp
	tools/configure/configureapp.cpp

Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
2016-05-06 15:36:44 +02:00
Liang Qi
6357813207 Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	configure
	src/3rdparty/double-conversion/include/double-conversion/utils.h
	src/corelib/global/qnamespace.qdoc
	src/corelib/tools/qsimd_p.h
	tests/auto/corelib/io/qfile/tst_qfile.cpp

Change-Id: I3ca1007bab5355d251c13002a18e93d81c254d34
2016-05-03 15:49:15 +02:00
Thiago Macieira
fecaa6aae8 Workaround Windows DLL unload issue with threads running
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>
2016-05-02 20:24:24 +00:00
Liang Qi
4679861105 Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7 2016-05-02 07:03:53 +00:00
Thiago Macieira
fda6324b4d Remove the use of QMutexPool from QtDBus loading of libdbus-1
Change-Id: Ifea6e497f11a461db432ffff1449b013c2302d38
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-04-30 03:00:44 +00:00
Liang Qi
b894a8def5 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	mkspecs/features/qml_module.prf
	mkspecs/features/qt_common.prf
	src/gui/text/qzip.cpp
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/windows/array.h
	src/testlib/qtestcase.cpp
	src/widgets/dialogs/qfilesystemmodel.h

Change-Id: Ie41c5868415b81f7693c80e045497035504bb210
2016-04-29 17:55:20 +02:00
Anton Kudryavtsev
cd1eff1e1e qDBusInterfaceFromMetaObject: avoid quadratic complexity.
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>
2016-04-29 15:44:30 +00:00
Anton Kudryavtsev
c8e4d15004 DBus: use QStringRef to optimize memory allocation
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>
2016-04-28 16:47:54 +00:00
Weng Xuetian
9be4ee5202 QtDBus: finish all pending call with error if disconnected
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>
2016-04-28 05:38:10 +00:00
Liang Qi
23a36fd2bf Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/corelib/io/qprocess_win.cpp
	src/widgets/itemviews/qheaderview.cpp

Change-Id: I0a59ade9cd6e91f770fdf298a7d72a41e79fd761
2016-04-27 09:18:05 +02:00
Peter Wu
1b9d082bb8 dbus: make QDBusArgumentPrivate destructor virtual
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>
2016-04-22 13:46:15 +00:00
Liang Qi
b94773c9c8 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	config.tests/unix/compile.test
	src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
	src/testlib/qtestcase.cpp
	src/testlib/qtestcase.qdoc

Change-Id: Ied3c471dbc9a076c8de33d673bd557e88575609d
2016-04-13 06:55:37 +02:00
Weng Xuetian
b77ef8a7e6 QtDBus: clean up signal hooks and object tree in closeConnection
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>
2016-04-08 16:16:14 +00:00
Lars Knoll
da95152dfb Unify naming of LIBS/CFLAGS for 3rd party libraries
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>
2016-04-07 16:18:03 +00:00
Jani Heikkinen
cd46a2daf5 Unify license header usage.
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>
2016-03-29 10:20:03 +00:00
Liang Qi
6cb8121a44 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/widgets/styles/qgtkstyle_p.cpp
	tests/auto/corelib/io/qtextstream/test/test.pro
	tests/auto/corelib/plugin/plugin.pro

Change-Id: I512bc1b36acf3933ed2b96c00f476ee3819c1f4b
2016-03-21 09:02:57 +01:00
Thiago Macieira
2e02de1651 Fix QtDBus deadlock inside kded/kiod
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>
2016-03-19 17:16:52 +00:00
Frederik Gladhorn
6380cc710e Merge remote-tracking branch 'origin/5.6.0' into 5.6
Change-Id: Iac8ff05cd76cbacf859138a73e8e2ed0a979c75a
2016-03-17 16:02:45 +01:00
Liang Qi
59a3ca679e Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7 2016-03-13 19:27:21 +00:00
Marc Mutz
6417bbde85 QtBase (remainder): use printf-style qWarning/qDebug where possible (I)
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>
2016-03-12 17:29:36 +00:00
Liang Qi
50d0f57b77 Merge remote-tracking branch 'origin/5.6' into 5.7
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
2016-03-11 20:08:50 +01:00
Oswald Buddenhagen
f93032848e Merge remote-tracking branch 'origin/5.6.0' into 5.7
Change-Id: Idcda6d52266f557ce4a819b6669f6797473a48a2
2016-03-07 17:08:56 +01:00
Oswald Buddenhagen
a28364bc1c consistently put {qt,qml}_{module,plugin} at the end of project files
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>
2016-03-07 14:09:49 +00:00
Thiago Macieira
469e293286 Fix crash when a standard bus isn't available
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>
2016-02-25 16:25:29 +00:00
Liang Qi
4fe2fbcf82 Merge remote-tracking branch 'origin/5.6' into 5.7
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
2016-02-18 20:50:35 +01:00
Andreas Holzammer
786d23bb49 Fix dbus wince build
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>
2016-02-05 04:14:28 +00:00
Jędrzej Nowacki
38e602d0f2 Fix QT_DEPRECATED_SINCE usage
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>
2016-02-02 19:24:12 +00:00
Liang Qi
d3e6e732c7 Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	config.tests/unix/compile.test
	src/plugins/platforms/cocoa/qcocoahelpers.mm
	src/tools/qlalr/cppgenerator.cpp

Change-Id: I0103ca076a9aca7118b2fd99f0fdaf81055998c3
2016-02-02 15:57:44 +01:00
Thiago Macieira
ded11c503f QtDBus: Remove unnecessary #ifndef for QT_NO_PROPERTIES
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>
2016-01-30 03:21:12 +00:00
Liang Qi
a15c3d086d Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
	src/dbus/qdbusconnection_p.h
	src/dbus/qdbusintegrator.cpp
	src/dbus/qdbusintegrator_p.h
	tests/auto/corelib/io/qdir/qdir.pro
	tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp

Change-Id: I3d3fd07aed015c74b1f545f1327aa73d5f365fcc
2016-01-26 16:27:28 +01:00
Thiago Macieira
a1ba281a26 Call out to QtDBus message spies in the main thread
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>
2016-01-25 07:32:04 +00:00
Thiago Macieira
cfe891eeb8 Add Intel copyright to files that Intel has had non-trivial contribution
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>
2016-01-21 22:44:21 +00:00
Thiago Macieira
23bd4651c7 Update the Intel copyright year
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>
2016-01-21 22:44:16 +00:00
Jani Heikkinen
f776595cc1 Updated license headers
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>
2016-01-21 18:55:18 +00:00
Jani Heikkinen
1a88b2f768 Updated license headers
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>
2016-01-15 12:25:24 +00:00
Simon Hausmann
9a969182cf Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-13 07:19:44 +00:00
Simon Hausmann
6b8c0a5058 Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: I5839bded07e23af65ced9491c4f50242f964dd31
2016-01-12 11:07:56 +01:00
Marc Mutz
0ea39eb842 QtDBus: eradicate all Q_FOREACH loops
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>
2016-01-12 06:14:43 +00:00
Marc Mutz
a7d631e44b QDBusConnectionPrivate::ObjectTreeNode: remove pointless empty dtor
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>
2016-01-12 06:14:38 +00:00
Thiago Macieira
15b65e7a5f Revert "dbus: Print out 'serial' and 'serial reply to' with DBusMessage operator<<."
This reverts commit d3fe4f066f.
Required to revert the parent commit.

Change-Id: I1039e2ee65c0cd2c3209ea18bd3bd2d84a8daef3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-11 05:20:18 +00:00
Thiago Macieira
71c0bb3fd1 Revert "dbus: Add method serial() and replySerial() to class DBusMessage."
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>
2016-01-11 05:19:41 +00:00
Thiago Macieira
bc108d7c7e Work around GCC 6 warning about offset outside bounds of string
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>
2016-01-08 11:36:13 +00:00
Frederik Gladhorn
ad16478a76 Merge remote-tracking branch 'origin/5.6' into dev
Based on merge done by Liang Qi

Change-Id: Id566e5b9f284d29bff2199f13f9417c660f5b26f
2016-01-08 12:35:24 +01:00
Ralf Habacker
d3fe4f066f dbus: Print out 'serial' and 'serial reply to' with DBusMessage operator<<.
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>
2016-01-07 07:43:16 +00:00
Ralf Habacker
618e2cc081 dbus: Add method serial() and replySerial() to class DBusMessage.
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>
2016-01-07 07:42:35 +00:00
Marc Mutz
5f542f3cca QDBusArgument: remove useless op<< overloads
... 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>
2016-01-03 18:46:27 +00:00
Thiago Macieira
1f6fa1f37a Suspend processing of some messages in the default busses by default
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>
2016-01-02 02:05:45 +00:00
Thiago Macieira
8d195c0d57 Add a default argument to QDBusPendingCallWatcher::finished signal
So we can do
  connect(&watcher, SIGNAL(finished()), receiver, SLOT(foo()));

Change-Id: I39cc61d0d59846ab8c23ffff14241d33fecf2d53
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2016-01-02 02:05:07 +00:00
Thiago Macieira
fd3ea7004d Remove unused member variable QDBusConnectionPrivate::timeoutsPendingAdd
They're never pending, since we add them immediately since commit
186d881440.

Change-Id: I39cc61d0d59846ab8c23ffff14241be6785ad5a0
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2016-01-02 02:05:01 +00:00
Thiago Macieira
83da3e5eda Change a QList of pointers to QVector
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>
2015-12-29 12:31:38 +00:00
Marc Mutz
050b682412 QDBusIntegrator: fix quadratic behavior
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>
2015-12-27 14:25:40 +00:00
Marc Mutz
43d1e61ade [docs] Fix assocated -> associated
Change-Id: Ia828db7bb71b874b19a610439e156687f273290f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-12-15 07:54:40 +00:00
Marc Mutz
51089a5742 Use Q_UNLIKELY for every qFatal()/qCritical()
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>
2015-11-29 22:59:17 +00:00