Eike Ziller

Qt Creator 4.6 Beta released

Published Wednesday February 7th, 2018
50 Comments on Qt Creator 4.6 Beta released
Posted in Dev Loop, Qt, QtCreator, Releases

We are happy to announce the release of Qt Creator 4.6 Beta!

C++ Support

The possibly most noteworthy and least directly visible change is that we upgraded the backend for the Clang code model from Clang 3.9 to Clang 5.0. This enables support for many C++17 features that were not available in Clang 3.9. The Clang code model is not used by default. Open Help > About Plugins (Qt Creator > About Plugins on macOS) and turn on the ClangCodeModel plugin to enable it.

Another feature that is not visible until you enable it, is the new option to integrate Clang-Tidy and Clazy warnings into the diagnostic messages that you see in the C++ editor. Go to Options > C++ > Code Model > Clang Code Model Warnings, create a copy of one of the presets, and choose the checks that you want to be performed.

The informational tooltips on symbols are now generated from information from Clang instead of the built-in model (if you enabled the Clang code model). It now resolves auto to the actual type and shows template parameters for template types. It shows the first or the \brief paragraph of a documentation comment, too.

We also added separate highlighting of function definitions and fixed some issues with saving header files on Windows while Clang has a grip on them.

Navigation

We added 3 more filters to Locator. Type “b<space>” to jump to a bookmark, filtering on file name and notes. The other two are not directly related to navigation but nevertheless useful.
The filter “t<space>” triggers an item from the main menu. You can either use the display name of the item to locate it, or parts of the menu path leading to it. For example “t sess expe” could be used to trigger the menu item File > Sessions > Experimental Stuff.
Use “=<space>” to evaluate simple ECMAScript (JavaScript) expressions. You have all functionality from the ECMA-262 specification at your disposal, and for convenience, we also added the functions from the Math object as global functions (so you can write “max(1, 2)” instead of “Math.max(1, 2)”).

We continued the work on the File System navigation pane that we started with 4.5. It now has breadcrumbs for the file path at the top, and we added actions for adding, removing, and renaming files to its context menu.

Model Editor

Thanks to Jochen, the original contributor to the model editor, it received a big update in this release. It now supports text alignment and multi-line object names. You can export only selected elements or the whole diagram to images. A wider range of panes now supports drag & drop of items. Enable the model editor by enabling the plugin in Help > About Plugins (Qt Creator > About Plugins on macOS).

There have been many more improvements all over Qt Creator. Please have a look at our changelog for a more detailed overview.

Get Qt Creator 4.6 Beta

The opensource version is available on the Qt download page, and you find commercially licensed packages on the Qt Account Portal. Qt Creator 4.6 Beta is also available under Preview > Qt Creator 4.6.0-beta1 in the online installer. Please post issues in our bug tracker. You can also find us on IRC on #qt-creator on chat.freenode.net, and on the Qt Creator mailing list.

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in Dev Loop, Qt, QtCreator, Releases

50 comments

Peter says:

Can we have a code minimap in Qt Creator? All other ~~cool kids~~ IDEs seem to have one.

Alex says:

I guess code minimap goes against QtCreator ideology (and tabs as well). QtCreator encourages command navigation and not visual navigation. In my opinion command navigation is the right way to go for software developers.

Jason says:

Minimaps are not the most efficient use of space. What they attempt to do is show you where you are in the file, but they do it at great cost to horizontal and vertical space.

It would be better to use better navigational features.
I rather like decorated scrollbars.
In fact, I’ve been arguing for the output and help panes to have search hit markers for some time. Maybe they could have function markers too, with function name on hover?

HGH says:

Don’t tell me what I like or what I don’t like. If you don’t like it – turned it off! I like it and I want it!

blsd says:

Then simply sit down and implement it yourself, plugins are supported…

Markus says:

I really like the clazy and clang-tidy integrations! Is there a possibility to run these checks over a whole project?

Eike Ziller Eike Ziller says:

Currently not.

Jakub Narolewski says:

That would be an awesome functionality :]

Nikolai K. says:

Yup, that’s on our to-do list.

Nick says:

Thanks for consistently making betas and RCs available through the online installer too. Makes it very easy to test out the new stuff.

Now to the obligatory question 🙂

Is clazy and clang-tidy bundled? I build clazy from Git (checking out the latest release tag). Will Creator use the local install of it? Currently I’m on 1.3, but if 1.4 comes out and I install it into /usr/local, will Creator see that?

Eike Ziller Eike Ziller says:

They are bundled with the libclang that we ship. So you’d need to build and replace that.

ph03 says:

When enabling the clang code model plugin the clang-tidy options are all grayed out – what am I missing? I also have the `clang-tidy-5.0` executable installed system-wide.

Josef says:

You literally have to do what the blog post above says:

“Go to Options > C++ > Code Model > Clang Code Model Warnings, create a copy of one of the presets, and choose the checks that you want to be performed.”

The create a copy part is crucial.

Nick says:

I suppose there’s no plans currently to switch to clangd?

“Clangd is an implementation of the Language Server Protocol leveraging Clang. Clangd’s goal is to provide language “smartness” features like code completion, find references, etc. for clients such as C/C++ Editors.”

This should in theory mean we’re not limited to the bundled clang version.

Nikolai K. says:

> I suppose there’s no plans currently to switch to clangd?
> This should in theory mean we’re not limited to the bundled clang version.

clangd is under heavy development. As far as I see, it does not integrate tidy/clazy. It can be used with Qt Creator once Qt Creator comes with a LSP client implementation 🙂 Currently that’s not the case, but it certainly makes sense so we can support other languages more easily.

Note that you can always build Qt Creator against a higher clang version than we ship.

Kai Mast says:

Hope there will be a meson plugin soon? 🙂

piomiq says:

Do you work on semantic highlighting of source code?
Or do you have this feature in plan/list todo?

Nikolai K. says:

What exactly is “semantic highlighting of source code” for you?

Roman says:

Great build! C++11 autos are finally working. And it is now possible to create files in File System view.

Cristian says:

Not any more CMake improvements? Batch editing of options would appreciated. Deployment support would be appreciated. Some more love to the CMake intellisense would be appreciated. Oh well.

Vilya Harvey says:

I really like the sound of those Locator additions. In my opinion the Locator is the single most useful feature of QtCreator and this will make it even better!

Mikołaj says:

Are issues with constantly crashing generic project fixed already or it’s as much unusable version as 4.5 (there were a bug filed but I not able to find it now)?
Other feature sounds really awesome but unfortunately it means nothing if QtCreator is crashing at loading the projects.

Mikołaj says:

Tested already: sadly it’s unusable. It crashes with my session where are many 101 projects loaded.

Eike Ziller Eike Ziller says:

The fix should be in more recent snapshots http://download.qt.io/snapshots/qtcreator/4.6/4.6.0-beta1/

Ivan says:

Hi there! Can somebody explain how breakpoints commands work?
breakpoint -> Edit Breakpoint Properties -> Advanced -> Commands

Roman says:

I’ve noticed that QtCreator sometimes freezes for 5-10 seconds. Is it possible in Qt event loop to somehow report which handler freezes ui?

QBS User says:

Thank you for release. But what about cmake?
I can’t use C++11,14 or 17 by using flags : set(CMAKE_CXX_STANDARD 14) any flag returns 199711.
Of course in QBS and QMake works great and there is no any problem.

Eike Ziller Eike Ziller says:

Seems to work fine here (with CMake 3.9). __cplusplus looks correct depending on which CMAKE_CXX_STANDARD is set.

HGH says:

I tried the Clang code model (again) in Qt Creator 4.5 but it produces so much noise – especially in the Windows headers that I switched it off immediately.
Will you be upgrading the default code model to C++17?

Also when upgrading Qt Creator outside of a official Qt release the installation seems to get borked down every time and a clean re-install is required to get it working properly.

HGH says:

BTW. Why bother with 32bit in 21st century?

Eike Ziller Eike Ziller says:

“Will you be upgrading the default code model to C++17”

If you mean the “built-in” model (i.e. not Clang-based), then, no, this will stay mostly as is. Our focus is on improving the Clang based model and implementing features there that currently are still based on the built-in model even if you turn the Clang code model plugin on.

HGH says:

Most of the things that were an issue in Qt 4.5 seem to be gone with Clang 5.0 code model. You also advertise C+17 support but it is not enabled by default and there isn’t an option to do it easily. One has to know the Clang switches to do that by hand. You need to add an UI option or just enable it by default.
If you don’t plan to upgrade the built-in code model you should really try to upgrade the Clang code model more often to keep with the C++ standards (even if they are in development) and improve performance. Please test Qt Creator on the lowest possible CPU supported as typing speed sometime seem to stutter sometimes!

Eike Ziller Eike Ziller says:

“You also advertise C+17 support but it is not enabled by default and there isn’t an option to do it easily”

The code model gets that information from the project’s compiler flags, i.e. if your project is built as C++17, the code model will/should use C++17. Which kind of project are you using in Qt Creator (qmake/qbs/cmake/…)?

HGH says:

It is a QBS project.

Eike Ziller Eike Ziller says:

Qt Creator picks it up from your project files. For Qbs you need to set ‘cpp.cxxLanguageVersion: “c++17″‘ (http://doc.qt.io/qbs/cpp-module.html) to compile your project with C++17 enabled. You also need to use a compiler that actually supports C++17. The code model supports pure “language features” (like nested namespaces) in itself, but for features in the std lib it still needs to find the corresponding headers from the compiler that you specify (e.g. for std::optional, the compiler must provide the include).

blsd says:

I’m aware that this might not be the right place to post this, but anyways:

I’m having a cmake based project with the clang code model enabled and the C++17 standard enabled by setting the CMAKE_CXX_STANDARD and still some features don’t seem to work, e.g. finding symbol under a nested namespace, invoking “find usage” on it doesn’t work either. Is there something we’re missing here?

HGH says:

Well that’s exactly what I did. And the compiler is MSVC 2017 but I still had to add: -Wno-c++17-extensions to get rid of the warnings. I have structured bindings and if-s with initializers in my code. The code compiles but without the above option I get warnings.

Eike Ziller Eike Ziller says:

Please create a bug report on https://bugreports.qt.io/projects/QTCREATORBUG , so we can investigate your issue.

HGH says:

I also see errors in Qbs projects:
Invalid propety name “qbs”. (M16)
Unknown component. (M300)

These errors are reported in Qt Creator 4.6 but are not present in Qt 4.5.

ehsan says:

GNU Debug server does never can pause on “Android” projects and I did not find any fix for that in change log ?
It kind of ignores all manually entered commands in Qt Creator too ?

Nick says:

I now tried the clang-tidy options. It’s too slow to be practical. I enabled the bugprone, cppcoreguidelines, modernize, performance and readibility checks. This makes it impossible to actually write code using auto-complete. Pressing ‘ . ‘ for example to get struct members listed results in a delay of about 5-7 seconds or even more.

Boris says:

Yes, I saw that too. It is unusable on our project and work (it is quite huge, so I don’t know how to report a bug about it – QtCreator 4.6 works on small projects). Previous version works just ifne.

HD says:

Thanks for the beta release. Looking forward to the excellent C++ features! This is by far my favourite IDE editor for C++, and I appreciate you’re keeping it open source.

Thoughts after testing the 4.6: is it possible to disable the breadcrumbs or move it to the bottom of the side pane? Because as it is now, it expands from e.g. 1 to 2 lines when the path grows long enough, causing a jump in file view. This is very annoying when selecting a file, only to realize that the file is suddenly located below the mouse pointer because the breadcrumb view expanded in height.

Eike Ziller Eike Ziller says:

“causing a jump in file view”

This only happens if it really can not scroll, and then only after a delay. If the view can scroll, it automatically scrolls to keep the items where they were before. If the automatic scrolling fails to work for you, please create a bug report. We can also check increasing the timeout for the re-layouting in case it cannot scroll. An option for hiding it would also be possible (as an item in the filter tool button). If we’d add the option to move it to the bottom, we’d need to invent a similar mechanism for the case where the user clicks on an item near the bottom of the view, so it would end up being similarly ugly just for other cases.

Jonayanv says:

What about llvm master branch ? Is that is supported since this release and compilable?

Rafal Dembek says:

Cool, but after enabling all the neat stuff in a large project the clangbackend is consuming 100% of just a single core. This hurts the responsiveness of auto-completion. Can we have clang-tidy / clazy run in distinct threads ?

Michael Cox says:

Any plans to add GammaRay to Qt Creator?
If not, can it be added to the wish list please?

@Michael: This is available as part of Qt Automotive Suite: https://doc.qt.io/GammaRay/gammaray-qtcreator.html

Commenting closed.

Get started today with Qt Download now