Results 1 to 19 of 19

Thread: The How-To Guide: Qt4 with Visual Studio 2008

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2006
    Posts
    86
    Thanks
    6
    Thanked 14 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Post The How-To Guide: Qt4 with Visual Studio 2008

    I've been working on a senior design project that uses Qt and VS2008. I didn't like the "free" ways that were present for using Visual Studio with Qt4, so I devised a custom build rule file and a few helper programs to make development much easier. I decided that in true open-source spirit, I should share my findings with the rest of the world.

    Attached is a zip file containing a detailed How-to of how to go about setting up your environment and how to setup a Visual Studio 2008 project from start to finish that utilizes my build method. Also in the zip file is a completed project example following the how-to, the two helper programs (autoMoc and autoUic) including their source code and the Visual Studio build rule file.

    The How-To is a bit lengthy, I tried to cover everything I could think of including potential pitfalls, so grab your favorite caffeinated drink before you begin reading!

    You can either follow the guide or use the example project to see how to setup your project. I hope this is able to help a few of you out there, I've found it to be incredibly useful.

    The advantage that my build method has is that it lets Visual Studio manage the project files. The only time you need to do anything "manual" is the fist time you make a header file with the Q_OBJECT macro, you'll need to add the generated .cpp file to your project. Other than that, the autoMoc and autoUic programs together with the build rule file will run Trolltech's Uic.exe and Moc.exe on the files that need them and only when those files have changed since the last time they were Moc'd or Uic'd.

    If you have any comments, suggestions, questions, post them here!

    Happy coding ;p
    Paul

    Updated Jan 21.2008
    1) Fixed an issue where spaces in the project path or build utility
    path would fail. Thanks to "chty" for this find and fix.
    2) Added in support to handle Qt resource files. The generated file
    appears in the Generated folder.
    3) Fixed a problem that could arise if the user cleaned the solution
    and the generated files were deleted, but the build utilities believed
    all files were up to date.

    Hopefully I'll find the free time to make an article on the Qt Wiki
    site. Until then, please refer to the readme.rtf file in the archive.
    Attached Files Attached Files
    Last edited by wysota; 22nd January 2008 at 01:05. Reason: User request, replaced attachment, new content added

  2. The following 10 users say thank you to thomaspu for this useful post:

    7thachmad (27th July 2011), abrou (12th August 2008), antia (21st January 2008), chty (18th January 2008), dc880 (31st December 2007), fanat9 (2nd August 2008), Flank4 (19th March 2010), Gira-X (2nd February 2011), Sormy (14th January 2008), The Storm (8th January 2008)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.