Qt Creator 4.8.0 released

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

Programming Language Support

We have added experimental support for the Language Server Protocol (LSP), which adds basic support for various programming languages to Qt Creator.

Language Server Protocol support in Qt Creator 4.8

The Language Server Protocol is a standardized bridge between an editor or an IDE and a programming language. This makes it easy for a programming language to be supported by editors and IDEs: If it provides a server application that speaks this protocol, every editor that implements a language protocol client gains support for code completion, code navigation and code diagnostics for the programming language. And of course the other way round: An editor that implements a language protocol client automatically gains basic support for a various range of programming languages. There are language server implementations for many programming languages already. You can find lists of implementations and their state for example on the official LSP website and on a community driven site.

To set up a language server in Qt Creator, you first need to enable the LanguageClient plugin in Help > About Plugins (Qt Creator > About Plugins on macOS). Then open the language client options, add a language server executable, and specify the MIME type or glob patterns to open with that language server, and any arguments that the server needs to be passed on the command line.

Qt Creator currently supports code completion, highlighting of the symbol under cursor, and jumping to the symbol definition, and integrates diagnostics from the language server. Code highlighting is done through the generic highlighter, since the Language Server Protocol does not provide it.

C++ Support

We updated the Clang code model to LLVM 7.0. We also implemented Follow Symbol for the auto keyword, and completion tooltips now show the available overloads for the selected function. You can export the information that the code model has about your project as a compilation database with the new Build > Generate Compilation Database.

There are several new experimental plugins as well:

Compilation Database Projects

After enabling the CompilationDatabaseProjectManager plugin, you can open compilation databases as projects in Qt Creator. A compilation database is basically a list of files and the compiler flags that are used to compile them. Some build systems and tools are able to generate such databases for use in other tools. This can be an alternative to using a Generic Project, since it feeds better information about compiler flags and include paths to the code model.

Clang Format Based Indentation

Does auto-indentation via LibFormat which is the backend used by Clang Format. Enable the plugin ClangFormat to try it.

Cppcheck Diagnostics

Integrates diagnostics generated by the tool Cppcheck into the editor. Enable the plugin Cppcheck to try it.

Debugging

Qt Creator 4.8 supports simultaneously running multiple debuggers. The debugger tool bar in the Debug mode has an additional pop up menu where you can switch between running debugger instances and the "preset" view which allows to start new debuggers. Each running debugger instance also maintains its own set of views (Locals, Watches, Stack, etc) and their layout.

Get Qt Creator 4.8.0

The opensource version is available on the Qt download page, and you find commercially licensed packages on the Qt Account Portal. Qt Creator 4.8.0 is also available through 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.


Blog Topics:

Comments

?
Mateusz
0 points
77 months ago

Seems great, but I cant use it on Ubuntu 14.04 (trusty):
.../Qt/Tools/QtCreator/bin/qtcreator: relocation error: .../Qt/Tools/QtCreator/lib/Qt/lib/libQt5DBus.so.5: symbol dbusmessagegetallowinteractiveauthorization, version LIBDBUS1_3 not defined in file libdbus-1.so.3 with link time reference
Probably to old system :(

?
Sam
0 points
77 months ago

This is my problem too. Linux Mint based off Ubuntu 14.04. :(
There's still a few months left of LTS support!

?
Sam
0 points
77 months ago

I did try 4.8 beta1 (I think it was), which did work on Ubuntu 14.04, so this is a little disappointing.

?
Eike Ziller
0 points
77 months ago

We switched the prebuilt binary to the Qt 5.12.0 binaries, so we support whatever that supports. Of course you can still build Qt Creator yourself too (also against the prebuilt Qt 5.9 binaries).

?
LC
0 points
77 months ago

I filed this as a bug (QTCREATORBUG-21658) as the MaintenanceTool does not warn and will leave a dead system behind. That is, it will offer you no way of going back (you have to kick MaintenanceTool and do it by hand).
Furthermore, you shouldn't silently drop system support in minor versions. While this would be understandable when moving from Qt 5.x to 6 and Qt Creator 4.7 to 5, it is NOT when going from 5.11 to 5.12 or 4.7 to 4.8.

?
Nocpes
0 points
77 months ago

You can download lib-dbus latest and build.
After that, write other bash script:
export LDLIBRARYPATH=path/to/your/built/dbus/lib
Start qtcreator.

?
Pedro
0 points
77 months ago

You didn't notice that qtcreator uses RPATH to link to its libraries, so it is inmune to LDLIBRARYPATH, unless you convert it to RUNPATH.

?
prashanth
0 points
77 months ago

After installing I get an error on startup.
relocation error: /home/me/qtcreator-4.8.0/bin/qtcreator/home/me/qtcreator-4.8.0/lib/Qt/plugins/platforms/../../lib/libQt5DBus.so.5: relocation error: symbol dbusmessagegetallowinteractiveauthorization, version LIBDBUS13 not defined in file libdbus-1.so.3 with link time reference: /home/me/qtcreator-4.8.0/lib/Qt/plugins/platforms/../../lib/libQt5DBus.so.5
: symbol dbus
messagesetallowinteractiveauthorization, version LIBDBUS13 not defined in file libdbus-1.so.3 with link time reference

I use centos7.

?
Eike Ziller
0 points
77 months ago

Is your CentOS 7 up to date? I think I checked an RC build on my CentOS 7 VM.

?
Vladiomir
0 points
77 months ago

I haven't found link to full git changelog, so here it is:
https://code.qt.io/cgit/qt-...
Maybe someone found it useful.

?
vemod
0 points
77 months ago

I can't run it on OS X 10.11.6. OS X 10.10.0 or later is needed. Intentional?

?
vemod
0 points
77 months ago

10.12.0 or later, that is!

?
Eike Ziller
0 points
77 months ago

Same comment as above ;)

We switched the prebuilt binary to the Qt 5.12.0 binaries, so we support whatever that supports. Of course you can still build Qt Creator yourself too (also against the prebuilt Qt 5.9 binaries).

?
Vladimir
0 points
77 months ago

Thanks, good job!

The feelings, now (with enabled Сlang) large files with the source code (30,000 lines) open much faster than in 4.7 .

I can't understand one thing. I enabled cppcheck plugins, restarted QtCreator, but I can't find how to use the analysis. Or need to install cppcheck separately?

?
Fabrice Mousset
0 points
77 months ago

Yes ccpcheck has to be installed sperately and path must be defined in Tools/Options/Analyszer/Cppcheck

?
ABBAPOH
0 points
77 months ago

Looks like the support for the cppcheck is very preliminary, the only thing it does is checks currently open file. I.e. you can't run the analyzer on the whole project (or I missed somth?), the warnings are not shown in the bottom tab either (again, am I missing smth?).

?
aportale
0 points
77 months ago

Yes, in it current form, CppCheck runs its diagnostics on the currently edited file, on the state that is saved on disk and the issues are not shown in the issues view. Anyway, IMHO even with a current feature disparity compared to the clang-tidy and clazy integration, CppCheck adds lots of useful diagnostics, and is quite fast at that :)
On Windows I prefer installing it via "choco install cppcheck".

?
Mateuszl
0 points
77 months ago

I don't understand - clang format plugin does indentation only or all of formatting that standalone clang-format does?

?
Eike Ziller
0 points
77 months ago

By default it only indents for now. If you want to see how it behaves when actually formatting the code, you can try that by setting the magic hidden environment variable QTCFORMATINSTEADOFINDENT=1 .

?
Mateusz
0 points
77 months ago

Works nice, thanks! Especially that it formats only selected fragment is great.

If this feature will be developed further (I hope so), here are some feature requests:
* format whole file (perhaps when nothing is selected?)
* Use .clang-format file from current file directory (or from file's parent recursively), if not available fallback to file from home directory, if not available fallback to QtCreator configuration or default. Formatting rules are often project-specific, not global.

?
kryksyh
0 points
77 months ago

Isn't it what Beautifier plugin does for a quite a long time?

?
Parker
0 points
77 months ago

I think the difference is that the "indentation" feature reformats as you type, while the Beautifier only runs on save or when manually triggered.

?
Nikolai
0 points
77 months ago

I have a question about compilation_database. Does it work only with cmake or qmake support too?

?
Eike Ziller
0 points
77 months ago

If you mean the export, that simply exports the information that the code model has independent from where it gets that information from (QMake, CMake, Qbs, Autotools, ....)

?
Nikolai
0 points
77 months ago

Yep! Thanks! I Checked it.

What about command line ? Can I get compilation_database from command line from *.pro file ?

?
Try
0 points
77 months ago

Debugger UI completely destroyed!
Every time I stop debugging, It resets to fixed(predefined?) state.

?
Mitch
0 points
77 months ago

That's tracked here:

https://bugreports.qt.io/br...

?
Fabien
0 points
77 months ago

Thanks for the new release!

Unfortunately, I can't use it with my project because the code model parser can't parse my code when GNUSOURCE is defined, so it's full of errors, even though the code compiles fine. This is on my ubuntu 18.04 with gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0

This file breaks the code model parser:

ifndef GNUSOURCE

define GNUSOURCE

endif

include


(sorry for the bug report, but the bug tracker is down right now - I'll add my test project as soon as it's online)

?
veysel
0 points
77 months ago

libQt5DBus.so.5: relocation error: symbol dbusmessagegetallowinteractive_authorization....
same error on "CentOS Linux release 7.3.1611 (Core) "
if only there have been another version suitable with these systems.

?
Nate Reid
0 points
77 months ago

I just installed Creator 4.8, but the Language Server option is not available in the Options. See screen shot:
https://imgur.com/a/jDSfxR7

I'm running this on Windows 10.

?
Nate Reid
0 points
77 months ago

I found the fix which is to enable the (still) experimental plugin in the Help->Plugins.
Despite getting this installed and restarting Qt Creator, and going through the steps to add Python support as per the animated Gif at the beginning of this post, it still doesn't seem to create completions for certain libraries.
In addition, hitting 'ctrl-space' takes ages (5-10 seconds) for the completions to show up. Are completions cached, or pre-populated on file-scan?

?
Gabriel Acosta
0 points
77 months ago

The same thing is happening to me.

?
Eike Ziller
0 points
77 months ago

This is completely up to the language server, e.g. pyls in the case of Python.

?
Matheus França
0 points
77 months ago

I am also using Windows 10 currently, I enabled the LS plugin testing pyls (py 3.7) and rls (rust) both worked perfectly.
http://oi65.tinypic.com/1j2...

?
Nate Reid
0 points
77 months ago

I'll give Python 3.6 a try and see if that is any more performant.

?
chelsea
0 points
77 months ago

Definitely nice post and thank you, sir, for your great post.

?
real_zyf
0 points
77 months ago

My Project is base on 5.11.1
Qt Creator now update to 4.8
then:
I got
> no member named 'PlaceholderText' in 'QPalette'
because Qt Creator add "PlaceholderText" to my *.ui file but 5.11.1 not have PlaceholderText
so I must upgrade my project?

?
Loïc
0 points
77 months ago

Sadly each new version work less than the previous one.
I exclusivity uses generic project and it works great on 4.6.

But now with 4.8 it stops parsing all includes on the first error in an header. It does not even tell you in which header it fails, so you have to open each header to find what it does not like. And even when you find it you cannot do anything because it refuses to parse a macro for some reason.
Previously even if some header could not be parsed completely it was still getting the existing type and continue to parse other includes. So only the class of the failed header could not be resolved, but all other types were resolved correctly.

Also its really annoying to not be allowed to set compiler flag globally. The compilation database is way too complicated for simple case were all the files are compiled with the same flags.

?
Szabolcs
0 points
77 months ago

Many of us are disappointed by the effective abandonment of generic projects and the push to use a complex and difficult to set up project system even when not necessary.

https://bugreports.qt.io/br...
https://bugreports.qt.io/br...

?
Anatoly
0 points
77 months ago

I've just hit this. Clang code model worked perfectly in 4.7.2, but stopped working some time during 4.8 cycle. I checked back as far as 4.8beta1, and it worked in beta1, but not in beta2.

?
ruggero rossi
0 points
77 months ago

try to use the magic environment variables
QTCCLANGCSACMDPREPEND and QTCCLANGCCMCMDPREPEND
in my case setting them to
QTCCLANGCSACMDPREPEND='-Xclang -std=c++14'
QTCCLANGCCMCMDPREPEND='-Xclang -std=c++14'
saved the day

?
Anatoly
0 points
77 months ago

Nope, setting the variables didn't help. Clang still throws its hands whenever there's an error in one of the headers. I'm moving back to 4.7.2 for now.

?
MrSparc
0 points
77 months ago

Finally came back the Locals and Expressions views in a non-tabs approach so we can see in Debug the vars in both views simultaneously and not go jumping like crazy between tabs.
Just for this only it worth the upgrade.
Thanks "cute" dev team :)

?
Qt Deveolper
0 points
77 months ago

The enumeration values are still in CDB's Locals & Expressions view with "Use Python dumpers" checked. It worked in QtCreator 4.6.2.
Also debugger's layout is reset almost each time, after starting debug session.

?
Qt Deveolper
0 points
77 months ago
  • values a still
?
Qt Deveolper
0 points
77 months ago

are still "Not accessible"

?
Niko
0 points
77 months ago

Nice! Just tried the new LSP integration. Python like in the example works great. For bash (https://github.com/mads-har...) it doesn't seem to produce reasonable completions (there is always a super long list of completions that does not seem to depend on what symbol (partially) typed already).

?
Niko
0 points
77 months ago

Hmmm... something with the codemodel for my large cmake project is not working right. Code navigation and completion does not seem to work as expected. Switching back to 4.7.2 for now.

?
Eike Ziller
0 points
77 months ago

Please report bugs on https://bugreports.qt.io with details, so we can figure out what goes wrong.

?
Anatoly
0 points
77 months ago

I cannot reproduce the failures with a minimal example, so i don't have anything to file a bug with outside of "download DPDK source code and try it", followed by "it worked in 4.8.0beta1, but didn't starting with beta2". If Qt Creator was smaller, i would've bisected it myself, but i just don't have time to do that.

?
Peter
0 points
77 months ago

The upgrade offered from 4.7.0. Maintenance tool bricked my IDE, see https://bugreports.qt.io/br...
IMHO maintenance tool should check whether the system has the requirements for the new version.

?
MrSparc
0 points
77 months ago

There is someone who happens to put breakpoints in your code and when you run the debugger, in the "Breakpoints" view the column 'Number' that indicates the breakpoint number increases while running the debugger as if a millisecond counter was?
This behavior does not always happen, as sometimes when trying to launch the debugger (gdb on a Linux box) sometimes it takes a lot of time and does not launch it, which forces it to abort and re-launch the debugger or restart Qt-creator to work.

?
MrSparc
0 points
77 months ago

I reported issue on JIRA: https://bugreports.qt.io/br...
Looks like be a issue related with the new feature that supports simultaneously running multiple debuggers.