Signals/Slots stopped working
Hello,
I'm working on an application that uses signals and slots. We are writing our app using Qt 4.1.0 in MS Visual Studio 2003.
My application was working well last week. I had one class that emitted signals that were recieved by another class's slots. It was all very cool and I was happy.
This week our project got split so that my two classes are in different Visual Studio project (.vcproj) files. Now when my one class emits a signal, the other does not pick it up.
If anyone has any ideas about what may have happened and how I could fix this, I would certainly appreciate it.
Thanks in advance,
Jimmy
Re: Signals/Slots stopped working
Add "CONFIG += console" to your .pro file, compile in debug mode and check if there are some messages on the console.
Re: Signals/Slots stopped working
adding that line to the .pro file does not seem to make a difference. there are no additional messages in the output window
Does the .pro file even get used when compiling within Visual Studio?
Re: Signals/Slots stopped working
Quote:
Originally Posted by Jimmy2775
adding that line to the .pro file does not seem to make a difference. there are no additional messages in the output window
Does the .pro file even get used when compiling within Visual Studio?
After you modified the .pro file you did regenerate the Makefiles, didn't you?
Re: Signals/Slots stopped working
Fixed the problem.
In case anyone else encounters this: My signals were in a dll project and slots in the exe. I changed the dll's project config to a static library (.lib) instead and the slots were able to pick up the signals again.
Jimmy
Re: Signals/Slots stopped working
I'm not certain if .pro and makefile are applicable or relavent in this case when the VS compiler is using the .sln and .vcproj files for the build. Am I wrong in that assumption?
Re: Signals/Slots stopped working
Quote:
Originally Posted by Jimmy2775
Does the .pro file even get used when compiling within Visual Studio?
Modifying the .pro file has no effect unless you re-import the project from the .pro file (the Qt-menu in visual studio).
It's profitable to maintain the .pro file, anyway. I don't ever store any visual studio files in version control. I always keep the .pro file up-to-date and keep only "a clean Qt-project" in version control. Actually, I always even open the project in visual studio through the Qt-menu. This way I have a fully working project nevertheless I check it out to a different platform.. You don't have much use for visual studio project files in Linux. ;)
How did you create the connection in the first place?
These aforementioned two classes are now in different projects, but same solution?
Re: Signals/Slots stopped working
That is a good point about maintaining the .pro file. At this point we are only building for Windows, but that will change in time. It is probably wise to be prepared for that :)
Origionally the two files were in the same solution, same project. Now they are in different projects but the same solution. I create the connection between the two in the constructor of the class with the slots. I take a pointer to the signal class as a parameter of the constructor of the slot class.
Re: Signals/Slots stopped working
Ok nevermind, as the problem was already solved while I was still tapping my first post.. :)