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.

inside custom component

Native Development

Reply
Developer
Developer
tw_
Posts: 42
Registered: ‎05-17-2012
My Device: Playbook, Dev Alpha A
My Carrier: O2
Accepted Solution

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:

 

Beta4_no_autocompletition.png

 

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?

 

 

Please use plain text.
New Contributor
theoradu
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.

Here's the thread I started: http://supportforums.blackberry.com/t5/Cascades-Development/Lots-of-problems-with-Beta-4/td-p/201422...
Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
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:
http://supportforums.blackberry.com/t5/Cascades-Development/code-content-assist/td-p/2014327
----------------------------------------------------------
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.
@SimonHain on twitter
Please use plain text.
Developer
Developer
tw_
Posts: 42
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

Please use plain text.
Developer
theappspod
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?

Please use plain text.
Developer
Developer
tw_
Posts: 42
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:

http://supportforums.blackberry.com/t5/Cascades-Development/BETA-4-SqlDataAccess-busted/td-p/2017493

 

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.

 

Please use plain text.
Developer
theappspod
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

Please use plain text.
Developer
noahhuang
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:

 

1. Configure-->Add Library-->Qt Core

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

Please use plain text.
New Contributor
TheWirting1
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...
Please use plain text.
New Contributor
adamlum
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.

Please use plain text.