Connecting Actions to User defined Slots (I think)
-
Oh I see, I have to create a .pro file and use Qmake to create even my visual studio project,
rather than me creating a VS project myselft.bq. The final step is to set the CONFIG variable. Since this is a Qt application, we need to put qt on the CONFIG line so that qmake will add the relevant libraries to be linked against and ensure that build lines for moc and uic are included in the generated Makefile.
For Visual Studio users, qmake can also generate .dsp or .vcproj files, for example:
qmake -tp vc -o hello.dsp hello.proI will try that, thanks to the tip
-
If you want to work with MSVS, you can use the MSVS integration. That does all the job for MSVS, that qmake does it for all compilers on the command line.
-
Yes I know that. I tryied and it works great altought I did not try adding any user slots yet.
Qt visual studio integration is great, but it does not works with Visual studio express and
the large majority of my users are indies developers that mostly use free development tools like:Visual Studio Express, Linux, CodeBlock, and Xcode in that order.
This is why I want t make the project using just Qt SDK, Qt designer and Visual Studio.
I will try making a Qmake text project to create the Visual studio project, see how that goes. -
[quote author="julio jerez" date="1296503159"]O I see, you mean running qmake to create a makefile.
My impression was that QMake just created a makefile.
Does this mean that the only way to make a QT project is by using Qmake?
I cannot make a project using by hand using Visual studio?
I am not using Qmake, I am using Qdesigner and Visual studio to make project manually.I will read about QMake then and see what I am missing.
[/quote]qmake creates "only" the makefiles, that's true. But it also analyzes the sources and adds the steps for moc if a class contains the Q_OBJECT macro. The moc generated sources are automagically added to the Makefile an link steps etc. If Q_OBJECT is not present, qmake does not generate the moc steps. Thus, if you add Q_OBJECT later on, you must call qmake to catch up the change.
-
[quote author="julio jerez" date="1296508259"]Yes I know that. I tryied and it works great altought I did not try adding any user slots yet.
Qt visual studio integration is great, but it does not works with Visual studio express and
the large majority of my users are indies developers that mostly use free development tools like:Visual Studio Express, Linux, CodeBlock, and Xcode in that order.
This is why I want t make the project using just Qt SDK, Qt designer and Visual Studio.
I will try making a Qmake text project to create the Visual studio project, see how that goes.
[/quote]Qt Creator works with all compiler toolchains (although debugging with the MSVS tools is still suboptimal) ... just a small hint ;-)
-
And QtCreator always calls qmake, so it creates the correct makefiles with the moc steps....
-
[quote author="julio jerez" date="1296508259"]...
Qt visual studio integration is great, but it does not works with Visual studio express and
the large majority of my users are indies developers that mostly use free development tools like:Visual Studio Express, Linux, CodeBlock, and Xcode in that order.
This is why I want t make the project using just Qt SDK, Qt designer and Visual Studio.
I will try making a Qmake text project to create the Visual studio project, see how that goes.[/quote]
MSVS Express is free, that's right, but it's also not complete :-)
The express edition does not support plug-ins. So If you want to use a free tool chain with Qt, I think it would be easier top use QtCreator than using MSVS free edition and always call qmake to create the vcproj files newly after adding a QObject derived class or adding Q_OBJECT macro to a class. -
[quote author="Gerolf" date="1296548656"]And QtCreator always calls qmake, so it creates the correct makefiles with the moc steps....[/quote]
No. Creator only calls qmake if the configuration (.pro and includes) has changed. Just adding Q_OBJECT to any class header does not trigger a qmake run (I just tested this). One can force a qmake run with the context menu on the project tree or from the menu bar, though.
-
Ok, I have no Creator here, thanks for the correction. But it's even much easier than with MSVS express, as you there have to recreate the vcproj and reload it to MSVS.
-
Ok I got it
basically all I need to do is add a rule to each header file that include a Q_OBJECT macror
I added this rule and it seems to work very nice......\sdk\thirdParty\Qt\4.7.1\bin\moc -DUNICODE -DWIN32 ../$(InputName).h -o ../moc_$(InputName).cpp
Thnak every one for the help.
Qt seems very eassy to use and it is awesome.