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
connyhald
Posts: 102
Registered: ‎06-03-2012
My Carrier: *

Re: Couple of questions coming from 'pure' QML and Symbian/Harmattan Qt Components

Thank you peter9477. Of course it is possible to run pure Qt apps - I've already done that and I'm quite happy with the result. With porting I mean changing the app in a way that it looks native. That would include using Cascade elements but also mixing them with custom controls that have been build using QtQuick elements. E.g. I have a very capable text widget that I'd like to reuse, but for the rest of the app I'd like to use Cascades to make it look nicely on BB10.

Well even if I'm not happy about it, it is good to know that mixing QtQuick and Cascades is not possible. It will save me a lot of time trying :smileyhappy:

As for the other questions I hope that someone will answer them later. Of course, if I find the answers by myself I'll post the results here.

A few (off-topic) notes about Harmattan:
Harmattan is the OS running on the Nokia N9 and N950. Apps are written using QtQuick and Qt Components. QtQuick provides basic elements like Item, Rectangle, MouseArea, Flickable, etc. and Qt Components provide higher level elements like Page, Button, etc.
Basically Qt Components provide elements like Cascades, but the Qt Components are implemented on top of QtQuick and therefore QtQuick code and Qt components can (and even must) be mixed.
-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
BlackBerry Development Advisor (Retired)
gperry
Posts: 138
Registered: ‎05-11-2012
My Carrier: Developer

Re: Couple of questions coming from 'pure' QML and Symbian/Harmattan Qt Components

If you look at the WeatherGuesser sample app, this has some good examples of the use of title bars and the navigation buttons.

 

If this does not address your issues post some particular questions and we will try and get some answers for your specifics

 

Regards

Graham

Please use plain text.
BlackBerry Development Advisor (Retired)
gperry
Posts: 138
Registered: ‎05-11-2012
My Carrier: Developer

Re: Couple of questions coming from 'pure' QML and Symbian/Harmattan Qt Components

[ Edited ]

Addressing original points 4 and 5

 

4) Title is essentially a label at the top of the page. WeatherGuesser sample app does a good job of wrapping the title in its own qml file PageTitle.qml and using an alias to refer to the text element, all you are interested in really, in other qml files. It is quite neat.

 

5) The action buttons on the bottom are implemented by action bars outwith the regular qml, for example.

 

      actions: [
          ActionItem {
              title: "Reset"
              imageSource: "asset:///images/icon_home.png"
              onTriggered: {
                         myLabel.text = 0;
                  }
              },
          ActionItem {
              title: "South"
              imageSource: "asset:///images/icon_favorites.png"
              onTriggered: {
                   myLabel.text = 90;
                   }
              },
          ActionItem {
              title: "West"
              imageSource: "asset:///images/icon_info.png"             
              onTriggered: {
                  myLabel.text = 180;
                  }
              },
           ActionItem {
               title: "East"
               imageSource: "asset:///images/icon_continents.png"
               onTriggered: {
                    myLabel.text = 270;
                    }
               }
                            
             ]

This allows you to ontrol the bottom row on the page.

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

Re: Couple of questions coming from 'pure' QML and Symbian/Harmattan Qt Components

Thanks for the answer gperry. It look like I was not clear enough with my questions and I'm trying to be more precise this time.

 

Titles

To answer my initial question shortly: There is no Title component, you have to do your own.

That's fine, just tell me. Actually I was hoping that the SDK provides a default Title element. Not because I'm lazy but for the sake of consistency. If every developer creats his/her own title element we won't have consistency between apps.

 

Anyways, the title element I originaly was interessted is this one: http://twitpic.com/9u3gzz

To me it sounds like they are described here: http://docs.blackberry.com/en/developers/deliverables/41577/title_bars.jsp

But without image in the UI guidelines it's really difficult to guess.

 

Delete Action

Here the important aspect was "...action on the bottom of the ActionBar overflow menu..."

I know how to create ActionItems, that simple and documented. But how to place one action at the bottom of the overflow menu?

It should look like this: http://twitpic.com/9u3msk and is documented here: http://docs.blackberry.com/en/developers/deliverables/41577/action_bars.jsp

 

The only way I found to do that was inserting empty ActionItems into the actions array. Is that the recomended way?

 

Stock Icons

Here my question was not how I can add my own icon to an ActionIcon, but how I can access default/stock icons. Those would be icons that do ship with every device and can be used by all applications. Here again my concern is consitency.

 

From your answer I assume that there is no concept of stock icons on BB10. Right?

 

 

Sorry for bothering you again and again. I just feel that I need this information to be able to develop good looking apps for BB10. I think (and hope) that this is in your interest as well.

 

Thanks!

Conny

-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
BlackBerry Development Advisor (Retired)
gperry
Posts: 138
Registered: ‎05-11-2012
My Carrier: Developer

Re: Couple of questions coming from 'pure' QML and Symbian/Harmattan Qt Components

Hi, Apologies for the delay in answering but it took me a lot of digging to get the info as it was not easy to locate.

 

According to the BBJam session the ability to control the position of the buttons on the action overflow is a future enhancement, If you look at the snapshot below the picture app is using blank action items to provide a separation between Favourite and Delete. This was the only way I could find to have any control over position when I was trying control, certainly the action items right now have very little other than title and the icon to be controlled.

 

 

 

As far as the default icons are concerned I have not got an answer on that subject yet but I will continure to investigate.

 

Graham

Please use plain text.
BlackBerry Development Advisor (Retired)
gperry
Posts: 138
Registered: ‎05-11-2012
My Carrier: Developer

Re: Couple of questions coming from 'pure' QML and Symbian/Harmattan Qt Components

Been through all the sample apps and can find no use of "default:" icons - everything is relating to png files in the assets sub dir. The only thing that changes is sometimes the apps are using model xml files to tie in the buttons

to the png files but that is just organisation and it still requires the png files to be present.

 

If I come across some examples of default icons I will post on here.

 

Graham

Please use plain text.
Developer
Ebscer
Posts: 822
Registered: ‎08-31-2009
My Carrier: Verizon

Re: Couple of questions coming from 'pure' QML and Symbian/Harmattan Qt Components

There are some icons avaliable from the bbui.js project https://github.com/blackberry/bbUI.js/tree/master/samples/images/icons


Read my thoughts on BlackBerry Development at news.ebscer.com
Please use plain text.
Developer
connyhald
Posts: 102
Registered: ‎06-03-2012
My Carrier: *

Re: Couple of questions coming from 'pure' QML and Symbian/Harmattan Qt Components

Thanks everyone for the input. I'll summarize the answers here and mark it as a solution. I hope that's ok.

 

1) It looks like I cannot use plain QML elements like Rectangle in Cascades. Is that right or is there maybe a Cascades wrapper element that allows me to use plain QML elements inside? If there is no such thing, what is the equivalent to Rectangle and especially Flickable?

 

Right, you cannot mix QtQuick items with Cascades items, so you cannot use Rectangle, Flickable, etc. in a Cascades app. Also it looks like it will be difficult to write a wrapper element to include QtQuick items into Cascades because Cascades uses a fundamentally different graphics architecture.

 

 

2) How can I integrate a QGraphicsItem? In pure Qt I can simply export it from C++ and use it inside QML, but that does not work with Cascades. Do I have to implement bb::cascades::Control or even bb::cascades::VisualNode?

 

You cannot integrate QGraphicsItem for the same reasons given in 1).

 

 

3) Cascades itself is not open-source, or is it? (I was looking on how to implement my own Control)

 

Cascades is not open-source.

 

 

4) The UI guidelines talk about a Title Bar. What's the corresponding Cascades element?

 

There is no ready-made Cascades element. You should create your own.

 

 

5) The UI guidelines suggest to place the 'delete' action on the bottom of the ActionBar-OverflowMenu. How do I do that?

 

This is currently only possible using empty action items. However, doing it properly is planned for a future release.

 

 

6) How can I access icons from default actions like 'new', 'previous', 'next', 'play', 'pause', 'favorite', etc...?

 

There is currently no mechanism to access default icons. However, there are a couple of icons in bbui.js here.

 


-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.