Launch of QObject::connect() app causing crash

Hello

I am trying to learn a few tricks of Cascades SIGNAL and SLOT and want to write a custom slot that sets the value of a slider when you press an ImageView. However, when I include the code of the connect() function in my application, it compiles well but the app crashes during launch of "BlackBerry 10" screen

Here is my code:

 // Create the slider
    Slider* opacitySlider = Slider::create().leftMargin(20.0f).rightMargin(20.0f);
    opacitySlider->setLayoutProperties(StackLayoutProperties::create().spaceQuota(1.0f));
    opacitySlider->setHorizontalAlignment(HorizontalAlignment::Fill);

    // Create the moon icon
    ImageView* moon = ImageView::create("asset:///images/moon.png");
    moon->setVerticalAlignment(VerticalAlignment::Center);

My connection code is here. Note When I connect, Q_ASSERT, put in comment and Q_UNUSED lines, the code works fine:

    bool result2 = connect(moon, SIGNAL(onTouch(bb::cascades::TouchEvent *event)), this, SLOT(zeroOutSlider(bb::cascades::TouchEvent *event)));
    Q_ASSERT(result2);
    Q_UNUSED(result2);

My location is defined as:

void ApplicationUI::zeroOutSlider(bb::cascades::TouchEvent *event){

    if(event->isUp()){
        // Error: opacitySlider is not declared in this scope.
        //opacitySlider->setValue(0.0f);
    }

}

Note that I also comment little opacitySlider-> setValue() which is not recognized and raises a compile error.

I tried using QML and it works fine, but I want to use custom for more elaborate things C++ functions (tried to use this Guide). Thought that I would start to base, but it does not work.

Any help is appreciated

Hello! It seems that the app is not crashing, but stops at Q_ASSERT because connect() fails and returns false. If the logs are configured correctly, you should see an error message as well.

The signal is called 'touch', not of onTouch. 'on' prefix is added to the managers of signals QML. Thus, the correct signal statement is:

SIGNAL (touch (bb::cascades:TouchEvent *))

Parameter names must be omitted in SIGNAL() and SLOT().

To resolve this problem:

// Error: opacitySlider is not declared in this scope.
        //opacitySlider->setValue(0.0f);

opacitySlider can be declared as a member variable (in the header file). It will be accessible to all functions of the class.

Tags: BlackBerry Developers

Similar Questions

  • 9.2 iOS apps causing lag and crash

    Since I updated my iPad 2 for iOS 9.2 apps lag and was crushed, I noticed on my iPhone 6 more as well, but not as bad (probably because the phone is more powerful).  My iPad 2 now can handle running an app for about 5-10 minutes before the shift sets in and eventually blocks the application, this happens with any application, including parameters, etc..  It is a new installation of iOS 9.2.  I did not refresh app in the background running, I turn reduce movement and disable any spotlight search items and anything that can monopolize the active memory.  Unfortunately, it doesn't seem to matter and now my iPad 2 is practically useless to use.  I've never had this problem with previous versions of iOS so I can reload the iOS 8.4.

    I was wondering if anyone else knows the offset of the app and crashes in iOS 9?

    Try to reset all the settings in the settings under general app and in the right column under restore.

    Try stories reset and delete/reset the caches in all web browsers you use.
    If you use Safari, these features may be in the application settings under Safari.
    Other browsers have their settings inside the running application itself.

    If your iPad has been activated for iCloud, in the application settings under iCloud, to the right, under iCloud Drive, type in iCloud drive and make sure that Safari is off to save data from Safari to iCloud by car.

    Also, under iCloud in the application settings, in iCloud Drive, turn the feature off saving for all other desired apps DO NOT the data automatically on iCloud drive.

    If you are using Safari is always causing issues.
    Try changing / using web browser third another, different.
    I do not use iOS Safari too much more because I found it cause me headaches on some Web sites, regularly, to visit.
    I commonly use another third party browser, perfect browser (there are others that can suit your style better web browsing, so look all first to see what third-party browser may work better for you) and I have never experience many questions that Safari was originally.

    In the application settings tab general, right under the spotlight sesrch, try disable the search under the applications who really don't need a research, as some games, remote controls, apps that are really useless to be searched, etc., in order to reduce the list to Spotlight search.

    Try to turn the reduced movement.
    This is found in the application of settings in the general tab, in the left panel.
    In the right panel, look under accessibility, look to reduce the Motion and turn this feature "On".
    You should see a significant performance increase on all models of iPad 2, 3 and 4.

    In the application settings under the general tab, in the right column, search background App update and enable this setting to "off".

    Try a reset of your iPad by simultaneously pressing buttons Home and sleep/wake button until your iPad goes to the dark and restarts with the Apple logo, then release the buttons.

    Good luck!

  • QObjects connection in a plugin webworks

    I want to generate a thread that will be notified from time to time execute something...

    I looked at the following examples:

    http://StackOverflow.com/questions/3213738/QThread-blocking-main-application

    http://Qt-project.org/doc/Qt-4.8/signalsandslots.html

    Basically, taking advantage of the QObject::connect method...

    My project builds fine but need an error in my webworks app when the extension is called, which means that an inclusion on the plugin won't (I got this error too many times before, it is always because of inclusion).

    Remove the line of code that links my objects 2 makes the error disappear at the same time... the behavior of the plugin is not desired...

    Connect is a part of QObject that IS included...

    It was mentioned but nothing much has been heard by myself

    This is useful to you at the point is...

    https://github.com/BlackBerry/BB10-WebWorks-framework

    Unzip that and take a look at ext/bbm.platform

    Apparently something needs to be TemplateJS rather than TemplateNDK

    I am told by TimW its KeepAlive extension to use this trick to get the handle of display (I keep meaning to write an extension of ScreenShot discovered by chance)

    Not a lot of help, I know. Hey, it's a starting point - was not one of those to front

  • Is it possible to open 'manage connections' app?

    Hi guys,.

    Is it possible to open 'manage connections' app?

    My application needs WLAN. So when it starts, I check if wifi is on and if it is connected to the network. If it isn't I would open "manage connections" and allow the user to connect. Is this possible?

    I was looking at the ApplicationManager class but did not understand if it is possible.

    Thanks for the replies

    I got an answer on another forum. It might be useful for someone. The solution is

    try {
             ApplicationManager.getApplicationManager().launch("net_rim_bb_manage_connections");
        } catch (ApplicationManagerException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
        }
    
  • Any attempt to create a keyboard shortcut causes crash hearing?

    I've been running hearing continued for some time.  No problems to speak of.

    I decided to create a keyboard shortcut now.  Instant crash.Screen Shot 2013-05-06 at 3.42.26 PM.png

    I repeated the process several times with the same result.  I rebooted.  I have re-installed Audition.  I've updated to build 5.0.2.  No change.

    iMac 10.8.3, Adobe Audition CS6 build 5.0.2

    So, what are the exact steps series that follow you until the moment of the accident?  Also, could you send a copy of this report to crash OS X to [email protected] ?  You can find this file by launching /Applications/Utilities/Console.app and open the 'diagnostic user reports' whirl down on the right column.  Drag the most recent crash of hearing report in an e-mail message.

    One thing to try as well.  Open Finder, click OK in the menu bar, hold down OPTION and click on the "Library" folder (this is a hidden default folder).  Then go to Preferences/Adobe/Audition/5.0/ and find an old one called "shortcuts" and rename the "Shortcuts.old" then start hearing and try again to create a shortcut.  Is there a change in behavior?

  • How can I get firefox to launch automatically on connection to the internet

    I want that firefox will automatically launch when I connect to the internet

    Put a shortcut to Firefox in your Windows startup folder?

  • I want to cancel an app cause they keep in charge each month but when I cancel it still load

    I want to cancel an app cause they keep in charge each month but when I cancel it still load

    Follow the instructions here to make sure you have completely cancelled the subscription. View, change or cancel your subscription - Apple Support

    -AJ

  • Last updated on Windows 7 cause "Crash Dump" on my computer.

    Last updated on Windows 7 cause "Crash Dump" on my computer. Watch journal update KB2264107 and KB2454826 will not settle. I do a system restore to get back. I tried the "auto update" three times.


    KB2454826 was fired shortly after its initial release, January 11, 2011. Revised (for example, fixed) versions of KB2454826 have been re-published February 8, 2011.

    NB: KB2454826 is an update Important/recommended, it's always an option, not the security update (from this edition). That being said, we now know that KB2454826 is a prerequisite for the update for IE9. As it will probably be a prerequisite update for SP1 of Win7, too, you probably don't want to hide.

    KB2264107 is an option, not the security update. Feel free to hide it.

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • In total, I connect app... When I try to open the camera with quick time just, it is there and goes to white screen

    In total, I connect app... When I try to open the camera with quick time just, it is there and goes to white screen

    Hello

    You can check the link, download the manual to link Total perform operations.
    http://www.centralillinoissecurity.com/resources/documents/TC1.PDF
    You can also check out the Apple support link and view the query.
    http://www.Apple.com/support/QuickTime/
  • When not in Windows service will change screen what ever I've sat and that he go the first screen where it asks who is connect and it crashes my computer

    original title: security

    Here's the question-problem: when not in use Windows will change screen what ever I've sat and go the first screen where it asks who is connect and it crashes my computer. All I have to do is click on the little box that says locked and I go back to what I was doing. I don't want to do this. I have magic jack phone service and when she did this, I do not get calls? Is it possible that turns off. I have only one user of this computer.

    Go to Start\Control Panel\Hardware and Sound\Power Options\Edit the parameters of the Plan

    Change the option put the computer to sleep time forever!

  • right click on windows Explorer causes crash! Sometimes when I try to empty the trash, it also blocks? I use windows 7?

    right click on windows Explorer causes crash!  Sometimes when I try to empty the trash, it also blocks?  I use windows 7?

    Right-click accidents are caused by third-party shell extensions. To identify the culprit, you must use a utility like ShellExView and disable context menus not Microsoft managers one by one (or disable items in a batch) and observe.

    ShellExView - Manager of Windows Shell extensions:
    http://www.NirSoft.NET/utils/shexview.html

    And instructions are here (see "Method 2")
    http://WindowsXP.MVPs.org/slowrightclick.htm

    Ramesh Srinivasan, Microsoft MVP [Windows Desktop Experience]

  • BB10 and BBM connected Apps questions

    1 when he invites to the connected app BBM I can fill in the fields and click on invite-nothing happens

    where did - inviting directly from surveys BBM works instantly.

    2. on the page / screen with the bar scanner/updates / apps - connected app is here. What is a clickable link?

    3 NFC - tap to invite to BBM does not connect?

    These issues are related?

    @MSohm

    Alrighty then.

  • BlackBerry Smartphones Blackberry App World crashes my phone.

    BlackBerry App World crashes my phone. After turning the phone off and on again, I get the following message: untrapped exception application net_rim_bb_appworld (1222) does not respond, the process is complete.

    I tried uninstalling and reinstalling, but it does not appear as an application in the desktop software, so now I don't know what to do at all.

    Help, please!

    Hi and welcome to the Forums!

    Whenever random strange behaviors creep, the first thing to do is a battery pop reboot. With power ON, remove the hood back and remove the battery. Wait a minute, then replace the battery and cover. Power on and wait patiently through the long reboot - about 5 minutes. See if things return to functioning. Like all computing devices, BB suffers from memory leaks and others... with a hard reboot is the best remedy.

    You can uninstall the device itself... Options > Advanced Options > Applications > highlight the App BBAppWorld > BBKey > delete

    Then get the batt restart - again.

    Then try reinstalling the AppWorld.

    Best!

  • RW-50011: error:-connection Apps ORACLE_HOME test returned an error

    HII...


    I was installing r12 on my machine of oel4.
    The installation is completed with error in.

    (1) availability of data base: RW-50011: error:-connection Apps ORACLE_HOME test returned an error
    (2) login page:
    (3) configuration Upload
    (4) JSP


    Unfortunately, I run the rapidwiz as long as user root... will that be a problem. ??? the stage12i is also under different OS users owners with permission set as 777.


    Please suggest any help.


    Thank you.

    /U01/Oracle/prod/inst/apps/PROD_msftrac2/logs/ora/10.1.3/opmn/opmn.log (permission denied)

    Seems like user of the application you want to start to do not has permission on above dir... It should start with the user of the application used when installing... If you use only and then also get the error even then for trial give 777 privs on all the dir apps and see if you are able to move forward.

    Thank you
    JD

  • Cloud creative connection app?

    News on the creative Cloud connection app? When he's ready for us to download? I think that would greatly increase the usability of the CC

    Updated - connecting creative cloud is now on:

    http://blogs.Adobe.com/creativecloud/creative-cloud-connection/

Maybe you are looking for