C ++ Gui Programming with QT3 (Series Two Test)

xiaoxiao2021-03-06  79

It's time to test the program on your machine.First, you will need to install Qt 3.2 (or later Qt 3 release), a process that is explained in Appendix A. From now on, we will assume that you have a correctly installed copy Of Qt 3.2 and That Qt's Bin Directory Is in Your Path Environment Variable. (on Windows, this Is Done Automatically By The Qt Installation Program, SO You "Running the program on your machine It's time. First, you need to install Qt3.2 (or higher), and the installation process will be described in the appendix. Now, suppose you have installed Qt3.2 correctly and add the qt bin directory to your PATH environment variable (the installer will automatically complete this part in the Windows system, do not need you worry).

You will also need the Hello program's source code in a file called hello.cpp in a directory called hello.You can type in hello.cpp yourself, or copy it from the cd provided with this book, where it is available as / examples / Chap01 / hello / hello.cpp In addition, you have to have a hello.cpp file saved under the Hello directory (translation: it is not necessary, just QT project name is the same name with the source file). You can enter the hello.cpp file, or found in the CD provided by this book, his path is /examples/chap01/hello/hello.cpp.from a commnd prompt, change Directory to Hello, Then Typeqmake -Projectto Create A Platform-independent project file (hello.pro), the Then Typeqmake Hello.pro In a command line window, enter the hello directory, then type qmake -project to generate a project file-independent project file (Hello.Pro), then type qmake hello.proto create a platform-specific makefile from the project file.Run make to build the program, and run the program by typeing hello on windows, ./hello on Unix, and open hello.app on Mac OS X. If you using Microsoft Visual c you will need to run nmake instead of make. Alternatively, you can create a Visual Studio project file from hello.pro by typeingqmake -tp vc hello.proand then build the program in Visual Studio. and to create a platform Related Makefile files. Run Make to compile the program. Below you can run the program. Type Hello under the Windows platform, if you are unix, you will knock ./hello, Mac ox x system knock hello.app. If you are using Microsoft's Visual C you can use nmake instead of Make or create a Visual Studio to generate a Visual Studio by typing QMake -tp VC Hello.Pro, you can compile the application in Visual Studio.

转载请注明原文地址:https://www.9cbs.com/read-94467.html

New Post(0)