If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
Contributor
A7omic
Posts: 48
Registered: ‎11-03-2011
My Device: Playbook
My Carrier: None

SystemPrompt - Signals and Slots - No Such Signal error

[ Edited ]

I am trying to connect the standard finished signal to my slot for the SystemPrompt and I am getting the following run time error:

 

No such signal bb:: system:: SystemPrompt::finished(bb:: system:: SystemUiResult::Type value)  in ../src/App.cpp

 

my code:

 

    prompt = new SystemPrompt();
    prompt->setTitle("Enter.....");
    prompt->setDismissAutomatically(true);


    // Connect a function to handle the predefined signals
    // for the two standard buttons, Login and Cancel.

     bool success = connect(prompt,
             SIGNAL (finished(bb:: system:: SystemUiResult::Type value)),
             this,
             SLOT (onPromptFinished(bb:: system:: SystemUiResult::Type value)));

 

If I comment out connect then everything executes correctly and the Prompt is shown as it is suppose to be.

 

I beleive I have everything written as it is in the example from SystemDialogs

 

The only difference is that in the SystemPrompt class definition documentation it states:

 

Due to a work around for a Qt Core issue with accessing enums from QML, use result to access the current value instead of the signal argument to avoid runtime errors.

 

So this is what I did above.

 

It must be something simple that I am either not doing or screwed up but I do not see what. 

Please use plain text.
Developer
pepe_ugalde
Posts: 64
Registered: ‎09-10-2012
My Device: Developer
My Carrier: AMX

Re: SystemPrompt - Signals and Slots - No Such Signal error

I'm having the same problem.

 

The weird part is that if I connect another SIGNAL like titleChanged(QString), it runs.

Please use plain text.
Contributor
A7omic
Posts: 48
Registered: ‎11-03-2011
My Device: Playbook
My Carrier: None

Re: SystemPrompt - Signals and Slots - No Such Signal error

I found a work around for the time being.  I declared the SystemPrompt in my Qml and I used onFinished to call my c++ function. I also created a SystemPrompt pointer in my application class, found the Qml object and assigned it to my pointer. By doing this I can change parameters that you cannot do in Qml such as making the input a password input. 

Please use plain text.
Developer
pepe_ugalde
Posts: 64
Registered: ‎09-10-2012
My Device: Developer
My Carrier: AMX

Re: SystemPrompt - Signals and Slots - No Such Signal error

[ Edited ]

I've made some progress.

 

This is my code:

 

    // Label the two standard buttons with specific text.
    // Add a custom button for more stuff.
    SystemDialog *dialog = new SystemDialog("one", "two");
    dialog->setTitle("title");
    dialog->setBody("bodeh");

    // 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::smileyfrustrated:ystemUiResult::Type)), //omitted "type"
            this, SLOT (appVerDialogFinished(bb::system::smileyfrustrated:ystemUiResult::Type)));
    Q_ASSERT(success);
    Q_UNUSED(success);

    // Now show the dialog in your UI

    dialog->show();

 

The dialog does appear, I've yet to test it. Pressed the first button and nothing happened, but pressing the second button dismissed the dialog.

 

The example is very strange, (The SLOT receives 2 parameters, no comma between SIGNAL and "this", etc.) may be part of a conspiracy...

 

 

Please use plain text.
Developer
pepe_ugalde
Posts: 64
Registered: ‎09-10-2012
My Device: Developer
My Carrier: AMX

Re: SystemPrompt - Signals and Slots - No Such Signal error

It didn't disappear on the first click because I was showing the dialog twice (DERP)

When clicked it prints the values "2" and "3", which according to SystemUIResult Reference they mean

None = 0, ButtonSelection = 1, ConfirmButtonSelection = 2, CancelButtonSelection = 3, TimeOut = 4, Error = 5, CustomButtonSelection = 6

 

Also, I noticed that if after showing it I leave this line

dialog->deleteLater();

the dialog never appears...

Please use plain text.
Developer
nareshkodumuri
Posts: 125
Registered: ‎04-28-2012
My Device: BlackBerry 9800
My Carrier: BlackBerry

Re: SystemPrompt - Signals and Slots - No Such Signal error

Hi,

 

    I think this is the problem, while connecting just give parameter type don't give name in signal and slot connect fuction in .cpp file like this,

 

QObject::connect(prompt,SIGNAL(finished(bb::system::smileyfrustrated:ystemUiResult::Type)),this,SLOT(onDialogFinished(bb::system::smileyfrustrated:ystemUiResult::Type)));

 

Not like this

 

 connect(prompt, SIGNAL (finished(bb:: system:: SystemUiResult::Type value)),this, SLOT (onPromptFinished(bb:: system:: SystemUiResult::Type value)));

 

I think this will solve ur problem.

 

Regards,

Naresh Kodumuri.

Please use plain text.
Developer
rashm2k
Posts: 18
Registered: ‎10-12-2012
My Device: Playbook
My Carrier: none

Re: SystemPrompt - Signals and Slots - No Such Signal error

yes nareshkodumuri is correct you only pass the method signature not the parameter name.

 

Problem is signal are only evaluated a runtime so you don't get no errors until you run it.

Please use plain text.