Subnavigation

Qt Creator 4.14: What's new in C++ support?

As announced earlier, we have released Qt Creator 4.14 this week. While a full change log is available, I think it's worthwhile to take a closer look specifically at some of the improvements to our C++ support.

Color-coded search results

When collecting usages of a variable via the "Find References to Symbol" action, one is often interested in the type of usage, for instance whether the variable is read or written. This information is now much easier to spot at first glance, because we analyze the context of each usage and use different colors in the search result window  depending on the type of access. As usual, the colors can be customized in the text editor settings.

usages

Automatic invocation of clang tools

Qt Creator 4.14 brings back the possibility to let the clang-tidy and clazy tools run automatically on the current document. This feature had already been present in earlier versions, but caused unwanted side effects and therefore got removed at some point. It is now back with an improved back-end that does not slow down the code model anymore. Of course, it is still possible to explicitly invoke the analyzers for the whole project (or selected parts thereof) via the "Debug" pane.

clazy

New Quickfixes

  • It is now possible to create implementations for all member function declarations of a specific class in one go.imp-from-decl
  • Similarly, you can now create getters and/or setters for all class members at once.getters-setters
  • In some coding conventions, using-directives are frowned upon. These can now be removed (while keeping the code valid, of course). Thanks to Leander Schulten for this contribution.remove-using
  • Missing class members can now be created on demand from a point of use. This is currently limited to initializations inside a constructor.member-from-init

Other improvements

  • We now detect if a completion request happens at the second argument of a connect() call and in that case offer only signals, as nothing else can legally appear there.connect
  • The "New C++ Class" wizard now has knowledge about the code model and can provide completion for namespaces and class names (when choosing a base class).new-class-wizard
  • When renaming a header file via the project tree, its include guards are automatically adapted (thanks to Miklós Márton for this contribution).
  • In addition to new features such as the ones mentioned above, we also fixed about 50 bugs in areas such as highlighting, completion and refactoring.
  • The official release now ships clang 11, which should result in improvements particularly with modern code bases.

Conclusion

Qt Creator 4.14 comes with noticeably better C++ support, due to a number of useful new features and fewer bugs. Upgrade now for  an improved developer experience. 


Blog Topics:

Comments