I started to learn QT these days and installed the qt4 designer. It is said that eclipse can also be used as the QT IDE, so I configured the QT development environment in eclipse (I can't stand the N multiple windows opened by QT designer ).
Then I found an article on the Internet titled using eclipse to develop qt4 C ++ programs
"Unknown.
Problem: when creating a qt gui project, eclipse automatically creates a blank form and generates an executable file. Then, I added several controls following the steps in the above tutorial and then built all. An error occurred:
Description resource path location type
Error: 'ui' does not declare helloworld. h/helloworld line 16 C/C ++ Problem
Description resource path location type
Error: Expected '; 'before' UI' helloworld. h/helloworld line 16 C/C ++ Problem
Description resource path location type
Error: iso c ++ does not allow the declaration of non-type 'helloworldclass' helloworld. h/helloworld line 16 C/C ++ Problem
After several timesExploration
The "ui_helloworld.h" file is found to beBlank
Of! AgainExploration
The file is generated through the helloworld. UI file. The command is as follows:
UIC helloworl. UI-O ui_helloworld.h
Enter the preceding command in the terminal to obtain the following error message:
UIC: file generated with too old version of QT designer
File 'helloworld. Ui' is not valid
In desperation, A helloworld. UI file is generated using qt4 designer and then converted using UIC,No problem!
Compare the helloworld. UI generated by eclipse with the file generated by qt4 designer, and find that the file generated by eclipse has one more line as follows:
<? XML version = "1.0" encoding = "UTF-8"?>
It is observed that the helloworld. UI file generated when the project was just created does not have this line. After each operation such as "add control" and "Modify attribute", this line will be added. So delete it and build all again. No problem! You can also add controls. AlthoughSolution
But before each compilation, You need to delete the first line of the. UI file, which is quite troublesome .. If there are many. UI files, isn't it annoying.It may be a problem with the qt4 version.
, Try upgrading, bless me!
When you upgrade QT to version 4.6 (see eclipse + qt4.6 (Linux)
),Problem Solving
You do not need to manually delete the first line of the. UI file"