Download and install the qt sdk. The IDE looks very good. Select the Vim (dark) style and it is suitable for long-term reading.
[1. Hello word]
// Create the qt gui Program # include <qtgui/qapplication> # include <qlabel> int main (INT argc, char * argv []) {qapplication A (argc, argv ); // start // label qlabel * label = new qlabel ("Hello, world! "); Label-> show (); Return a.exe C (); // end}
[2. Embed HTML to draw color text]
# Include <qtgui/qapplication> # include <qlabel> # include "mainwindow. H "int main (INT argc, char * argv []) {qapplication A (argc, argv ); // start // parse HTML to draw a color-based label qlabel * label = new qlabel ("<H2> <font color = 'red'> Hello </font>, world! <H2> "); label-> show (); Return a.exe C (); // end}
[3.advantages and disadvantages of QT creator]
After using QT Creator for a short period of time, it is compared with developing C # In vs2010:
// QT Creator disadvantages: // cannot be automatically added by the class include // Compilation speed is too slow, far lower than C #, or lower than the MFC // F1 annotation only English version ,. net indicates very detailed // The refactoring function is too weak // when the folder is moved to another path, the compilation temporary file is still in the initial path // if the project path contains Chinese characters, compilation error // The project cannot be renamed in the IDE // compared with C #, it is difficult to obtain the error code location from the debugging feedback // The ability to format the code is not strong, some do not follow the template formatting // automatic prompt must input consecutive letters. MessageBox cannot be MB simplified // GDB debugger and IDE easy to crash // standard controls are in English ,. net is determined according to the operating system language // The Chinese character string needs to explicitly specify the encoding, otherwise garbled code will appear // if only the program for debugging is closed without manually clicking stop, it is very likely that the operation will fail later.
// Advantages // embedded HTML supports HTML parsing // built-in Opengl and other Class Libraries