Set up Qt for Visual Studio 2008

July 24, 2011

My upcoming project will need to work with Qt. Our team have decided to not use Qt Creator for the project. We use Visual Studio 2008 since it is easy to configure and all members are familiar with it. In this post, I will share with you how to configure Qt for visual studio 2008.

Step 1: Make sure Visual Studio 2008 has been updated to SP1. You can download the update file from Microsoft

Step 2: Download and install the latest Qt library for Visual Studio from Qt site

Step 3: Set up Windows Path in Environment Variables

  1. In System Variables, create new variable named QTDIR and its value is the directory which Qt is installed (C:\Qt4.7.3 in my case).

  2. Add ;%QTDIR%bin to the PATH variable.

Step 4: Download and install Qt add-in for Visual Studio from Qt site

That’s all we need to set up Qt for Visual Studio :-). Now you can open visual studio, select New Project…, we can see the Qt4 Projects in the list and choose the type of project we want to create:

QT New Project Screenshot

Then in the next step, we will need to select the Qt libraries to include in the project. Most often we will use GUI library, OpenGL library and XML library:

QT New Project Setup

Visual Studio automatically create the project and configure Qt for you. All you need now is code what you want :-D Hope it will help you!

Discussion, links, and tweets