TQObject signals/slots do not work with VC++9

Dear you,

      My ROOT version: ROOT 5.34/00 (branches/v5-34-00-patches@44569, Jun 05 2012, 15:31:56 on win32)
      I am working under Win7 with VC++9

I want to use the QT signals/slots method in my program, however I find that this method works only under ROOT. If I use it in a VC++9 compiled version, it do not work.
I just copy the simple ‘class A’ example form the page: http://root.cern.ch/drupal/content/how-use-signalslot-communication-mechanism, and compile it with VC++9.
The dictornary file is generated with rootcint. The ‘libCore’ and ‘libCint’ library is linked.

The output of the compiled version is:

n******* Test of SetValue(Int_t) signal *******n
nt***** b before ******n
value = 10
t***** b after a->SetValue(20) ******n
value = 10

It seems that the signal/slot do not work.

Any help or advise is appreciated!


Are you using Qt & ROOT on Windows? Or do you mean ROOT signal/slots?
Anyway, signal/slots work perfectly well on Windows, since they are used internally by ROOT itself…
Could you provide a minimal working piece of code showing the problem, and what you try to achieve?

Cheers, Bertrand.

Hi Bertrand,
Sorry for not express my question clearly.
I want to use the signal/slot method(use TQObject or RQ_OBJECT()) in a program with is compiled and linked with ROOT libraries by using VC++9. This program ( with main() ) is linked to a STANDALONE .exe file.

And, I find that if I use the ‘TApplication’ in the main() the signal/slot works.
There are 5 files of the simple example.

Thank you.
qtsDict.h (3.09 KB)
qtsDict.cpp (46 KB)
qtsLinkDef.h (50 Bytes)
QTsignal.h (313 Bytes)
QTsignal.cpp (911 Bytes)

Hi Han,

[quote=“handong”]And, I find that if I use the ‘TApplication’ in the main() the signal/slot works.[/quote]Good! So the problem is solved! :slight_smile:

Cheers, Bertrand.