QT UI program uses Linux files to manipulate open, close

Source: Internet
Author: User

Original address: QT UI program uses Linux files to operate open, close Kjpioo

This problem is raised because the close () function will conflict with qwidget::close () in the Qwidget type of Qt object, and if you use close () directly when the class function is implemented, you will be prompted for the error when the program compiles (specifically what errors do not remember).

The reason for the error is that Qwidget::close () has an ambiguity with the close () of the file closing standard function in stdio.h. So you can refer to the solutions in the links below.

Http://bytes.com/topic/c/answers/856501-use-close-int-unistd-h-qt

In addition, Lin Rui's high quality C + + programming, v1.0 P58, describes how to use global functions in a class when global functions and class member functions have the same name:
Regardless of whether the parameters of the two Print functions are different, if a member function of the class is to call the global function print, in order to distinguish it from the member function print, the global function is called with a ': ' Flag. Such as
::P rint (...); /indicates that Print is a global function and not a member function http://blog.chinaunix.net/uid-12461657-id-3038105.html

QT UI program uses Linux files to operate open, close (go)

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.