This blog mainly records three aspects.
1. The configuration of QT Creator in Linux is based on the work of the previous two articles, and some details are configured.
2. Run the applets on the desktop and the Development Board respectively to verify the cross-platform features of QT.
3. Install the development environment in windows. This part is based on QT creator and has the work in Linux. This part is very simple.
1. Configure QT Creator in Linux
Find QT creator from Dash, open it, and you can see the main interface, which is basically the same as that in Windows (the Windows version will be clearly installed later ), in the previous two articles, I have compiled the QT libraries for the x86 and arm platforms in Linux respectively. This section configures the corresponding IDE, is able to develop applications.
On the main interface, choose "Tools"> "options"> "build and run" from the menu bar, as shown in.
As you can see, IDE does not automatically identify the installed QT. This is because, in the absence of system environment variables, you do not know where the program is installed, so you need to manually set it here, manual setting is very simple. You only need to click Add to add the qmake files in the QT installation files of the two compiled versions respectively. Note that the installation files are not the source files that were previously decompressed.
The default installation path is/usr/local/trolltech. There are two folders in this folder. For the specific path, see.
Here we will tell the IDE where to install QT. To compile and develop the SDK, You need to specify the compiler and click the "compiler" tab, as shown in.
As shown in, QT creator has detected the GCC of X86. If we are developing the ARM platform, we also need to specify the cross tool chain for ARM development, my installation path is/usr/local/ARM/4.3.2/bin/. You need to specify the G ++ file, as shown in. After the configuration is complete, click "application ".
After QT and the compiler are specified, You need to perform the next configuration. These tools are combined and click the "build Kit" tab, as shown in.
As shown in, the settings here are also very simple, which is equivalent to setting several solutions, specifying the device type, the compiler version used, and the QT version. Here I configure desktop and arm, corresponding to the PC and the Development Board.
Now, the basic configuration is complete.
2. Use QT Creator for initial development
Next, create a project and click "file"-> "new" in the menu, as shown in. Select application-qt gui application.
Next, enter the project name and select the storage location, and click "Next" to select the build suite. Here, we will select the build suite to use, that is, the one configured above. According to the above configuration, I have two suites here, desktop and arm, which can be changed at the end of this area, so I should select the desktop first. The corresponding debug and release should be kept by default here. Next, keep the default value until it is complete.
After the project is created, the project directory is displayed, as shown in.
The first routine does not add any programs. to make full use of the convenience of IDE design, drag several controls to run them. Double-click mianwindow in the interface file. ui file. Next, you can see the development interface similar to C # In vs. You can select some controls on the left and modify the control attributes in the lower right corner, as shown in, drag out the required controls and make simple modifications.
I have dragged a few examples here. After completing this part, click
Run directly. After the build is complete, the newly designed interface is displayed, as shown in.
We can see that the actual running effect and editing status are slightly different due to font and other factors. The next step is to generate a program that can run on the Development Board. Because the desktop is selected as the Building Suite when you create a new project, you must first change this. As shown in, click "project" -- "add build Kit" and the arm I just set will pop up. The default configuration can be used in the arm build settings, for other options, refer to the desktop options.
It should be noted that in the arm running project, it needs to be deployed to remote running, and there is no deployment here. Therefore, during the editing and building process, it cannot be changed to run directly, click the hammer icon, build, after the build can be in the project folder, as shown in, then the program running on the arm Development Board in the test1-build-ARM-_____ debug folder.
Next, copy the generated executable file to the Development Board for running. Here I am using the NFS mount method and run it through the Super Terminal.
./Test1-qws
To run the program, we need to note that the development board I used is the ok6410 of Feiling, and QTE 4.7.3 has been transplanted above. Although my version is 4.8.4, there is no running problem, for other platforms, You need to first transplant QT, which is not covered in this article. The running effect is as follows:
At this point, the first applet used for running the Development Board will run.
3. Install Qt in Windows
The installation and configuration in Linux are done, and Windows is very simple. In Windows, there are versions for vs2008/2010 and mingw. Although vs2010 is installed on my computer, here we decided to install the mingw version. First download the relevant file ,:
Http://qt-project.org/downloads
It should be noted that the SDK installation packages were available in the early days and are now separate, so you need to download them separately
Qt-win-opensource-4.8.4-mingw.exe
Qt-creator-windows-opensource-2.6.1.exe
MinGW-gcc440_1.zip http://get.qt.nokia.com/misc/MinGW-gcc440_1.zip
If you want to use it in Vs, you can download it.
Qt-vs-addin-1.1.11.exe
Qt-win-opensource-4.8.4-vs2010.exe
Since mingwis not integrated with the qt-win-opensource-4.8.4-mingw.exe installation package, you need to install mingw first. The installation is very simple. You just need to extract it to the specified directory. My path is D:/mingw.
Install qt-win-opensource-4.8.4-mingw.exe, specify mingw as required, and specify the extract directory.
Install qt-creator-windows-opensource-2.6.1.exe.
After the installation is complete, open QT Creator, which is the same as the setting in Linux. Here, you only need to specify the mingw directory and G ++ tool, as shown in, the two interfaces are almost the same, and the following operations are basically the same, but there is no tool chain configured for the ARM platform.
★Emouse Si ruiboke article★Original article reprinted Please note: http://emouse.cnblogs.com