Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking all Qt signal/slot connection

we done a lot of namespace refactoring. One big problems for us is now, that we only can check at runtime, if we have wrong signal/slot connections.

Is there a external tool, code analyser or a method, which we can check all signal/slot connection at once?

We think about froglogic squish, but we are not quite sure, if squish can help us in this detailed testing.

Thanks in advance, Lars

like image 812
Lars Avatar asked Dec 07 '10 13:12

Lars


People also ask

Can you connect one Qt to multiple slots?

Just as an object does not know if anything receives its signals, a slot does not know if it has any signals connected to it. This ensures that truly independent components can be created with Qt. You can connect as many signals as you want to a single slot, and a signal can be connected to as many slots as you need.

Are Qt signals and slots thread safe?

It is generally unsafe to provide slots in your QThread subclass, unless you protect the member variables with a mutex. On the other hand, you can safely emit signals from your QThread::run() implementation, because signal emission is thread-safe.

How do I connect Qt signals and slots?

To connect the signal to the slot, we use QObject::connect(). There are several ways to connect signal and slots. The first is to use function pointers: connect(sender, &QObject::destroyed, this, &MyObject::objectDestroyed);


1 Answers

There is a thing, that might be useful for you: Conan 1.0.0:. It works only on qt 4.6 and 4.7. See topic @qtCentre

Also I can recommend you Visual Assist X addIn tool for MSVStudio 200x and 2010 from http://www.wholetomato.com/, which has MANY solutions for refactoring. E.g.: renaming tool:


alt text


If you set checkbox "Comments and Strings" it will also rename this symbol everywhere in your code, in whole solution. So if you had correct connections and just refactoring namespaces and classes, this tool can help you. I hope so.

like image 113
Pie_Jesu Avatar answered Sep 19 '22 21:09

Pie_Jesu