![]() Check that slots are declared correctly in the appropriate public/protected/private slots sections of your class declaration. You can do this with code like the following:Ĭonnect(this, SIGNAL(mySignal()), qApp, SLOT(aboutQt())) ħ. Check that the signal is being fired as expected. The connect statement should look like this:Ĭonnect(senderObject, SIGNAL(mySignal(const QString&)), receiverObject, SLOT(mySlot(const QString&))) Ĭheck brackets, check that SIGNAL and SLOT are capitalised and that the sender and receiver are both objects, not class names.Ħ. Check that the connect argument types and syntax are correct. ![]() 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).ĥ. ![]() Check that the parameter types of the signal and slot are exactly correct and, as appropriate, that they match.Ĥ. Use break points or qDebug to check that signal and slot code is definitely reached:ģ. Check for compiler warnings about non-existent signals and/or slots.Ģ. Below are some suggestions for troubleshooting signals and slots in the Qt C++ library.ġ.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |