Introduction to Qt Pro

Learning from: http://www.360doc.com/content/16/1003/17/33450894_595526054.shtml

In Qt, using pro files, you can qmake into makefiles;




1: Do you want to know what template is?


template tells qmake what kind of makefile to generate;


1.app creates an app for an application, this is the default value, if not specified, use this


2.lib to create a library makefile


3.vcapp to create an application's visualstudio project file;


4. vclib creates a visualstudio project file for a library;


5. subdirs This is a special template that creates a makefile that can enter a specific directory and generate a makefile for a project and invoke make for it
.


Two: To know what distdir is?


distdir += .../bin specifies the directory where the generated application is placed.






Three: Do you want to know what the generated application name is?


target = pksystem


four: to know what config is?


config += Qt warn_on release;


note
:
The "+=" here is because we add our configuration options to any one that already exists. This is safer than using "=" to replace all options already specified. The
1.qt section tells qmake that the application is built using qt.
This means that qmake will consider the qt library when linking and adding the required include paths for compilation .


2. The warn_on part tells qmake to set the compiler to output warning messages;


3. The release part tells qmake that the application must be compiled as a released application. During the development process, programmers can use debug to replace
release;






4. To know the storage directory of the specified target (obj);
objects_dir + = ..../tmp




5. To know the relevant paths contained in the header file:


includepath+=.


6. To know the encoding method of the source file
codecforsrc = gbk


7. To know the header files, ui files, source files included in the project file, resource file


heads += include/painter.h


forms += forms/painter.ui


source +=sources/main.cpp sources/painter.cpp


resource += qrc/painter.qrc






Eight. To know the various paths:


libs +=
release:libs +=
debug:libs +=
defines += || #ifdefine xxx_xxx_xxx //Define compilation options
rc_file =




IX. The processing of platform dependencies is processed
according to the platform on which qmake runs, using the corresponding scope, A simple scope for a platform-dependent file added for the Windows platform
looks like this:


win32{
source += hello.cpp


}


------------------------------------------------- --------------------------------
When you have built your project file, it is very easy to generate makeflie, all you need is All you have to do is first find the generated project file and enter:


makefile can be generated from a ".pro" file like this:


qmake -0 Makefile hello.pro


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324894017&siteId=291194637