Eike Ziller

Qt Creator 4.6.0 released

Published Wednesday March 28th, 2018
64 Comments on Qt Creator 4.6.0 released
Posted in Biz Circuit & Dev Loop, Qt, QtCreator, Releases

We are happy to announce the release of Qt Creator 4.6.0!

C++ Support

C++ is changing a lot these days, and to catch up with these developments we upgraded the backend for the Clang based code model from Clang 3.9 to 5.0. This enables support for many C++17 features that were not available in Clang 3.9. Since the ClangCodeModel plugin is not enabled by default, you have to make sure to enable it in Help > About Plugins (Qt Creator > About Plugins on macOS), to benefit from this upgrade.

Diagnostics and fixits in Qt Creator by clang-tidy and clazy

In the animation above you see our new integration of Clang-Tidy and Clazy warnings into the diagnostic messages in the C++ editor. Since some checks can be time consuming, and other checks can produce false positives to varying degrees, they are not enabled by default. To enable them 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.

If you enable the Clang code model, that is now also used for the informational tooltips on symbols in the editor. They now resolve auto to the actual type and show template parameters for template types. They show 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 Something.
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 offers 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, the model editor received a big update in this release. First of all we removed the experimental state and made it available by default. We cleaned up the UI a bit, adding the zoom actions to the editor tool bar, and moving the export actions to the File menu. You can export only selected elements or the whole diagram to images. The editor now supports text alignment and multi-line object names. A wider range of panes now supports drag & drop of items.

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

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 is also available as an update 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 Biz Circuit & Dev Loop, Qt, QtCreator, Releases

64 comments

Eli says:

Nice as allways! From the changelog, I’m not able to find anything related to qml enums. Are theses still unsupportet?

Offtopic: Can you enable https for the blog and http://planet.qt.io/?

Eike Ziller Eike Ziller says:

Enums: See https://bugreports.qt.io/browse/QTCREATORBUG-19226

https://blog.qt.io works fine?

Eli says:

Oh ok, so only a redirect is missing 🙂

Tobias Hunger Tobias Hunger says:

https://planet.qt.io/ works fine for me, as does https://blog.qt.io/.

Aleksey says:

Hi, from this gif video is hard to understand where Clang options are. Is there some good Youtube video?

Eike Ziller Eike Ziller says:

“To enable them 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.”

Aleksey says:

Thanks, found it. Not ready for using so: in ,many files get error like following:

Warning. The code model could not parse an included file, which might lead to slow or incorrect code completion and highlighting, for example.

type_traits:3070:7: error: expected ‘(‘ for function-style cast or type construction
QLoggingCategory:1:10: note: in file included from Qt/5.10.1/gcc_64/include/QtCore/QLoggingCategory:1:
qloggingcategory.h:43:10: note: in file included from Qt/5.10.1/gcc_64/include/QtCore/qloggingcategory.h:43:
qglobal.h:45:12: note: in file included from Qt/5.10.1/gcc_64/include/QtCore/qglobal.h:45:

Also put warning in lines with Q_OBJECT macro, suggests to add override to destructors, etc.

You can find some more information in the Qt Creator Manual: http://doc.qt.io/qtcreator/creator-clang-codemodel.html

crash says:

Offline installer still doesn’t work without internet.

Output of “qt-creator-opensource-windows-x86_64-4.6.0.exe -v”: https://pastebin.com/bHEFtaQb

Eike Ziller Eike Ziller says:

https://bugreports.qt.io/browse/QTIFW-1115 . Please add comments + vote there.

@crash: You can use the offline installers just fine without a network connection. There is currently a bug in the installers that causes install to hang in the special case that you have IP network connection, but no access to the Qt Account. If your network happens to be such that has “internet”, but not “Internet”, simply disconnect it to install.

bertram says:

OK, but I use it in a VM … howto “simply disconnect it” ?

When will you fix this bug?

Thorbjørn says:

Those diagnostics and the related quick-fixes are awesome, but is there a way to see all issues identified in the whole project (as in https://bugreports.qt.io/browse/QTCREATORBUG-18094), or to apply a certain quick-fix to the whole project? That would be really helpful!

aportale says:

Project-wide analysis is coming in 4.7: https://codereview.qt-project.org/221288/

Jakub Narolewski says:

Awesome! 😀

Will Stokes says:

I played with clang-tidy and it looks really promising. Sadly even on a new iMac pro I’m finding it pretty laggy with only a few options checked. Are you making use of all available cores?

The other major issue I have is that implementing fixes is painful. E.g. I’d like to apply fixes in categories for a given file. Case in point simplifies by using auto more often. Right now if I hover over the light bulb and Opt+Return I often get teleported to a different place in the file. Double or triple-clicking the light bulb and applying for the fix works, but then I have to wait for the entire file to be rescanned before I can repeat the process on other similar issues. Unfortunately when I checked out:

https://codereview.qt-project.org/221288/

I don’t’ see a reference to a JIRA case so it’s unclear how this will work in Qt Creator 4.7 (or when 4.7 is planned for release). What I’d love is to have clang-tidy issues listed under the “Issues” pane along the bottom (Cmd+1). clang-tidy warnings could be toggled on and off entirley using buttons along the top of the bottom pane. Then the user could check or uncheck groups of clang-tidy issues by category, then click a “Fix” button to fix them in bulk before the file (or entire project) is rescanned. What you have now is nice, but I’d pref to turn on more checks and then go through existing code and do bulk fixes. Right now that just isn’t possible, we can only see how much opportunity there is.

One final suggestion, is there a way to modify how the beautify like fixes (e.g. adding {‘s around statements) are performed to match the code style that we have setup under Preferences -> C++ -> Code Style ?

Eike Ziller Eike Ziller says:

The patch that you link to integrates the checks as analyzer runs in Debug mode, like the Clang static analyzer. Since the checks can take quite some time and processor resources, directly integrating them into the issues pane without manual “runs” doesn’t sound feasible. “Opt+Return” applies to the text cursor location like the other shortcuts, so maybe that is why you perceive “teleportation”?

Jason says:

While I’m happy to see progress, I’m still waiting on:
https://bugreports.qt.io/browse/QTCREATORBUG-16925
Which aside from the still-irritating editor quoting behavior,
( https://bugreports.qt.io/browse/QTCREATORBUG-20158 )
is my biggest pain point.

Tyson says:

Qt Creator is great and has made C++ development on Linux much easier. Unfortunately, I’m stuck using C++98. Is there a way to tell the Clang code model which standard to use so that I don’t get warnings pertaining to standards I can’t use?

Eike Ziller Eike Ziller says:

For generic projects, no (https://bugreports.qt.io/browse/QTCREATORBUG-20123). The cmake/qmake/qbs projects should already tell the Clang backend which C++ version they would use to build the project.

Tyson says:

For generic projects, I have found that adding “-std=c++98” to the list of options seems to do the trick, though I can’t guarantee that it works perfectly. I have found, however, that the GUI doesn’t generally let me add the option and will highlight it as invalid. To add it I have typically had to manually modify my QtCreator.ini file (in ~/.config/QtProject on Linux).

HGH says:

Please keep that Clang code model up to date. Don’t wait another 3 years to update it again.

Eike Ziller Eike Ziller says:

Clang 3.9.0 is not 3 years old, and 3.9.1 even less than half that. In any case we tried to move to 4.0 after it got out but had too many issues with it, so we concentrated on improving the integration into Qt Creator in the first place.

HGH says:

Thank you. I was speaking figuratively. What I meant was that C++20 is probably 3 years away and maybe Qt Creator could provide support for the new features even before the standard is released through Clang.

Nick says:

The clang-tidy and clazy options are really nice to have as live code checks. They’re too slow to enable more than 3 (after the 3rd the delay seems to become exponentially larger, it’s not linear, which makes them unusable on large projects), but obviously 3 > 0.

Not everything is rosy though. 4.6 breaks cmake projects’ ability to do a “clean” or “rebuild” (QTCREATORBUG-20098). This does feel like it should have been a release blocker.

Alan says:

Sadly, I will have to agree. I wanted to use clang-tidy and clazy, but Qt Creator has become so slow as a result that I had to disable the ClangCodeModel plugin. 🙁

Eike Ziller Eike Ziller says:

I don’t quite understand. If you are not enabling the checks in the options (or if you disable them again after enabling them), they do not (should not) affect the performance of the Clang code model.

nrw says:

I have a big project based on qbs. Assembly time increased from 30 minutes to 1 hour 30 minutes. QtCreator loads one core by 100% periodically and freezing. The launch time of the application under qtcreator, grew from 10 seconds to a minute. Have to go back on 4.5.2

Christian Kandeler Christian Kandeler says:

You should file such issues as (separate) bug reports, so we can properly follow up on them. The blog is not a good platform to track problems.

Konstantin Isakov says:

This release looks promising, but QTCREATORBUG-20125 is happening all the time and making it unusable for me.

Remik says:

Great work. These are on my wishlist:
* Static call graph tree widget like in Netbeans, Eclipse. No need for node/wire diagram.
* Static signal/slot connection graph tree widget. New syntax only would suffice.
* Find Usages filter for constructors. It currently shows all type usages.

Chris Bruner says:

I use doxygen for call graphs, perhaps that could be integrated as an addon, autoconfigure for a project.

Alan says:

I really like the integration of Clang-Tidy and Clazy warnings. Thanks a lot for this!

exim says:

Any updates regarding TABS support? i.e. to have multiple files open in tabs.

Tobias Hunger Tobias Hunger says:

We think tabs don’t scale to the number of files typically open in an IDE. So no, we are not going g to add tabs.

isgursoy says:

Can I use clang-tidy 6 checks by putting symlink of libclang 6? I want to use new checks that come with clang 6.

Nikolai Kosjar says:

Unfortunately not.

The tidy/clazy checkers are statically compiled into our libclang since it’s not trivial to load these as plugins. The vanilla libclang has no tidy/clazy checks integrated.

Lars Wadefalk says:

Many thanks for this release! Great work as always! But I am a little disappointed they are more focused on newer features rather than fixing older bugs.
I use QtCreator not only for Qt-related projects but to import other “generic” projects with entirely different architectures and frameworks. QtCreator is my one-stop environment for all development.
But I find that for such projects the CLangCodeModel breaks apart completely. Even simple #if 0 … #endif scopes fails.
And I do set up the .config .files and .include files very carefully. Turning CLangCodeModel off and the internal model is just fine.

The CMake support for embedded targets still has problems with the crosscompiling sysroot environment. And the warning about the project build folder outside of source-tree is STILL there after all these convincing discussions in the bug thread to remove it.
Other than that, I have found QtCreator to become less stable the latest 4.x.x releases. Crashing upon startups, session switching, adding existing files to a generic project. A LOT of that crashing, mostly on the Windows side though.

I am happy for the releases and work put down, really, but I think the focus is a bit strange. There are too many bugs lingering in the basic functionality.

User says:

+1 for to that notice

Andy says:

I love Qt Creator, thank you guys for working on it and having it open source, I have learned from its source code too a bit <3

AlexR says:

How can I disable some clazy warnings?

MikeC says:

To customize the clazy warnings, from the blog post for the 4.6 beta release. “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.”

https://blog.qt.io/blog/2018/02/07/qt-creator-4-6-beta-released/

You can find some more information in the documentation: http://doc.qt.io/qtcreator/creator-clang-codemodel.html

Robert says:

The manual does not explain how to disable single warnings for clang_tidy or clazy.
I would also love to know how to disable checks for 3rd party macros (which can be identified through the header file location).

Gunnar Roth says:

Well, good work,
but still some questions.

It seems that .clang-tidy files are not supported. Is this planned? It is very important to set readability options.
// NOLINT also seems to have no effect. Why?
When will 6.0 be supported , I really need the Added the ability to suppress specific checks in NOLINT.

Freddy says:

I am experiencing random crashes in the QtCreator environment. After the update (done a few hours ago) my QtCreator seems to be very unstable. Anybody else experiencing the same issue?

Slava says:

I had one crash in about 3 days of heavy usage. It happened on attempt to rename some local variable (usually done in place). Otherwise it looks pretty stable.

Slava says:

Suddenly Output Argument coloring is working and that is not good at all – foreground is all black, and I am on dark color scheme. And it is not even possible to switch that off.

Tyson says:

I had the same problem (also for “Function Declaration”). Both of these seem to be new options that were not present in 4.5, but also don’t have a way to change the color in the GUI. I am using a custom color scheme and was able to manually edit the color scheme’s .xml file (in “~/.config/QtProject/qtcreator/styles/filename.xml” on Linux) to change the “foreground” attribute of the “OutputArgument” and “Declaration” elements to fix the problem. If you are not using a custom color scheme, I imagine you should be able to use the “Copy…” button to make a copy and then edit that.

I think this is a bug that should be fixed. Why have options for coloring certain elements if you cannot change that color through the GUI?

Slava says:

Yep. I am on custom color scheme, and manually fixing xml did help. Thanks!

Henk says:

After updating to Qt Creator 4.6.0 on Windows 10, I repeatedly get errors like “Cannot write file C:\Users\me\AppData\Roaming\QtProject\qtcreator\default.qws. Cannot remove the file to be replaced”. The same message appears for other files in this directory, like qtversion.xml, devices.xml, qnx\qnxconfigurations.xml etc.

If I check the given directory, these file are updated so it appears the files can be written to/updated.

chadr says:

I also have experienced your problem. Only windows version have this problem.

Jason says:

I’m having so many problems with the “improved code model”

So many so that I wish it wasn’t improved. You can follow along with https://bugreports.qt.io/browse/QTBUG-67435

Nikolai Kosjar says:

Your issues seem to relate to the QtQuick/Qml/JS code model, not the clang code model.

Jason says:

Yes, it seems that the patch for QML code was put into master, and 4.6 branched the same day the patch landed, and so it didn’t get picked up by 4.6. Which is a big oversight. QML enums were in 5.10, which shipped December 7, and the patch landed Jan 17, so we have to wait until 4.7…

Andrey says:

Is it the only way to disable some warnings – to run creator from command line with export CLAZY_CHECKS set ?
No any way grom gui ?
For example disable “non-pod-global-static”

Michael says:

Clang plugin not being provided on Windows?

aportale says:

The ClangCodeModel plugin and its 3rd-party dependencies are part of the binary package (Windows, Linux, MacOS). In case you didn’t yet, the ClangCodeModel plugin needs to be enabled under Help->About Plugins…. If you enabled it but are still missing the functionality, please report back.

Juergen_M says:

Thanks a lot for these new release.
Keep up the great work.

Robert says:

Sorry to say, https://bugreports.qt.io/browse/QTCREATORBUG-20120 really breaks my coding experience. Any way to revert to 4.5.2 via online installer?

Maxim says:

Thanks for the release, bad that support of Android deployment/debugging for Qbs projects not implemented

martin says:

FWIW, the javascript evaluator for the locator seems to use qscriptengine, not the qml engine, so should probably update the link?

Commenting closed.

Get started today with Qt Download now