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

Friday December 18, 2020 by Christian Kandeler | Comments

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 inthe type of usage, for instancewhether 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 anduse different colors in the search result windowdepending onthe type of access. As usual, the colors can be customized in the text editor settings.

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, butcaused 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.

New Quickfixes
  • It is now possible to create implementations for all member function declarations of a specific class in one go.
  • Similarly, you can now create getters and/or setters for all class members at once.
  • 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.
  • Missing class members can now be created on demand from a point of use. This is currently limited to initializations inside a constructor.
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.
  • 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).
  • 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.

Share with your friends

Blog Topics:
  • C++
  • Clang
  • Qt Creator 4.14

Attachments

  • Original document
  • Permalink

Disclaimer

Qt Group Oyj published this content on 18 December 2020 and is solely responsible for the information contained therein. Distributed by Public, unedited and unaltered, on 18 December 2020 16:38:00 UTC