clazy-lambda-unique-connection fails with Qt 6(.7)
Try the following code and lazy (with qt creator) will give you 2 warnings while this is wrong:
#include <QCoreApplication>
class Toto : public QObject
{
public:
Toto() = default;
void mySlot() {qDebug() << "toto"; }
};
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
Toto t;
{
QObject obj;
QObject::connect(&obj, &QObject::destroyed, &t, &Toto::mySlot, Qt::UniqueConnection);
QObject::connect(&obj, &QObject::destroyed, &t, &Toto::mySlot, Qt::UniqueConnection);
}
return app.exec();
}
Edited by Thierry Bastian