connect returns boolean value true
if connection was successful.
In addition if connection failed in Qt Creator console you should see a log that there was such error.
You can also add qDebug("Something")
inside saveFileButton
if you have any doubt that debugger works properly.
Why is my Qt signal/slot breakpoint not hit? (signals/slots)
-
03-06-2022 - |
문제
Ok I have Qt-Creator running my app in debug mode. I am able to stop at SOME breakpoints; however, the code I really want to debug is invoked via the signal/slot mechanism as follows:
connect(saveFileButton, SIGNAL(clicked()), this, SLOT(saveParameters()));
I set a few breakpoints in saveParameters() and the breakpoints are never hit.
How can I verify that the saveParameters slot is actually connected to the saveFileButton clicked signal at runtime?
해결책
다른 팁
When you run the application, read the application output. If the connection cannot be made, there will be an error message like this one:
QObject::connect: No such slot MainWindow::saveParameters() in ../test/mainwindow.cpp:39
제휴하지 않습니다 StackOverflow