Qt entry study Note 1-the first QT Program

Source: Internet
Author: User
Tags gdb debugger

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.