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
New Developer
Posts: 88
Registered: ‎06-16-2012
My Device: N950/E7/N808/N9/X7/BB10 Alpha
My Carrier: Kievstar
Accepted Solution

ToolBar equivalent

Hi

 

is there is an equivalent for qt component's ToolBarLayout in Cascades?

 

Thanks

Qt/Symbian/Meego/BB10/Cascades developer
Retired
Posts: 138
Registered: ‎05-11-2012
My Device: Developer
My Carrier: Developer

Re: ToolBar equivalent

There are several options such as Action Items, including Action Item Overflow as well as Application Menu's

or Tabbed Panes that should meet your requirements. The style guide below should give you some ideas of what is available and the documentation for the individual classes can give more details.

 

http://docs.blackberry.com/en/developers/deliverables/41577/menus.jsp

 

 

Developer
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700
My Carrier: Bell, Rogers

Re: ToolBar equivalent

Style guidelines are not exactly helpful without sample code to go along with them. I have yet to see example code for pull down applications menu.

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
Retired
Posts: 138
Registered: ‎05-11-2012
My Device: Developer
My Carrier: Developer

Re: ToolBar equivalent

As an example, not complete but hopefully give some ideas.

 

In the QML I added a container into the page and made it not visible - I just used four buttons as a sample, select your the options best suited for you

 

            Container {
                objectName: "AppBar"
                visible: false
                layout: StackLayout {
                    layoutDirection: LayoutDirection.LeftToRight
                }
                Button {
                    text: "Exit"
                    preferredWidth: 300
                    preferredHeight: 100
                    leftMargin: 0
                    rightMargin: 0
                }
                Button {
                    text: "Save"
                    preferredWidth: 300
                    preferredHeight: 100
                    leftMargin: 0
                    rightMargin: 0
                }
                Button {
                    text: "Explode"
                    preferredWidth: 300
                    preferredHeight: 100
                    leftMargin: 0
                    rightMargin: 0
                }
                Button {
                    text: "Delete"
                    preferredWidth: 300
                    preferredHeight: 100
                    leftMargin: 0
                    rightMargin: 0
                }
            }

 

In the App.cpp I added a find child so that I could reference the QML properties.

 

    appBar = root->findChild<QObject*>("AppBar");

 

Also added the slot to toggle the visible property that will be tied to the swipeDown() signal

 

void App::swiped() {

    if (appBar)
     {
         QVariant property = appBar->property("visible");
         appBar->setProperty("visible", !(property.toBool()));
     }
}

 

In main.cpp added the connect to hook up the signal and slot.

 

Hope this helps.

 

Graham