문제

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