Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Application Development with Qt Creator - Second Edition

You're reading from   Application Development with Qt Creator - Second Edition Design and build dazzling cross-platform applications using Qt and Qt Quick

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher Packt
ISBN-13 9781784398675
Length 264 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (15) Chapters Close

Preface 1. Getting Started with Qt Creator 2. Building Applications with Qt Creator FREE CHAPTER 3. Designing Your Application with Qt Designer 4. Qt Foundations 5. Developing Applications with Qt Widgets 6. Drawing with Qt 7. Doing More with Qt Quick 8. Multimedia and Qt Quick 9. Sensors and Qt Quick 10. Localizing Your Application with Qt Linguist 11. Optimizing Performance with Qt Creator 12. Developing Mobile Applications with Qt Creator 13. Qt Tips and Tricks Index

Debugging Qt's signal-slot connections


What do you do if you think that you've correctly connected a signal to a slot and yet your slot's not being fired?

Here's a bunch of things you can try:

  • Check the compile log for error messages about undefined signals and slots.

  • Check the runtime log for errors on connection. If need be, ensure that the connection succeeds by testing its return value (it should return true).

  • Check to make sure that the connect code, the emit code, and the slot code is reached. (Odds are one of them isn't.)

  • Make sure that you declare the connection as follows:

    connect(sender, SIGNAL(someSignal(type)), receiver,     
            SLOT(received(type)))
  • The signal and slot specifications should have the argument types, but not the arguments themselves. Moreover, you can omit const and the reference specifications in the arguments; the metaobject compiler strips them anyway.

  • Check the parameters of the signal and slot and ensure that they match precisely.

  • Check to be sure that you've...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at R$50/month. Cancel anytime