Qt programming (1)

Source: Internet
Author: User

1. How do I know the installation path of QT?

Qlibraryinfo: location. You can query the paths of different QT modules based on parameters, such as the paths of translations and Doc.

2. qdir: fromnativeseparators/qdir: tonativeseparators

These two static methods are ineffective in Unix/Linux. Manually process the path Separator in the path and use the method provided by qstring.

3. qstring cannot be used in STD: cout/STD: cin.

Because the qstring overload <symbol definition is soy sauce purple: qdatastream & operator <(qdatastream & stream, const qstring & string)

Therefore, use the tostdstring of qstring for conversion, such as STD: cout <test_qstring.tostdstring () <STD: Endl;

C ++ <operator heavy load is to look at the type on the left, for example, the cout here is the ostream type, this class will provide a series of operator

Therefore, in this example, ostream cannot handle qstring. In addition, although operator <is overloaded, qstring is used to support qdatastream. Therefore, qstring cannot be used in ostream.

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.