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
Highlighted
Developer
Developer
Posts: 46
Registered: ‎02-22-2012
My Device: Developer
My Carrier: Various

More Signal/Slots grief + SystemDialog

 

4 hrs later....

 

Given the content at end of thread:

 

http://supportforums.blackberry.com/t5/Cascades-Development/SystemPrompt-Signals-and-Slots-No-Such-S...

 

perhaps someone from BB can fix the 'documentation' at

 

https://developer.blackberry.com/cascades/documentation/ui/dialogs_toasts/sysdialogs.html#pat1340376...

 

so the exaple code might actually work.

 

In particular the C++ code as copied below on the page is just wrong.

 

void App::showDialog() {
 
    // Set up the dialog with a title, some body text, 
    // and an custom button. Don't forget to set it to
    // dismiss the dialog automatically.
 
    // Label the two standard buttons with specific text.
    // Add a custom button for more stuff.
    dialog = new SystemDialog("I accept", "More stuff", "I decline");
    dialog->setTitle("My Dialog Title");
    dialog->setBody("This is the body of my dialog. " +
         "I can put valuable information in here.");
    
    // Connect your functions to handle the predefined signals for the buttons.
    // The slot will check the SystemUiResult to see which button was clicked. 
 
    bool success = QObject::connect(dialog,
            SIGNAL (finished(bb::system:Smiley FrustratedystemUiResult::Type value))
            this,
            SLOT (onDialogFinished()));
 
    Q_ASSERT(success);
    // Indicate that the variable success isn't used in the rest of the app,
    // to prevent a compiler warning
    Q_UNUSED(success);
 
    // Now show the dialog in your UI
 
    dialog->show();
}