创建 C++ 类
要为新类创建 C++ 头文件和源文件,以便添加到 C++ 项目中:
- 选择File >New File >C++ Class Wizard >Choose 。
- 指定类名、基类、头文件和源文件。
向导支持命名空间。要使用命名空间,请在Class name 字段中输入限定的类名。例如:MyNamespace::MySubNamespace::MyClass
。向导会在你输入时推荐现有的命名空间和类名。
您也可以创建自己的项目和类向导。
另请参阅 创建文件、设置 C++ 文件命名首选项、使用项目向导和自定义向导。
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.