The sample does not not on the BlackBerry website

Hi, again I am trying to run an example of BlackBerry web site. This time, this one:

"C++ objects in QML injection" (the last section at the bottom) - page:

https://developer.BlackBerry.com/Cascades/documentation/dev/integrating_cpp_qml/index.html,

This is my code:

CPP file

#include "CombineCppAndQml.hpp"

#include 
#include 
#include 

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

using namespace bb::cascades;

CombineCppAndQml::CombineCppAndQml(bb::cascades::Application *app)
: QObject(app)
{
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    qml->setContextProperty("injection", this);
    AbstractPane *root = qml->createRootObject();
    app->setScene(root);
}

void CombineCppAndQml::injectContainer()
{
    // Creates the container and adds it to the root
    // container in qml
    mRootContainer->add(Container::create()
        .background(Color::Red)
        .preferredSize(200,200)
        .bottomMargin(20)
        .horizontal(HorizontalAlignment::Center));
}

PPS file

#ifndef CombineCppAndQml_HPP_
#define CombineCppAndQml_HPP_

#include 

 #include 
#include 

namespace bb { namespace cascades { class Application; }}

using namespace bb::cascades;

class CombineCppAndQml : public QObject
{
    Q_OBJECT
public:
    CombineCppAndQml(bb::cascades::Application *app);
    virtual ~CombineCppAndQml() {}

    // By using Q_INVOKABLE we can call it from qml
    Q_INVOKABLE void injectContainer();

private:
    Page *appPage;
    Container *mRootContainer;
};

#endif /* Test_Hpp_ */

and the qml file on the Web Site.

import bb.cascades 1.0

Page {
    // Allows the user to scroll vertically
    ScrollView {
        scrollViewProperties {
            scrollMode: ScrollMode.Vertical
        }
        // Root container that containers from C++ are added to
        Container {
            objectName: "rootContainer"
            layout: StackLayout {}
            // Button that calls the C++ function to add a
            // new container. The selectedIndex from the drop down
            // is passed to C++.
            Button {
                text: "Add container"
                onClicked: {
                    injection.injectContainer();
                }
            }
        }
    }
}

When I run it, I actually see the button, but when I click it to open the second container, my application gets reduced to the place to show the new container.

PPS. I also have a class separate main.cpp which calls the class CombineCppAndQml.

Any help much appreciated.

Please add the following line to your CombineCppAndQml constructor

mRootContainer = root-> findChild(("" rootContainer"'));

 

CombineCppAndQml::CombineCppAndQml(bb::cascades::Application *app)
: QObject(app)
{
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    qml->setContextProperty("injection", this);
    AbstractPane *root = qml->createRootObject();
    app->setScene(root);

    mRootContainer = root->findChild("rootContainer");
}

-Dishooom

--------------------------------------------------------------------------------------------------------------------------------

Hope this helps

 

Tags: BlackBerry Developers

Similar Questions

  • My computer blackBerry smartphones does not recognize my Blackberry curve 932

    My computer does not recognize my Blackberry curve 9320. I follow the help instructions to adjust the administrative settings, but this did not help. Any help or advice would be greatly appreciated. Thanks in advance.

    Maybe this will help. That's how to get BlackBerry Desktop Software to recognize your phone but if BDS recognizes, does your computer. Have a look here:

    www.blackberry.com/btsc/KB10144 .

    I hope that helps you.

  • 10 that the headset does not deal with blackBerry

    My new Passport this problem

    The helmet does not. Answer phone calls on a channel, but it does not work for music, videos and applications of x-rays

    The headphones supplied with the Passport works on blackberry 9900

    Someone had this problem? Any suggestions? Thank you

    Dear,
    I've analyzed all the functions of the passport and one of them is configured with the ATS (TTS), serve as a teletype. What is very interesting. But to turn this off, the helmet worked perfectly. In other words, if configured for teletype, makes no sense to use the headset. Will be? Was configuration. Could not be the software because the passport version is 10.3.0.908.

  • BlackBerry.Launch.newmap sample does not work

    Hi people,

    I try to open the maps app from a web page. I was able to start the maps app, but it does not show the location. Now, I'm not even able to open the application. I use the example of code to:

    http://docs.BlackBerry.com/en/developers/deliverables/11849/blackberry_launch_971534_11.jsp#Blackber...

    that is to say:

    blackberry.launch.newMap({)
    "latitude": 4346518,
    "longitude":-8052237
    });

    I also use in similar problems with the launch.newContact and the launch.newAppointment. I can't get the dates informed correctly according to the examples.

    I coded the javascript code in an asp.net page that is published on my local web server and I am accessing the page via the simulator of blackberry 9800.

    Anyone have any ideas?

    Thank you

    Carlo.

    Well, I think I found the solution. I put in the code samples and I managed to get it to start up the card. I reduced the code until I'm at the point where I found that what missed me was:

    blackberry.location.refreshLocation ();

    I called who, before calling the launch.newMap. Is this really what was needed or is it just a case of what I call the programming of pasta: throw the code to it and when when something sticks, it's done.

    Thank you

    Carlo.

  • using firefox 24, yahoo toolbar disappears and the keyboard does not work on some websites

    We have installed firefox 24, yahoo toolbar sometimes disappears. On some web site when trying to enter a password, the keyboard does not work until you double click of the mouse on the registration form. This on two different systems of windows 7. Each thin seemed to work fine before the update prior to the installation of 24.

    Hello

    Try Firefox Safe mode to see if the problem goes away. Safe mode is a troubleshooting mode, which disables most of the modules.

    (If you use it, switch to the default theme).

    • Under Windows, you can open Firefox 4.0 + in Safe Mode holding the key SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac, you can open Firefox 4.0 + in Safe Mode holding the key option key when starting Firefox.
    • Under Linux, you can open Firefox 4.0 + with leaving Firefox then go to your Terminal and running Safe Mode: firefox-safe-mode (you may need to specify the installation path of Firefox for example/usr/lib/firefox)
    • Or open the Help menu and click on the restart with the disabled... modules menu item while Firefox is running.

    Once you get the pop-up, simply select "" boot mode safe. "

    If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, and you need to understand that one. To do this, please follow article Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems .

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. It might help others who have the same problem.

    I hope this helps!

    Curtis

  • the audio control panel does not appear on various websites which I am sure they are there. I see them in IE and chrome, but not in FF

    The audio control panel does not show simply. On this site, I should see the control panel. http://www.testplek.annemariebeeke.nl/huiswerkopdracht_week3_bonus.html.
    It does not show in the other browsers, other people can see it, but I can't.
    Even with these sites:
    http://www.jokevan.nl/HTML5/oef3-3.html
    http://kokenvoorpapegaaien.nl/Kellerhuis/oef3-3.html

    Reload Web pages, and ignore the cache.

    • Hold SHIFT and click reload.
    • Press 'Ctrl + F5' or 'Ctrl + Shift + R' (Windows, Linux)
    • Press 'Cmd + Shift + R' (MAC)

    Clear the cache and cookies from sites that cause problems.

    "Clear the Cache":

    • Tools > Options > advanced > network > storage (Cache) offline: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Tools > Options > privacy > Cookies: "show the Cookies".

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance/themes).

  • getJSON ask mobile jquery does not work on Blackberry App

    I have a mobile application of small jquery for the blackberry platform. In emulator undulation, Chrome plugin, works fine all getJSON demand, but in RIM (blackberry 9300) Simulator with the brand app by PhoneGap Build getJSON demand do not recover the data, show the spinner of the loading in infinite loop.
    Could be something in the configuration file? Many thanks for any help!

    Configure you an element of access for the domain that you are applying to? You need to whitelist your application needs to communicate with the areas. Ripple of does not apply this rule.

    http://www.mydomain.com" subdomains="true">
       
    
    

    https://bdsc.webapps.BlackBerry.com/HTML5/documentation/ww_developing/Access_element_834677_11.html

  • _doPostback(), calendar and dropdown control does not work on blackberry: RIM's support that?

    Hi all

    I develop mobile site in ASP.NET 2.0, which should work on most common browsers includes blackberry.

    but javascript _doPostback(); fuction does not work, also dropdown selectedIndexChange event also does not work.

    drop-down list and calendar control internally uses _doPostback().

    RIM who makes? If not, then what is the alternative for the drop-down list (I have a lot on my pages).

    Please, give me your feedback if RIM supports _doPostback(); or not.

    Thanks in advance.

    great! It works fine now.

    Thank you all for posting.

  • My computer blackBerry smartphones does not recognize my blackberry

    Hello.

    I need help with this, my computer does not detect my BB when I try to open the memory card from my computer, there is no icon for it ...  I tried to remove the battery for a minute, but it did not work, the USB cable works fine because whenever I connect the usb cable from my computer, there is a clock on the screen of my Blackberry... I don't know what else to do!

    any suggestions?

    Thank you

    Hello and welcome to the community!

    Make sure that:

    (1) you have already installed the RIM desktop software:

    (2) you have enabled the mass storage Mode:

    • KB11879 What is the mass storage mode

    Are you able to see the memory of your device? With the foregoing duly filled, you should see drive extra two letters in Windows... one for the memory of the device and the other for a press card.

    Good luck and let us know!

  • Applications for blackBerry Smartphones does not open on Blackberry Bold 9780 after download of Blackberry App World

    My applications are not open on Blackberry Bold 9780 after their download of Blackberry App World.  They complete the download, they are free applications.  When I press the button to open the application, it does absolutely NOTHING.  I don't know what else to do, so I have remove off the 9780.  Please help me! -Jennifer

    I guess what I'm confused about this... is if we are going to solve all the apps that does not open, and now you have removed people... How shall we proceed?

    Who is?

    Let me to this Counsellor... Once you have downloaded an app from AppWorld, even if you are not invited to do, once the app is installed, make a simple reboot on the BlackBerry this way: with smart BlackBerry poweredphone, remove the battery for a minute and then reinsert the battery to restart.

  • Update blackBerry torch 9810 blackberry Smartphones does not start after BlackBerry Protect?

    be on the alert for blackberry protect the update and installed upward and went to restart now. my blackberry 9810 torch is now as it restarts and will not return. need help ASAP!

    You are able to reboot your device in SafeMode as shown in KB17877?

    I guess, because it is taken in a reboot cycle, when you connect to the desktop software it does not have a stable connection to reinstall your software?

    If this is the case, remove the battery and keep it off when you connect to the desktop software. You will get a pop up that the device cannot connect and there should be buttons retry, update and cancel. Select Update and you will then be able to reinstall the latest version of the device software.

    When the load progresses, you will see a step that says "waiting for initialization of the devices '. At this point, insert the battery and recharging must complete.

  • BlackBerry Storm 2 9550 smartphones does not register in BlackBerry service.

    Hi guys

    I bought a Blackberry Storm 2 9950 of Verizone the United States 16 months ago and after two months I went to live in the Mexico. I got my unlocked BB and I used services Movistar with any problems until two months ago that I started facing problems for you to connect.

    I went to check this with Movistar carrier here at the Mexico, but support guys told me that it is a device of another company that they can help with configuration problems, or does not endorse her. He suggested me to throw it in the trash and buy another of his company.

    I think there could be a solution for this, I tried configuring it by my self audit as much as I could to support blogs.

    Can someone BB help? or I have to buy another phone brand and forget anithing on blackberry devices?

    concerning

    Saul

    Hi guys

    I got my Blackberry Storm 2 work back Friday last 13 overnight. I don't really know what had happened or who I have to thank for this one. But I'm happy to have my camera works again.

    I did not change any configuration, any more than some adjust I found here in this forum.

    So please consider this problem solved.

    Concerning

    Saul

  • Does not update Smartphones blackBerry Bold 9700 OS 6

    Hi all - have decided to, because I think I broke my BB lol as if by magic...

    Basically, it will not be updated to 6, but he gets about half or 3/4 in and decides to restart the presentation "Fatal error...". "and the unit restarts

    At first I thought it was restarted due to suspicious requests because it was a recent problem, so I completely formatted it (something that I usually refuses to do) and tried again just there and still no joy

    Currently in version 5.0.0.59 3, O2 UK

    Has anyone else had the same problem and if so how topped? Any help at all would be really appreciated :-) Incase you did not understand, I'm totally distraught!

    Thank you

    try to remove the SIM card and SC during this operation.

    Manual device OS upgrade instructions:

    1. start by searching for your operator and the system operating file that you want to use.

    http://NA.BlackBerry.com/eng/support/downloads/download_sites.jsp

    2. make a backup of your device first, using Desktop Manager > backup. Close at the end Office Manager and disconnect it from BlackBerry. Get DM here http://us.blackberry.com/apps-software/desktop/

    3. download the OS files to the PC then install on the PC by running (double click) the downloaded file.

    4. go into c:\program files Research in motion\apploader and delete the file named "vendor.xml."

    5. This step is not necessary unless there is a problem on the next steps. Use BBSAK from BBSAK.org and wipe the device (after doing a full backup), then after you get the 507 error (no OS installed) then proceed to step 6

    6 remove the internet connection for PC and reboot the PC.

    7. plug the BlackBerry and double-click on "Loader.exe." It is located in the same place as the above vendor.xml file was in.

    8. If you did step 5, restoration of the back upward. Follow this KB if necessary http://www.blackberry.com/btsc/KB10339

    Take advantage of the new operating system.

  • BlackBerry Smartphones my PC does NOT recognize my Blackberry Curve 8330 at all!

    I'm at the end of the roll, trying to figure out this question. My Blackberry Curve 8330 just will be not recognized my Vista PC running at all.

    Here's what I know:

    -My phone was purchased new may 9. It's the Verizon service, so what matters.

    -My phone has a microSD inside memory card.

    -(Home and car chargers) USB charge cords work to charge my phone. I see the icon taken directly to the left of the battery and it stays there until I have unplug the unit.

    -I tried different USB cords to connect my phone to the PC and nothing works. When I plug in, the phone displays the icon card very briefly and then disappears. Nothing appears in the device for the USB slots Manager, either.

    -All USB slots are the same, even those at the back of the computer.

    -Other USB devices (iPod, for example) work very well.

    -Ce How - to guide: http://supportforums.blackberry.com/rim/board/message?board.id=BlackBerryDesktopSoftware&thread.id=3...

    I uninstalled Desktop Manager and installed the USB/Modem drivers (as it says). Those that I have used is worm. 4.7. still nothing. I restarted the computer and still nothing. This solved nothing. (Even used such 4.5 recommended in this thread, and it does not, either.)

    What exactly should I do to get my PC recognise the Blackberry? I can't do some of the things I want to do until this issue is resolved. Because the USB port works to load, then I think that it must be my computer, but where the conflict is and how to fix it, I don't know.

    Any help would be appreciated. Thank you!

    Believe it or not, this problem has been resolved by the simplest of ways - simple up to what I feel embarrassed!

    Know how they say when he's broke to book on I have and it works? Well I hate to be energetic on electronics, but I hit just the USB cable in the port of the BB curve. Then it started working like a charm.

    All that stress and all I had to do was show some muscle.

    After that it would not recognize the device in Windows as a mass storage device. This has been fixed by the backup of the memory card on the PC to save my pictures then insert into the BB and put in shape. At that time I also found instructions online to change the drive letter of the mass of the F: BB storage device a letter less used to resolve a conflict.

    My BB Curve is perfect now and all we needed was the strength to fix. Again, I can't wait to beat him and mistreating my electronics but sometimes it works!

    In conclusion, please don't make me feel too embarrassed lol.

  • my laptop does not recognize my blackberry 8520 so I can't upload photos from phone

    I connect my backberry 8520 to my laptop but it is not recognized as a storage of mass so down, I can not load my oss phone photos have been in full view of web backberry and re of the device, but this has not cured the problem they recommend to ask u

    Hi mariajanepicanoborde,

    1. were you able to use the BlackBerry smart phone before?

    2. have you done any hardware changes or software on your computer before this problem?

    You can follow this link & check if the problem persists:

    The BlackBerry smartphone is not detected as a USB mass storage device when connected to a computer

    Hope the helps of information.
    Please post back and we do know.

  • MIME headers in email does not get for Blackberry

    I get an email in Exchange that contains several headers, including some custom who have been deliberately added to the email.

    However, some of these headers (including custom) do not reach through to the BlackBerry - or if they do, I don't see their use

    . getAllHeaders().

    or

    . GetHeader (

    );

    For example, this:

    Content-class: urn: content-classes: message

    don't go to the Blackberry.

    Someone know how I can get these headers to the BlackBerry?

    Essays on OS 4.6 with 9000 "BOLD".  I need this works on 4.6 and above, but it would like on older operating systems as well.

    BES is 4.0 (yes I know...), Exchange 2003.

    as far as I know that some headers are delivered. The rest are stripped. See for a similar ad Message-GetHeader-string-not-returning-all-headers

Maybe you are looking for

  • Could not activate iPhone

    I got iPhone 7 256 Jet Black GB today. I have sirius, problem with the new iPhone, which is is not activated. Here's what I did. Use the Wifi, LTE and iTunes to activate the phone. Phone keeps saying couldn't activate iPhone and iTunes says "your req

  • Pavilion C 500-217: BSOD

    Rec'd the blue screen of death the other day with the message: System_Service_Exception (PSINPROT.sys) I don't see what the file, but do not know what it does and how to fix it. Cannot find anything on the web, so some info and the help I can get is

  • Satellite M50-A-110 - wireless turns down running 8.1 Win

    I've recently bought a portable Satellite M50-A-110 with Windows 8 It is initially connected to my router (but),I could load a page on the browser and the connection then turns down I updated to Windows 8.1, put to update the driver, chose the intel

  • Satellite M30 - BSOD Stop 7F, 0x00000008

    Hi gurus! I have a problem with my Satellite M30 laptop, I turn it on and after completing all procedures of departure (and before doing anything) I get a blue screen with the following error message:STOP 0X0000007F (0 X 00000008, 0 X 00000000, 0X000

  • problems with a Probook s 4530 and earn 8.1 x 64 and card RALINK Wireless

    Good afternoon I have reported a problem with the installation of Win 8.1 Enterprise on a HP Probook 4530 s which has a RALINK RT3592BC8 wireless card installed.  This card has the info printed on it. Rev: 01:00 SPS:630813 - 001 Release date: 2011/05