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
Ronl_2k12
Posts: 17
Registered: ‎10-20-2011
My Device: Blackberry Bold 9900, Blackberry DevAlpha, Playbook
My Carrier: Rogers
Accepted Solution

Porting Qt App to Qnx Momentics

[ Edited ]

Hey, i wanted to know if its possible to Port my Qt App to the Qnx Momentics IDE. I've been looking all over looking to find documentation or instuctions on how but can only find Qt Creator Porting information


Basically this is what i have

i have Ported the Qt App to QtCreator and have sucessfully got it running on the Dev Alpha

 

Now i want to:

1. Import/ Move the Qt App Over to the Qnx IDE

 

2. Then Remove the Qt UI and Rebuild the App UI in cascades while keeping the qt Back end

 

So can i keep the Qt back end and rebuild the UI in cascades ?

If so anoyone can point me documentation on how i can move the porject into Qnx Momentics.

 

NOTE: Im fully aware im not able to mix the Qt UI/GUI  code with Cascades. i have to pick one or another. in this case i want to replace the Qt UI with cascades

 

 

Thanks in adavnce, happy Coding, and porting

Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Porting Qt App to Qnx Momentics

Hi!

Just create a new project from one of QDE templates. Non-GUI Qt classes are already included. Then recreate the UI in Cascades and move other classes from your Qt Project.

But personally I find Qt Creator very convenient for Cascades development. If doesn't have QML preview, but it's very lightweight and fast. Logs & debugger work out of the box and autocompletion works for signals & slots. It works great with Cascades so I highly recommend to keep using it.

Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Developer
Ronl_2k12
Posts: 17
Registered: ‎10-20-2011
My Device: Blackberry Bold 9900, Blackberry DevAlpha, Playbook
My Carrier: Rogers

Re: Porting Qt App to Qnx Momentics

This is great thanks, you meant IDE Templates Correct ? and copy them over into the project folder.

Also you said i could use Qt Creator to rebuild the UI ! That might be even better ! Could you just give me a short set of instructions on how to start a new cascades UI in Qt Creator for an Existing Project. if not its fine i really Appreciate the Answer. i can definitely move forward now.
Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Porting Qt App to Qnx Momentics

[ Edited ]

Yes, QDE is QNX Momentics IDE. I think it's easier to move them other way around:

 

Create a new project in Momentics, then move source files one by one from the old project into new one (except GUI-related classes). And then recreate the GUI.

 

About QT Creator / Cascades:

 

For setting up QT Creator follow the steps on the wiki:

http://qt-project.org/wiki/Setting-up-Qt-Creator-for-BlackBerry-and-QNX

I think you've already done that.

 

Then create a Qt Quick project (wiki describes this step).

 

After this remove all Qt Quick related functionality from project and add Cascades libraries to .pro file. This is how my project file looks like:

 

TEMPLATE = app

# Please do not modify the following line.
#include(qmlapplicationviewer/qmlapplicationviewer.pri)

# Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =

QT += declarative script xmlpatterns xml sql network svg

INCLUDEPATH += src

# Workaround for autocompletion bug INCLUDEPATH += include include/cpp include/qt4/QtCore include/qt4/QtSql include/qt4/QtNetwork LIBS += -lbbcascades -lbbcascadesmultimedia -lbbdevice -lbbplatform -lbbpim -lbbdata -lbbcascadespickers -lbbsystem -lbbmultimedia # The .cpp file which was generated for your project. Feel free to hack it. SOURCES += main.cpp \ ...other cpp files... OTHER_FILES += bar-descriptor.xml \ qml/main.qml HEADERS += \ ...header files...

 

Then update bar-descriptor.xml file. You can use Momentics-generated file as a template. Here's my bar-descriptor.xml (replace application name and paths):

 

<?xml version='1.0' encoding='utf-8' standalone='no'?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
	<id>com.mydomain</id>
	<name>Application Name</name>
	<versionNumber>1.0.0</versionNumber>
	<description>Application Description</description>
    <initialWindow>
        <systemChrome>none</systemChrome>
        <transparent>false</transparent>
        <autoOrients>true</autoOrients>
		<aspectRatio>portrait</aspectRatio>
	</initialWindow>
    <env value="app/native/imports" var="QML_IMPORT_PATH"/>
    <env value="app/native/plugins:/usr/lib/qt4/plugins" var="QT_PLUGIN_PATH"/>
    <env value="app/native/lib:/usr/lib/qt4/lib/" var="LD_LIBRARY_PATH"/>
    <action system="true">run_native</action>
    <asset path="MyApplication" type="Qnx/Elf" entry="true">MyApplication</asset>
    <asset path="%SRC_DIR%/qml">qml</asset>
	<asset path="%SRC_DIR%/assets">assets</asset>
    <icon>
		<image>assets/images/icons/applicationIcon114.png</image>
    </icon>
	<splashScreens>
	   <image>assets/images/splash/portrait768x1280.jpg</image>
	   <image>assets/images/splash/portrait720x1280.jpg</image>
	</splashScreens>
</qnx>

 

After this try to build and deploy a simple Cascades project. If everything is ok, start moving files from your old project (file by file).

 

Important:

Autocompletion won't work initially. All Cascades and Qt classes will be underlined in red.

Wiki describes a few workarounds. The one I'm using is creating a symlink in your project folder to point to ndk include folder:

lrwxr-xr-x@  1 user  staff     55 Dec 15 19:23 include -> /Applications/bbndk/target_10_0_9_1673/qnx6/usr/include

Then add the following line to .pro file:

INCLUDEPATH += include include/cpp include/qt4/QtCore include/qt4/QtSql include/qt4/QtNetwork

 Autocompletion should work after that. I'm using Qt Creator on MacOS, this may not apply to Windows version.

 


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Developer
Ronl_2k12
Posts: 17
Registered: ‎10-20-2011
My Device: Blackberry Bold 9900, Blackberry DevAlpha, Playbook
My Carrier: Rogers

Re: Porting Qt App to Qnx Momentics

Thanks so much il be getting going on that.  Does it matter if the App is a Qt widget  or Qt Quick App. The Process should be the same right ?

Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Porting Qt App to Qnx Momentics

Right. In either case you'll have to recreate the GUI completely.

Andrey Fidrya, @zmeyc on twitter
Please use plain text.