質問

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