Qt entry notes-for Windows

Source: Internet
Author: User

Qt entry notes-Windows
Favorites

I have been peat QT for a long time, but I have installed a Mac version on even Tom. I do not know the installation configuration in it, I have written several examples on MAC (I will add some precautions for Mac later ).

Install Windows XP as follows:

1. Download QT for open Souce C ++ development on Windows from trolltech official website at: ftp://ftp.trolltech.no/qt/source/qt-win-opensource-src-4.4.3.zip;

2. Decompress to the Directory D: \ QT \ qt-win-opensource-src-4.4.3;

3. Add environment variable qtdir = D: \ QT \ qt-win-opensource-src-4.4.3, set environment variable Path = % qtdir % \ bin; % PATH %;

4. Copy vsvars. bat under the VC installation directory to the qtdir directory and run it once;

4. Run cmd, enter the qtdir directory, and run the following command:

Configure-platform win32-msvc

Run nmake.

Configuration and compilation take a long time.

 

In vs2008, you can directly compile the QT program setting method:

1. Start vs2008 and create a makefile project named helloqt.

 

2. debug configuration parameter settings:

Build command line: qmake-Project & qmake & nmake debug

Clean commands: nmake debug-clean

Rebuild command line: qmake-Project & qmake & nmake debug

 

 

3. Release configuration parameter settings:

Build command line: qmake-Project & qmake & nmake release

Clean commands: nmake release-clean

Rebuild command line: qmake-Project & qmake & nmake release

 

 

4. Select properties under the project in the menu bar.

 

Set $ (targetpath) under command to $ (targetdir) \ debug \ $ (targetfilename ). Make sure that the correct path is executed during F5 debugging.

5. Add the QT Library Under vs2008 with the following settings:

 

 

 

 

6. Add a new project to the helloqt project, select the CPP class file, and name it main.

Write the main. CPP Code as follows:

  1. # Include <qapplication>
  2. # Include <qlabel>
  3.  
  4. Int main (INT argc, char * argv [])
  5. {
  6. Qapplication app (argc, argv );
  7. Qlabel * label = new qlabel ("Hello QT! ");
  8. Label-> show ();
  9. Return app.exe C ();
  10. }

The full text is complete.

Http://blog.csdn.net/aaronkevin021/archive/2008/11/14/3298141.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.