Pregunta

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?

¿Fue útil?

Solución

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.

Otros consejos

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
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top