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
Jaffa
Posts: 34
Registered: ‎06-19-2012
My Device: BlackBerry Z10 Ltd Edition

[HOWTO] Getting started with "raw" QML on BB10 Native SDK

Last night I succeeded in getting the core of one of my QML apps ported from MeeGo & Symbian running on the BB10 Dev Alpha.

 

It's not hard, but I've written it up in case anyone else is looking to get started. Main points:

  • Setting QT_QPA_FONTDIR in bar-descriptor.xml.
  • Where the assets directory gets put relative to the CWD for QmlApplicationViewer.
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Please use plain text.
Developer
Jaffa
Posts: 34
Registered: ‎06-19-2012
My Device: BlackBerry Z10 Ltd Edition

Re: [HOWTO] Getting started with "raw" QML on BB10 Native SDK

Going one step further, I've now got a single source tree (for my app, Bedside) which I can use with Qt Creator (to target Symbian, Maemo & MeeGo) and the BlackBerry 10 Native SDK (to target the BB10 Dev Alpha).

 

I merged in files from a Cascades project:

 

Assets

Since I had an existing, Qt Creator-based, file structure I changed bar-descriptor.xml to match the existing 'images' and 'qml/Bedside' directories I wanted deployed. However, the BlackBerry Native SDK's structure is nicer out-of-the-box so I'd probably use it for future projects, and change the .pro file to match for Qt SDK.

 

Makefile

This was a straightforward copy, merging in the target I already had for generating Debian control file icons.

 

.pro file

Here was a bit more tricky, but I used the following to wrap up the BB10-specific bits:

 

device|simulator {

  ...

}

 

The names 'device' and 'simulator' are obviously a little generic, but it looks like these should be trivial to change in Makefile.

 

Qt Creator doesn't seem to like wildcards on SOURCES and HEADERS, so I had to continue to list them explicitly.

 

main.cpp

In my existing main.cpp I could use Q_OS_BLACKBERRY with #ifdef to bypass the missing Qt Mobility, set the appropriate BAR-relative path and configure other device-specific properties (e.g. is a close icon needed: it's not on swipe-based UIs like BB10 & N9).

__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Please use plain text.
Developer
trollixx
Posts: 60
Registered: ‎04-18-2012
My Device: BB10 Dev Alpha C

Re: [HOWTO] Getting started with "raw" QML on BB10 Native SDK

[ Edited ]

I would suggest adding BB10NDK to QtCreator as new gcc toolchain and Qt version (simply by pointing to qmake executable). After this you'll be a happy user of QtCreator which builds apps for the BB10 device :smileyhappy:

--
Oleg Shparber
Please use plain text.
Developer
Jaffa
Posts: 34
Registered: ‎06-19-2012
My Device: BlackBerry Z10 Ltd Edition

Re: [HOWTO] Getting started with "raw" QML on BB10 Native SDK


trollixx wrote:

I would suggest adding BB10NDK to QtCreator as new gcc toolchain and Qt version (simply by pointing to qmake executable). After this you'll be a happy user of QtCreator which builds apps for the BB10 device :smileyhappy:



That wouldn't give any of the deployment & debugging options, would it?

__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Please use plain text.
Developer
trollixx
Posts: 60
Registered: ‎04-18-2012
My Device: BB10 Dev Alpha C

Re: [HOWTO] Getting started with "raw" QML on BB10 Native SDK

Currently yes. But I haven't tried qnx/blackberry plugin for QtCreator by KDAB yet, it should do the job.
--
Oleg Shparber
Please use plain text.
Developer
connyhald
Posts: 102
Registered: ‎06-03-2012
My Device: Playbook

Re: [HOWTO] Getting started with "raw" QML on BB10 Native SDK

I'm using a QtSDK that has those plugins bundled (not sure where I've got it from) and it works fine. I can build, deploy and run from QtCreator just fine :smileyhappy:

 

-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
Developer
lildeimos
Posts: 60
Registered: ‎05-21-2012
My Device: DA C, Z10 LE

Re: [HOWTO] Getting started with "raw" QML on BB10 Native SDK

[ Edited ]

I have cloned qnx-qt-creator from gitorious and installed BB10 NDK.

When I tell Qt Creator to add a new Qt Version pointing it to

/opt/bbndk-10.0.4-beta/host/linux/x86/usr/bin/qmake it tells "The default mkspec symlink is broken".

And what should I put in Toolchain under "Compiler path", "ABI", "debugger" and "mkspecs" ?

I am using Debian sid 64 bit

 

thanks for any hints

Please use plain text.
Developer
connyhald
Posts: 102
Registered: ‎06-03-2012
My Device: Playbook

Re: [HOWTO] Getting started with "raw" QML on BB10 Native SDK

Hi lildeimos,

 

I'm still using the Playbook SDK instead of the BB10 SDK. It basically does the same but more stable :smileyhappy:

Selecting qmake did work for me and I think the toolchain was automatically detected. There is however a problem with the default mkspec in BB10 SDK. I never fixed it properly because so far I've used the BB10 SDK only from command line and there appending "-spec unsupported/blackberry-armv7le-g++" to the qmake call was enough. If you find a way to set that mkspec as a default it should fix your problem.

 

I've created to screenshots that show my Qt Creator setup. Maybe it helps.

http://twitpic.com/a49a84/full

http://twitpic.com/a49acs/full


 
-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
Developer
helex
Posts: 291
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook

Re: [HOWTO] Getting started with "raw" QML on BB10 Native SDK

Great example, Jaffa! :smileyhappy:

 

Works so far for my testing project. But I have a problem with the makefile.

 

You've edited it yourself?

 

My project compiles just great inside the BB10 native SDK using the makefile the SDK generated for the example. But as soon as I start QtCreator and compile my project there for the N9 the makefile gets modified and after this I'm unable to compile the project again in the BB10 SDK.

 

Have you got similar issues while testing or let your QtCreator the makefile untouched?

 

Has anyone a Idea how to use just both files with just different naming?

It would be the preferred soultion for me.

 

Please use plain text.
Developer
Jaffa
Posts: 34
Registered: ‎06-19-2012
My Device: BlackBerry Z10 Ltd Edition

Re: [HOWTO] Getting started with "raw" QML on BB10 Native SDK

Have you got similar issues while testing or let your QtCreator the makefile untouched?

Qt Creator leaves my Makefile untouched. In fact, it never touched it as, before this, it just had a single target in it for updated debian/control.

__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Please use plain text.