Qt编程习惯(国外英文资料).docVIP

  • 37
  • 0
  • 约1.34万字
  • 约 17页
  • 2017-06-10 发布于河南
  • 举报
Qt编程习惯(国外英文资料)

Qt编程习惯(国外英文资料) Qt programming practice /wiki/Coding_Conventions Wd007 XChinux Trial school: qi liang C + + feature Dont use exceptions Dont use rtti (runtime type recognition; mainly, the typeinfo structure, dynamic or typeid operator, including throwing exceptions, etc.) The use of the template class is carefully used only when required, not just because you have mastered the method. Tip: use the compilers automated test capability to determine whether a c + + feature is supported. The practice of writing the Qt source code All of the code is only in ASCII (seven characters, if youre not sure, run man ASCII) Principle: we already have too many new languages and the unrobust systems of utf-8 and Latin1. When you use a system that is more than 127 in a favorite editor, the system breaks down before you can save it. Low for string: use/NNN (NNN is octal character here, you should input in any system can represent the characters) or use the/XNN (XNN here is hexadecimal characters). For example: reference QString s = QString: : fromUtf8 ( / 213/005 ); For metaphones in documents, or other non-ascii characters, or using qdocs unicode command or using the appropriate macros; Example: use/uuml for u. All subclasses of QObject must contain a Q_OBJECT macro, even if it does not use a signal or a slot, otherwise the qobject_cast will fail. S in the connection statement, the parameters in the normalized signals and slots (can see QMetaObject: : normalizedSignature for standardization of information) to make a fast signal/slot traversal. You can also standardize existing code using $QTDIR/util/normalize Contains the header file In the common header file, the header file contains the form that is always used: reference # include QtCore/q.h For the Mac OS X system framework, a library prefix such as QtCore is required, which is also very convenient for non-qmake projects In the source file, it contains a specific header file and contains the usual header files (such as system fi

文档评论(0)

1亿VIP精品文档

相关文档