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?

有帮助吗?

解决方案

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.

其他提示

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top