# Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

## Native Development

Highlighted
Developer
Posts: 44
Registered: ‎05-17-2012
My Device: Playbook, Dev Alpha A
My Carrier: O2

# Beta 4 - Momentics IDE autocompletion does not work for Qt classes in newly created projects?

After uninstalling the Beta 3 Momentics IDE und installing the new Beta 4 I noticed that the IDE autocompletion does not work any more for Qt classes when I create a new project from a template (empty or non-empty). It appears that the IDE cannot find the Qt header files:

But I can compile the project without problems.

Also when I import my old projects created with Beta 3 the autocompletion works for Qt classes. When I compared them I noticed that the Makefiles have changed completely.

Of course I could stick with my old project structure but the Release Notes for Beta 4 mention something about changes in the Qt libraries, precompiled headers and so on which could require making changes in Beta 3 projects. To avoid running into problems I thought I could just create new projects in Beta 4 and reimport my source files from my Beta 3 projects. But I want to keep the autocompletition for Qt classes.

I assume it is just a problem in the automatically created files of the project. Is there a way to fix them?

New Contributor
Posts: 5
Registered: ‎12-02-2012
My Device: 9900
My Carrier: O2

## Re: Beta 4 - Momentics IDE autocompletion does not work for Qt classes in newly created projects?

You can manually add the library (QtCore) from Project -> Add Library. This fixes the syntax errors, but I couldn't find a way to actually debug the app on the simulator.

Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

## Re: Beta 4 - Momentics IDE autocompletion does not work for Qt classes in newly created projects?

check the replies here, maybe they help:
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
Developer
Posts: 44
Registered: ‎05-17-2012
My Device: Playbook, Dev Alpha A
My Carrier: O2

## Re: Beta 4 - Momentics IDE autocompletion does not work for Qt classes in newly created projects?

[ Edited ]

Thanks for your answers. The hint to rebuild the index was helpful but didn't solve the problem by itself.

But by comparing all files of some of my old Cascades projects generated in Beta 3 and newly generated in Beta 4 I found that in the Beta 4 projects the .cproject files were missing several tags which are setting the include path to the Qt headers for the IDE. Note, I'm not refering to the include pathes settings for the compiler here. Just autocompletion and also code analysis in the IDE did not work.

Anyway to fix this I found the following workaround:

There are four instances of these tags in the .cproject file of a Cascades project (Beta 4):

<option id="com.qnx.qcc.option.compiler.includePath.NNNNN" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value=""/>
</option>

Where NNNNN is some random number. When I change all these 4 instances to:

<option id="com.qnx.qcc.option.compiler.includePath.NNNNN" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/> <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/qt4"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/qt4/QtCore"/> <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp/c"/> <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/cpp/embedded"/>
</option>

...so they look again like they did in Beta 3 and then refresh the project or restart the whole IDE autocompletion starts working again for new Beta 4 projects. When I then invoke Index -> Rebuild as recommended in the other thread also C++ code analysis for syntax and semantics errors works again (if you have it enabled in the IDE).

I guess these lines could also be added to the template files somewhere in the BB NDK installation folder but I didn't want to patch files there.

I filed a new issue here:
https://www.blackberry.com/jira/browse/BBTEN-466

Developer
Posts: 122
Registered: ‎11-12-2010
My Device: Dev Alpha
My Carrier: N/A

## Re: Beta 4 - Momentics IDE autocompletion does not work for Qt classes in newly created projects?

Is anyone else experiencing this in the SDK Gold release?

Developer
Posts: 44
Registered: ‎05-17-2012
My Device: Playbook, Dev Alpha A
My Carrier: O2

## Re: Beta 4 - Momentics IDE autocompletion does not work for Qt classes in newly created projects?

[ Edited ]

Yes I do. The difference is only that in the Gold release it appears to work on the first time you create a new project in the IDE. But as soon as you restart the IDE the problem is back. (I made a clean installation of Gold and I created a new workspace folder before.)

But the same workaround I described above still works. Except that in Gold projects there are no empty "<option id="com.qnx.qcc.option.compiler.includePath.NNNNN" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">" in the .cproject file by default.

But you can add them by just adding some lib to the project using the new Library Wizard as I described here in the last posting:

For example just add QtCore. Then you will get these tags in the .cproject file and then you can apply the workaround I described above. But actually you only need to add the includePath lines you use in your project. After doing that everything works for me.

Developer
Posts: 122
Registered: ‎11-12-2010
My Device: Dev Alpha
My Carrier: N/A

## Re: Beta 4 - Momentics IDE autocompletion does not work for Qt classes in newly created projects?

Thank youu tw - this worked a treat.

Just for reference I also had to right click project > index > rebuild

Thank you again

Developer
Posts: 100
Registered: ‎10-01-2012
My Device: BB10 Dev Alpha
My Carrier: Roger

## Re: Beta 4 - Momentics IDE autocompletion does not work for Qt classes in newly created projects?

In Gold Version for a new Cascade Project:

2. Add  " QT += core "  into Pro file

3. Properties-->C/C++ General-->Paths and Symbols--> GNU C-->Add--> C:\bbndk\target_10_0_9_1673\qnx6\usr\include\qt4 (Windows)

4. Clean and rebuilt project

New Contributor
Posts: 2
Registered: ‎04-04-2013
My Device: None (Z10)
My Carrier: Rogers

## Re: Beta 4 - Momentics IDE autocompletion does not work for Qt classes in newly created projects?

I am using using version 10.0.1.0.1020 and your solution does not seem to be working...
New Contributor
Posts: 7
Registered: ‎03-25-2013
My Device: Developer; currently using v10 simulator
My Carrier: Orange

## Re: Beta 4 - Momentics IDE autocompletion does not work for Qt classes in newly created projects?

[ Edited ]

Hello,

I have tried all the suggestions posted in this thread and in this http://supportforums.blackberry.com/t5/Cascades-Development/QObject-unresolved-inclusion/td-p/203018... thread, and it does not solve the problem.

Every time I restart the IDE, I get this "unresolved inclusion" for each of my #include directives. It's getting annoying that I have to create new project and copy my files over, every time.
I tried several IDE versions : 10.0.1.0.1020 and 10.0.10.822 - same problem.

EDIT:

I don't understand how come I have no problem with the sample apps though.