美文网首页
Mastering QtCreator Guide 2020-0

Mastering QtCreator Guide 2020-0

作者: liyangyao | 来源:发表于2020-08-12 10:08 被阅读0次

快捷键

  • F4 切换头文件和源文件
  • Ctrl + function/class 转到定义
  • Ctrl + Shift + V 历史剪切板
  • Ctrl + Shift + (UP/DOWN KEYS) 向上向下移动行
  • Ctrl + ALT + SHIFT + (UP/DOWN KEYS) 多行编辑

提升代码质量

  • 通过clang tidy (c++ issues) 和clazy (Qt issues)检查修复代码

重构

  • 重构变量
    Right click on variable -> Refactor -> Rename. Works with class members and function variables.
  • 自动生成Q_PROPERTY(...) 成员
    Right click on Q_PROPERTY(...) -> Refactor -> generate missing Q_PROPERTY members
  • Switch through all enum values
    Right click on switch -> Refactor-> complete switch statement. (SADLY WONT WORK WITH ENUM CLASSES)
  • 选中的代码提取函数
    Select code, right click -> Refactor -> extract function. Then you can select the function name and the visiblity
  • 实现基类中的虚函数
    Right click on the base class -> Refactor-> Implement virtual functions of base class. Now you can choose which functions to implement and where to put them.
  • 移动所有函数定义
    Right click on your class -> Refactor -> Move all function definitions to (myClass.cpp or outside class)
  • 移动单个函数定义
    Right click on your function -> Refactor -> Move function definitions to (myClass.cpp or outside class)

相关文章

网友评论

      本文标题:Mastering QtCreator Guide 2020-0

      本文链接:https://www.haomeiwen.com/subject/fxkpdktx.html