Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Smart code completion in Qt Creator

Is Qt Creator present smart code completion like Intellij IDEA? For example:

void main() {
    QString simpleVariableName = "First string";
    QString anotherVariableName = "Second string";
    // If I type "variable" and press Ctrl + Space I would like to get 
    // all matching variables(simple and another) in popup list. In 
    // IDEA it works, but Qt Creator show nothing.
}

I heard aboud Clang Code Model plugin and it's already installed in my 3.4.0 version. But it make no sense, I still have a default behaviour.

Is there any way to get really smart code completion?

like image 774
Ivan Avatar asked Jun 03 '15 14:06

Ivan


1 Answers

Is there any way to get really smart code completion?

Well, the answer to your question is Yes. You could implement a plugin or add that feature to an existing one. But, right now, the only plugin that comes by default in the QtCreator and deals with code completion is ClangCodeModel.

The ClangCodeModel plugin does not have such feature.

On the other hand, having the plugin installed is not enough to get it working, you need to enable it.

Go to Help -> About Plugins and make sure the checkbox "Load" for the ClangCodeModel plugin is checked.

The plugin improve code completion, but be aware this plugin is experimental and is not complete.

Checkbox for the ClangCodeModel plugin is checked!

Links of interest:

Code completion is not so smart.

Clang based code model

like image 133
Raydel Miranda Avatar answered Nov 15 '22 01:11

Raydel Miranda