Below are some suggestions for troubleshooting signals and slots in the Qt C++ library.
1. Check for compiler warnings about non-existent signals and/or slots.
2. Use break points or qDebug to check that signal and slot code is definitely reached:
– the connect statement
– code where the signal is fired
– the slot code.
3. Check that the parameter types of the signal and slot are exactly correct and, as appropriate, that they match.
4. Make sure you haven’t added a name to the signal or slot argument: for example, use textChanged(const QString &) not textChanged(const QString &text).
5. Check that the connect argument types and syntax are correct. The connect statement should look like this:
connect(senderObject, SIGNAL(mySignal(const QString&)), receiverObject, SLOT(mySlot(const QString&)));
Check brackets, check that SIGNAL and SLOT are capitalised and that the sender and receiver are both objects, not class names.
6. Check that the signal is being fired…
View original post 352 more words