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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

Regular Contributor
Posts: 56
Registered: ‎08-21-2012
My Device: BB10
My Carrier: RIM

How to set Application Menu in BB10?

[ Edited ]

I've set Menu programatically in my application. Application Menu works fine in portrait mode when i swipe down from top of the device. When I set orientation mode to landscape there's no response on swipe down from top.


Here's what I've coded in app.cpp file



QmlDocument *qml = QmlDocument::create("main.qml");
AbstractPane *root = qml->createRootNode<AbstractPane>();

Menu *menu;

QObject *aItem1 = root->findChild<QObject*>("aItem1");   // have created action  items in main.qml
ActionItem* mActionItem1;
mActionItem1 = qobject_cast<ActionItem *>(aItem1);

QObject *aItem2 = root->findChild<QObject*>("aItem2");
ActionItem* mActionItem2;
mActionItem2 = qobject_cast<ActionItem *>(aItem2);

QObject *aItem3 = root->findChild<QObject*>("aItem3");
ActionItem* mActionItem3;
mActionItem3 = qobject_cast<ActionItem *>(aItem3);

QObject *aItem4 = root->findChild<QObject*>("aItem4");
ActionItem* mActionItem4;
mActionItem4 = qobject_cast<ActionItem *>(aItem4);

QObject *aItem5 = root->findChild<QObject*>("aItem5");
ActionItem* mActionItem5;
mActionItem5 = qobject_cast<ActionItem *>(aItem5);

menu =






inside main.qml 


import bb.cascades 1.0

NavigationPane {
id: navigationPane
Page {
content: Container {
background: Color.White
Label {
text: ""
actions: [
ActionItem {
id: aItem1
objectName: "aItem1"
imageSource: "asset:///images/user_guide.png"

// ActionBar.placement: ActionBarPlacement.OnBar
onTriggered: {


Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: How to set Application Menu in BB10?

Thank you for finding and clearly describing this issue.

Please vote for https://www.blackberry.com/jira/browse/BBTEN-192



Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: How to set Application Menu in BB10?

Hi smacmartin,

Do we need to make custom application menu or in future update of BB10 we have resolve this issue?

Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: How to set Application Menu in BB10?

The menu is there: I've seen it on some of the swipes in landscape.  It seems to be the swipe that is the issue.  You should not have to adjust the menu if you turn sideways -- the menu is attached to your application, not to the page, so if you adjust the UI for the current orientation that shouldn't affect the menu.



Posts: 305
Registered: ‎02-14-2012
My Device: BlackBerry Passport / Nokia N950
My Carrier: -

Re: How to set Application Menu in BB10?

Thanks a lot for your example. I was going crazy because I were unable to connect a signal using the example from the official documentation. With your code it works just great.


A small improvement. In my opinion it is more elegant to use directly ActionItem Objects:


In your .h:

ActionItem *mActionItem;

 In your .cpp code:


Menu *menu = Menu::create();
mActionItem = root->findChild<ActionItem*>("ActionItemTest");

// accessable:



And I have used a TabbedPane in my code and were unable to add a ActionItem to it. So I added it like this:


  attachedObjects: [
        ActionItem {
            id: aActionItem
            objectName: "ActionItemTest"
            imageSource: "test.png"
            onTriggered: {

 Just in case somebody is facing the same problem. Smiley Happy


Posts: 84
Registered: ‎07-22-2011
My Device: bb-9550,bb-9700
My Carrier: bb developer

Re: How to set Application Menu in BB10?

Hi All,


I have a doubt ,can we change the background color of action item.If it so how can we change?

plzz help needed urgently.



Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: How to set Application Menu in BB10?

According to docs there is no property that would allow you to change background color of ActionItem

Posts: 84
Registered: ‎07-22-2011
My Device: bb-9550,bb-9700
My Carrier: bb developer

Re: How to set Application Menu in BB10?



Yes according to the docs there is no property,but is there is any other way to change the default background color.