Mark the whole repo with QT_NO_CONTEXTLESS_CONNECT

By adding it to the default build flags via .cmake.conf.

This disables the 3-arg QObject::connect() overload:
QObject::connect(sender, signal, functor)

For details see:
https://lists.qt-project.org/pipermail/development/2023-July/044141.html

Task-number: QTBUG-116296
Change-Id: I0a8bd4fe7b37b96b5a50c539fe21c1fe65860d73
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Ahmad Samir 2023-07-14 15:55:56 +03:00
parent 1a8f794782
commit ed89905ad2
3 changed files with 6 additions and 3 deletions

View File

@ -4,3 +4,4 @@ set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_LEAN_HEADERS=1")
list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1")
list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1")
list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_CONTEXTLESS_CONNECT=1")

View File

@ -103,7 +103,8 @@ std::shared_ptr<QGrpcCallReply> QAbstractGrpcChannel::call(QLatin1StringView met
const QGrpcCallOptions &options)
{
auto channelOperation = std::make_shared<QGrpcChannelOperation>(method, service, arg, options);
QObject::connect(channelOperation.get(), &QGrpcChannelOperation::sendData, []() {
QObject::connect(channelOperation.get(), &QGrpcChannelOperation::sendData,
channelOperation.get(), []() {
Q_ASSERT_X(false, "QAbstractGrpcChannel::call",
"QAbstractGrpcChannel::call disallows sendData signal from "
"QGrpcChannelOperation");
@ -128,7 +129,8 @@ QAbstractGrpcChannel::startServerStream(QLatin1StringView method, QLatin1StringV
QByteArrayView arg, const QGrpcCallOptions &options)
{
auto channelOperation = std::make_shared<QGrpcChannelOperation>(method, service, arg, options);
QObject::connect(channelOperation.get(), &QGrpcChannelOperation::sendData, []() {
QObject::connect(channelOperation.get(), &QGrpcChannelOperation::sendData,
channelOperation.get(), []() {
Q_ASSERT_X(false, "QAbstractGrpcChannel::startServerStream",
"QAbstractGrpcChannel::startServerStream disallows sendData signal from "
"QGrpcChannelOperation");

View File

@ -73,7 +73,7 @@ QGrpcStatus QGrpcCallReply::waitForFinished() const
{
QEventLoop loop;
QGrpcStatus status;
QObject::connect(this, &QGrpcCallReply::errorOccurred,
QObject::connect(this, &QGrpcCallReply::errorOccurred, this,
[&status, &loop](const QGrpcStatus &error) {
status = error;
loop.quit();