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
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified
Accepted Solution

SystemListDialog in QML?

Can a SystemListDialog box not be created in QML?  Only C++?  If it can be, can someone provide an example?

 

https://developer.blackberry.com/cascades/documentation/ui/dialogs_toasts/system_dialogs.html#pat136...

 

Thanks.

Developer
Posts: 115
Registered: ‎10-22-2012
My Device: Developer
My Carrier: Mobifone

Re: SystemListDialog in QML?

That link has had an example already

https://developer.blackberry.com/cascades/documentation/ui/dialogs_toasts/system_dialogs.html#pat136...

 

SystemListDialog *listdialog = new SystemListDialog("My favorite",
                                                        "I don't watch movies");
 
    // Set up the SystemListDialog to allow single selection (default).
    // Add a title and append the selection items.
 
    listdialog->setTitle("Oscar winning movies");
    listdialog->appendItem("Argo");
    listdialog->appendItem("Amadeus");
    listdialog->appendItem("Braveheart");
    listdialog->appendItem("Casablanca");
    listdialog->appendItem("The Deer Hunter");
    listdialog->appendItem("The English Patient");
    listdialog->appendItem("Driving Miss Daisy");
 
    // Connect the finished() signal to the onDialogFinished() slot.
    // The slot will check the SystemUiResult to see which button was tapped.
 
    bool success = connect(listdialog,
        SIGNAL(finished(bb::system::SystemUiResult::Type)),
        this,
        SLOT(onDialogFinished(bb::system::SystemUiResult::Type)));
 
    if (success) {
        // Signal was successfully connected.
        // Now show the dialog box in your UI
 
        listdialog->show();
    } else {
        // Failed to connect to signal.
        listdialog->deleteLater();
    }

 



Like my answer if it's helpful. Mark as answer if it help you solve the problem.
Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: SystemListDialog in QML?

Right, the example is in C++. I'm wondering if it can be done in QML, like a regular SystemDialog.
Developer
Posts: 115
Registered: ‎10-22-2012
My Device: Developer
My Carrier: Mobifone

Re: SystemListDialog in QML?

Oh, I understood your question. I'm creating a demo for you



Like my answer if it's helpful. Mark as answer if it help you solve the problem.
Developer
Posts: 115
Registered: ‎10-22-2012
My Device: Developer
My Carrier: Mobifone

Re: SystemListDialog in QML?

Here is what you need, take a look at main.cpp and main.qml

https://github.com/congdanhqx/BB10-Example/tree/master/SystemListDialogQmlDemo

As documented by RIM, SystemListDialog do not track about these Item, so I think this is the only ways to do in QML



Like my answer if it's helpful. Mark as answer if it help you solve the problem.
Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: SystemListDialog in QML?

Perfect! You've been a great help to me, congdanhqx.  I appreciate you taking the time to put that example together.  Thanks again.

Moderator
Posts: 4,139
Registered: ‎06-26-2013
My Device: Curve 8520
My Carrier: Virgin Media (Mobile)

Re: SystemListDialog in QML?

I have locked this topic to new posts as this issue has already been solved

http://supportforums.blackberry.com/t5/Native-Development/SystemListDialog-in-QML/m-p/2362473#M21763
Steve_T                                                                                                                          New to the Community click here  
Community Moderator
Likes2.png    AS3.png    CG2.png