Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
Description
I have the following code:
```
QObject::connect(aboutAction, &QAction::triggered, []()
{ QMessageBox msg; msg.setIconPixmap(QPixmap(":/icon.ico")); msg.setWindowIcon(QIcon(":/icon.ico")); msg.setWindowTitle(QObject::tr("About")); msg.setText(QObject::tr("About my program")); msg.exec(); });
```
This code gives me a clazy-connect-3arg-lambda warning, even though the lambda takes no captures, so obviously there can't be a receiving object.
According to https://github.com/KDE/clazy/blob/1.11/docs/checks/README-connect-3arg-lambda.md this warning "is only shown if the lambda body dereferences at least one QObject other than the sender". But in this case the QObject in question is created inside the lambda. So I suggest that this condition should be changed to "is only shown if the lambda body dereferences at least one QObject that has been captured".