Recently, the latest Windows installation package of qt5.0.1 was installed in Windows 7, You can go to the official QT website http://qt-project.org/downloads. This plugin integrates the qt5.0.1library into mingw4.7compiler into QT creator 2.6.2, which seems to solve the problem that QT creator could not normally use the mingw compiler. After downloading, It will be OK by default, but after installation, there will actually be a 3.68g file, much more than vs2012. Test helloworld Program First, open the menu [file]> [new file or project] (or press Ctrl + n) in QT creator ), select another project> Empty QT project, name it helloworld, and add a helloworld to the project. the C ++ source file of CPP.
Helloworld. cppCodeAs follows:
# Include <qapplication> # include <qpushbutton> # include <qlabel> # include <qhboxlayout> int main (INT argc, char ** argv) {qapplication app (argc, argv ); qwidget * pmainwidget = new qwidget; qhboxlayout * pboxlayout = new qhboxlayout; qlabel * plabel = new qlabel (pmainwidget); plabel-> settext ("Hello world! "); Qpushbutton * pquitbutton = new qpushbutton (pmainwidget); pquitbutton-> settext (" Quit QT! "); Pboxlayout-> addwidget (plabel); pboxlayout-> addwidget (pquitbutton); qsize windowsize (300,200); pmainwidget-> resize (windowsize); pmainwidget-> show (); qobject: connect (pquitbutton, signal (clicked (), pmainwidget, slot (close (); Return app.exe C ();}
The following error occurs after running: qapplication: no such file or directory. It is estimated that the library file corresponding to the corresponding qapplication cannot be found.
I checked through the Internet, basically all of which are solutions for Linux Ubuntu and other versions, as shown in the following csdn blog: Ghost:
Http://blog.sina.com.cn/s/blog_9da24f3b0101epan.html
Solution: add a line of QT ++ = widgets to the helloworld. Pro project file, and then compile and run it.