QCoreApplication::aboutToQuit is not a signal
-
Hi
Did you clean the build folder completely and rebuild it?It could be a false positive from clazy.
@mrjj , I just did a clean, then Run qmake, then Rebuild.
Still the same, also there are others in a class I've written clsListener:
class clsListener; typedef std::map<quint16, clsListener*> mpListeners; class clsListener : public QObject { Q_OBJECT private: static mpListeners msmpListeners; static quint16 msuint16NextPort; QTcpSocket* mpClient; QTcpServer* mpServer; quint16 muint16Port; public: clsListener(quint16 uint16Port, QObject* pParent = nullptr); ~clsListener(); static void commonDecode(QAbstractSocket* psckIn); static clsListener* pGetListener(quint16 uint16Port); QTcpSocket* psckClient() { return mpClient; } QTcpServer* psckServer() { return mpServer; } static quint16 uint16NextPort() { return ++clsListener::msuint16NextPort; } quint16 uint16Port() { return muint16Port; } signals: void newConnection(QTcpSocket& robjClient); public slots: void onAcceptError(QAbstractSocket::SocketError socketError); void onDataIn(); void onErrorOccurred(QAbstractSocket::SocketError socketError); void onNewConnection(); };
Now:
QObject::connect(mpobjListener, &clsListener::newConnection ,this, &clsModHelper::onNewConnWithSocket);
The line above also has the same message for the signal newConnection.
The same is true for other classes including QTimer::timeout:
QObject::connect(&mstmrWatchdog, &QTimer::timeout, this, &clsModHelper::terminateModule);
-
hi
Seems the clazy plugin is a bit confused.
They are both private signals but that just means user code cannot emit them, not
that they are not signals at all.
So seems like you got a new version of clazy and it warns about those privat signals. -
hi
Seems the clazy plugin is a bit confused.
They are both private signals but that just means user code cannot emit them, not
that they are not signals at all.
So seems like you got a new version of clazy and it warns about those privat signals. -
@mrjj, thank you, also finding other things along the way which makes me wonder how much testing goes into this before its released? This kind of thing seems pretty fundamental.
@SPlatten
Agreed, but why did you just update Qt Creator?? For precisely this reason, why don't you stick with a stable version of Qt Creator/Qt version and stick with them for a quite a while? If you want to update every time there is a new, latest version, this sort of thing happens.... -
@SPlatten
Agreed, but why did you just update Qt Creator?? For precisely this reason, why don't you stick with a stable version of Qt Creator/Qt version and stick with them for a quite a while? If you want to update every time there is a new, latest version, this sort of thing happens.... -
@SPlatten
:) As you please, just saying this leads to these probs! Anyway, either it's a bug inclazy
, or delete everything in the build output folder, in case there are "hidden"/other files left lying around after "build clean", which is what I do when I don't think an error is mine, and certainly after installing/upgrading anything. -
@SPlatten
:) As you please, just saying this leads to these probs! Anyway, either it's a bug inclazy
, or delete everything in the build output folder, in case there are "hidden"/other files left lying around after "build clean", which is what I do when I don't think an error is mine, and certainly after installing/upgrading anything. -
@JonB , just tried that still exactly the same, did:
ls -la
then remove everything including hidden files.
-
@JonB , today I uninstalled and re-downloaded Qt and installed again, this installed Qt Creator 4.14 by default with Qt 5.15.2, the same problems are still present in this build.
@SPlatten So I had the same issue where clazy would faulty flag
timeout
from QTimer as not a signal, which is of course nonsense.But it somehow went away, and I'm not sure what caused it.
Try one or both of the following:
- Change the kit, it should force a revelation of your code
- Close the project, delete the *.pro.user file, and open it again
-
@SPlatten So I had the same issue where clazy would faulty flag
timeout
from QTimer as not a signal, which is of course nonsense.But it somehow went away, and I'm not sure what caused it.
Try one or both of the following:
- Change the kit, it should force a revelation of your code
- Close the project, delete the *.pro.user file, and open it again
-
@J-Hilk , I did just that, deleted build folders, removed all .pro.user.* files then re-setup project build folders and then rebuilt, unfortunately it still does the same.
Got the same issue with latest Qt Creator on MacOS (with iOS as project target). Clazy constantly complains about emitting and connecting non-signals - both in my own code as well as with signals from Qt classes like QTimer::timeout and so on. Full clean, rebuild from scratch and so on doesn't help.
-
Got the same issue with latest Qt Creator on MacOS (with iOS as project target). Clazy constantly complains about emitting and connecting non-signals - both in my own code as well as with signals from Qt classes like QTimer::timeout and so on. Full clean, rebuild from scratch and so on doesn't help.
-
I'm experiencing this as well.
Could it be related to the updated version of clang included with Xcode 12? In addition to updating Qt Creator recently, I also updated Xcode on my machine (macOS 10.15).
Looks like Qt Creator distributes its own version of clang. I'm assuming this is what the mac kits are supposed to use by default?
-
I'm experiencing this as well.
Could it be related to the updated version of clang included with Xcode 12? In addition to updating Qt Creator recently, I also updated Xcode on my machine (macOS 10.15).
Looks like Qt Creator distributes its own version of clang. I'm assuming this is what the mac kits are supposed to use by default?
@evan_y said in QCoreApplication::aboutToQuit is not a signal:
Looks like Qt Creator distributes its own version of clang. I'm assuming this is what the mac kits are supposed to use by default?
No, that clang version is for the tooling provided by Qt Creator. Qt is not built with it, only the official Apple released Xcode clang is supported.
-
@evan_y said in QCoreApplication::aboutToQuit is not a signal:
Looks like Qt Creator distributes its own version of clang. I'm assuming this is what the mac kits are supposed to use by default?
No, that clang version is for the tooling provided by Qt Creator. Qt is not built with it, only the official Apple released Xcode clang is supported.
-
I've also observed other odd clazy messages:
QString strKey = QString("%1%2").arg(clsJSON::mscszAck).arg(clsJSON::mscszCmdHB);
Results in:
Use multi-arg instead [clazy-qstring-arg]
This is clearly rubbish, because the other arguments in .arg are for formatting the same argument and what I have done works perfectly. I've submitted another bug for this tonight.
-
I've also observed other odd clazy messages:
QString strKey = QString("%1%2").arg(clsJSON::mscszAck).arg(clsJSON::mscszCmdHB);
Results in:
Use multi-arg instead [clazy-qstring-arg]
This is clearly rubbish, because the other arguments in .arg are for formatting the same argument and what I have done works perfectly. I've submitted another bug for this tonight.
@SPlatten What are the types of those clsJSON::mscszAck and clsJSON::mscszCmdHB? If they are both strings, this clazy warning is probably correct because there are overloads with multiple string arguments:
https://doc.qt.io/qt-5/qstring.html#arg-14
Your code should work perfectly as well, but it may be suboptimal.
-
You should read the documentation of the suggested arg overload before opening a report.
-
@SPlatten What are the types of those clsJSON::mscszAck and clsJSON::mscszCmdHB? If they are both strings, this clazy warning is probably correct because there are overloads with multiple string arguments:
https://doc.qt.io/qt-5/qstring.html#arg-14
Your code should work perfectly as well, but it may be suboptimal.
@KoneTaH they are static const char*, the prefix:
m = member
s = static
c = const
sz = null terminated stringclsJSON is the name of the class they belong to. I tried using the multi-arg version, its just not right. As I said, regardless of the message the code works and does exactly what I intended.