Adding images dynamically - tutorial for examples does not work

I am using the SDK Gold and work through the tutorials. I want to add dynamically images of C++. The tutorial that I use is here:

https://developer.BlackBerry.com/cascades/documentation/dev/integrating_cpp_qml/ (under the heading "Injecting C++ objects in QML").

I have copy and paste the main.cpp, TestApp.hpp and TestApp.cpp into a new project. He compiled and ran on my device, but when I click on the button 'Add the container' seg application vulnerabilities and ends.

I understand that this is caused by a NULL pointer, so I added:

This-> mRootContainer = new bb::cascades::Container();

for the Builder. Now it does not segfault when I press the button 'Add the container', but again, it does not actually add the container (it adds nothing visible).

How can I use the concepts described in this tutorial to add an image at run time?

I managed to understand. The example provided in the tutorial defnitely badly, which is very annoying and frustrating for those of us learning to code for BB10. Not only that, but the "barrier to entry" is hard enough, and if Blackberry to their ecosystem to flourish, documentation and tutorials must be accurate and easy to follow.

The constructor should be something like:

TestApp::TestApp(bb::cascades::Application *app) : QObject(app)
{
  QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
  qml->setContextProperty("injection", this);
  Page *appPage = qml->createRootObject();
  mRootContainer = appPage->findChild("rootContainer");
  app->setScene(appPage);
}

Tags: BlackBerry Developers

Similar Questions

  • dynamic query for package does not work

    Dear members,

    I have problems with a package in the creation and analysis of a dynamic query in the WHERE clause. Here is an example of what I'm trying to do:

    PROCEDURE test_status_proc)
    wtd_cursor ON cur_type
    date_1 IN date
    date_2 IN DATE
    status in VARCHAR2,
    flag in VARCHAR2)

    IS

    status_sql VARCHAR2 (250): = NULL;
    flag_sql Varchar2 (100): = NULL;

    BEGIN


    Status of the IF = 'A' THEN
    lv_status_sql: = 'A ';
    lv_flag_sql: = 'Y ';
    END IF;
    Status of the 'I' = IF THEN
    lv_status_sql: = 'A ';
    lv_flag_sql: = 'n';
    END IF;

    Status of the 'R' = IF THEN
    lv_status_sql: = "R";
    lv_flag_sql: ='* ';
    END IF;

    Status of the IF = n THEN
    lv_status_sql: = 'n';
    lv_flag_sql: ='* ';
    END IF;

    IF status_code = 'IRN' THEN
    "lv_status_sql: = '('' N'','' R'');
    lv_status_sql: = lv_status_sql | ' OR (s.status = s.flag = "A" AND "N")';
    lv_usecalc_sql: ='* ';
    END IF;

    Status of the = IF'* ' THEN
    lv_status_sql: ='* ';
    lv_flag_sql: ='* ';
    END IF;

    OPEN FOR Test_cursor

    SELECT * from test_status s
    WHERE
    s.Daytime BETWEEN date_1 AND date_2
    S.status AND decode (lv_status_sql,'* ', s.status, lv_status_sql)
    S.flag AND decode (lv_flag_sql,'* ', s.flag, lv_flag_sql);

    The problem I have is especially with the condition 'IRN '. The suite WHERE the part of the clause looks like the following in the lv_status_sql, but the query returns all the values:

    -(', 'R') OR (s.status = 'A' AND s.flag =' only)

    Any help would be much appreciated.

    Kind regards

    dreporter wrote:

    Thanks for your reply and I completely understand your frustration. The problem is sometimes it is very difficult to describe all of the problem due to several reasons. Please take a look at my last post to see if that makes sense.

    If you really need SQL dynamic - true dynamic SQL which includes dealing with dynamic number of bind variables - then DBMS_SQL are an excellent interface to use.

    You can generate the dynamic SQL statement based on the question of whether the filter criteria is null (do not use) or not null (use as a predicate). For example

    if someParam10 is not null then
      // someParam10 needs to be used as a filter predicate
      dynamicSQL := dynamicSQL || ' and some_col_10 = :someParam10 ';
    end if;
    

    This statement can then be analyzed using the DBMS_SQL interface. The binding of values uses the same logic that was used to create predicates. For example

    if someParam10 is not null then
      // someParam10 is used and needs to be bound
      DBMS_SQL.Bind( myCursor, 'someParam10', someParam10 );
    end if;
    

    So, with this approach simplistic, you can easily create a dynamic SQL with variable predicates, dynamically bind these and run the slider.

    Bind variables are used in the dynamic SQL statements, as there are very few threats of SQL injection. And the basic principles observed for shareable SQL creation - the same set of parameters not null to filter, will result in the same SQL statement, which allows the cursor within the Pool shared for this SQL statement to be reused.

    So, technically, dynamic SQL is not a major problem (if used correctly). The major problem is that if really necessary to address the requirements of the business at hand.

    The problem I have with many comments here want to use dynamic SQL statements, is that it is used as one would use a file i/o interface.

    For file IO you want standard Open(), Read(), Write() and Close() calls. And you, the appellant, simply pass the name of the file and the data to write or to receive the data read.

    Similarly, these posters want to use SQL to open a table and read and write the data column - and do it by calling simply (and dynamically) by specifying the name of the table and column. Approaches to dynamic SQL based on one such concept is wrong. And shows that much of the ignorance of what a RDBMS is and how to use an RDBMS.

  • Rich Textbox example does not work in Windows 7

    In the past, I use the example of the Rich Textbox (\samples\userint\activex\richTextxbox.prj) in Windows XP (CVI 2010 SP1).

    Now, I noticed that this example does not work in Windows 7 64 bit because the ActiveX is not registered on the system (see error.jpg).

    This control is not installed by CVI IDE itself?

    How can I get this example to work on my Win 7 64 bit machine?

    Hey Vix

    It seems that the Rich Textbox control component provided by one of the VB Runtime is more included by default with Windows 7.

    I was able to manually record using Regsvr32 ActiveX control as described in the following Microsoft KB.

    I managed to download the ActiveX control needed here and there, you must copy the .ocx for the ActiveX control in your C:\Windows\SysWOW64 directory. Open an administrator command prompt and run "REGSVR32 RICHTX32. OCX'.

    SysWOW64 is the "Windows on Windows" emulation directory which is used for the execution of 32-bit controls in a 64-bit environment.

    I realize this isn't the best solution by making the deployment of applications a little more complicated, another solution would be to use another control ActiveX RTF like the one here: http://www.lebans.com/richtext.htm.

    Thank you

  • Serial number for lightroom does not work

    my serial number for lightroom does not work

    Maritah has made education institution give you an indication of the place where you need to download the installation files from?

    You can download Lightroom 5.6 from the following locations:

    The updates contain the complete installation files and should accept your serial number.

  • 10.2 PushCollector example does not work

    Hi, I tried to compile and test the PushCollector example for 10.2 SDK but I does not compile properly and the message did not provide sufficient information to be able to fix it.

    Examples of projects are at this location: https://github.com/blackberry/Cascades-Samples/blob/master/pushCollector/10.2/

    E:\bbndk-beta\host_10_2_0_15\win32\x86\usr\bin\ntox86-ld: jump incompatible... /... /pushCollectorCommon/arm/libpushCollectorCommon.so in the research - lpushCollectorCommon

    make [2]: leaving directory E:/area of work/pushCollector / x 86

    make [1]: leaving directory E:/area of work/pushCollector / x 86

    E:\bbndk-beta\host_10_2_0_15\win32\x86\usr\bin\ntox86-ld: could not find lpushCollectorCommon.

    CC: E:/bbndk-beta/host_10_2_0_15/win32 / x 86/usr/bin/ntox86-ld caught signal 1

    make [2]: * [o-g/pushCollector] error 1

    make [1]: * [debug] error 2 make: * [Simulator-Debug] error 2

    Sorry, I'm noob in developing c ++. Is it possible by using various projects such as libraries? I have not used before projects before library in c ++ and I do not know how to configure them properly.

    It is possible to use this library with an absolute path?

    https://github.com/BlackBerry/Cascades-samples/BLOB/master/pushCollector/10.2/pushCollector/.cprojec...

    I was able to run the example.

    The order in the sequence of generation is very important. When I built the correct order, that I was able to correctly generate the package of the project PushCollector and then I could deploy on the device. The sequence is, in case anyone has the same problem:

    -Clean all projects

    -Create a 'pushCollectorCommon '.

    -Create a 'pushCollectorHeadless '.

    -Create a 'pushCollector '.

    -Run 'pushCollector' to the device (I used a Dev Alpha B with 10.2.0.1445, the Simulator does not work)

  • Applications for iOS does not work after update from cli 6.3.0

    After an update on August 3, when the Service of Build upgrade cli 6.3.0 my apps did not work for iOS, I have an iPhone 4 running iOS 7.1.2 and an iPad running iOS 9.3.3. After the build service update, no matter if I specify a lower version of cli, on the iPhone he asked a more recent software when I try to install from iTunes, but the iPhone and iTunes running on the latest version. On the iPad it installs, but the application icon does not appear on the iPad, so I can't access the application.

    Everyone knows a similar problem? I tried to look for documents but did not find any significant syntax change that could cause the problem. I even did a restore on my code (I had an old version of the compiled application and it worked, then I did a restore to this date on my code) and it does not work yet.

    ryanskihead not really, we test with 2 models, an iPad 2 running iOS 9.3.3 and an iPhone 4 iOS running 7.1.2 in both cases, the application does not, but the behavior is different:

    -On the iPad it installs successfully on iTunes, but the icon does not appear on the iPad

    -On the iPhone it says that it can not be installed because it requires a newer version of the iOS, but the iPhone is running the latest available version of iOS.

    If I specify a deployment target, say iOS 7 for example, it doesn't do anything on the iPhone. This and a similar thread I've seen on the target community deployment cli 6 ignorant, I would say that there is a bug with phonegap cli 6 + versions used on the Build Server.

    The problem now solved in time by doing a restore to phonegap cli 5.2.0, TI began works fine after that, so I don't know if there is a bug on higher versions of cli phonegap or there is a syntax change not yet published on config.xml

  • Paste an image into a layer mask does not work even after several approaches

    I can't paste an image into a layer mask. I tried to keep 'option' by clicking on the layer mask (to activate the white), then "Control + V" to paste the image but it still places the image in a new layer. I tried to paste through the Palette layers without success (pasta in a new layer). I tried to use past special from the Edit menu, but the past command is grayed out. Any ideas for why it does not work for me?

    I tried to keep 'option' by clicking on the layer mask (to activate the white), then "Control + V" to paste the image

    Did you select > all and edit > copy the image you want to put in the mask?

  • Xbox 360 controller/joystick for PC does not work properly in Battlefield bad company 2

    I recently black battlefield 2 and bad company xbox 360 wired to use with the game controller. Once both parties had been settled, I went to the settings in the games options and tried to attribute the actions with the buttons of the gamepad /, but here the rub. Not all the buttons of the gamepad a response, as the right analog stick and the arrow keys. Some of the buttons that do not give an answer have different names /-are mixed with other keys, as the right trigger. When I try to assign the right trigger for fireing, she appears as axe1 x and does not work in the game.

    Some of the buttons that work are the x button and the stick analog left and right and left bumber.

    I did not so much to try to solve the problem, as I have really no idea what to do. I thought to uninstall and reinstall the game, but that would help? Also perhaps reinstall the controller, or by downloading a driver for him on internett. It was installed using the disk resulting.

    The problem, in the game or in the controller? Perhaps driver? Where would I go to file a complaint, get my money back?

    Any help would be much appreciated!

    -Mathiasshow

    Hello

    ·        This problem happens only when playing Battlefield Bad Company 2 and other games as well?

    I suggest you run another game on your XBOX360 and check to see if the same problem happens.

    If the problem occurs with all the games then I suggest you to contact the hardware manufacturer.

    If the problem does not occur with a different game then I suggest you uninstall and reinstall the game and see if the problem is resolved.

    Please visit the link provided below for more information on how to uninstall a program in Windows 7:

    http://Windows.Microsoft.com/en-us/Windows7/uninstall-or-change-a-program

    You can also post your question on the link below:

    http://www.xbox360forum.com/Xbox-Forum/Forum.php

    Thank you, and in what concerns:
    Naman R - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Volume F4 - F5 key on the keyboard for mac does not work on the microsoft side

    Volume F4 - F5 on the keyboard for mac key does not work... on the side of microsoft may not decrease or increase volume

    Hello

    ·         What do you mean by Microsoft Side?

    ·         Have you tried to update the latest audio drivers for the computer?

    ·         Were there any changes made on the computer before the show?

    Also I suggest you to contact the Apple support:

    http://www.Apple.com/support/Mac/

    See also: http://windows.microsoft.com/en-US/windows/help/no-sound-in-windows

  • application of foxpro for Dos does not work under Windows 7 Home Premium 64-bit

    Dear Expert help me!

    My foxpro for Dos application does not work under Windows 7 Home Premium 64-bit. Please advice me! How can I do for running under Windows 7 64-bit

    waiting for early response
    Thank you and regards

    SAIF Ali Sabri
    Faisalabad, Pakistan
    E-mail address is removed from the privacy *.
    + 923007960782

    16-bit applications are not taken charge/does not not on 64-bit Windows

  • Flash player for mac does not work?

    I tried to update flash player several times for games on pogo, that looks like it works on my end, but when I go to pogo to play games, it is said that I have to update? I tried to fix it with the help page his does not work?

    Apple has changed the default behavior of plugin Safari 10 (disabled by default).  Please make sure that Flash Player is enabled in the browser, Activate Adobe Flash Player for Safari

  • Adobe dynamic link cc 2014 does not work!

    Hello everyone

    Usually, I use Adobe Dynamic Link between Premiere Pro and After Effect, but in this version, the update does not work.

    Anyone know the difficulty of this kind of problem?

    OK I found the solution!

    The problem is that I used to import the AE composition by right-clicking on the project tree, and then file import AE and I chose the composition.

    It's been my standard until the cs6.

    Do the same thing now, I have to click file > Adobe Dynamic Link > Import AE composition!

    I don't know because the old way does not work, but I'm happy too

    Thank you guys!

  • Locales for Spanish does not work in flex plugin

    I use the parameter following the compiler flex with Flex builder 3 and it works very well in local Spanish support.

    -local = en_US, es_US

    But the same setting does not work in eclipse installed with plugin flex4 running on flex SDK 3.5. I'm unable to build the project with this setting. If I remove es) WE then, it works very well.

    Here's my setting of the compiler

    -local = en_US, es_US-allow-source-path-to overlap = true - source-path = locale / {local}

    I've never used Eclipse for flex development, but yes it sounds like you are configuring the sdk ok.

    It fails to build, but gives no error, very weird

  • Stop or play on the image with the video tag does not work?

    I have a video in a setting that corresponds with the label 'eight ';  I have a button on the timeline with the following code.  I have tried to Stop both gotoAndPlay and it does not work.  Thanks in advance for your suggestions.

    on {(press)

    gotoAndStop (eight);

    }

    use:

    on {(press)

    gotoAndStop ("eight");

    }

  • The add-on Adblock Plus for Firefox does not work on a Livestream page.

    I just install it because I get a video ad on a web page of Livestream. It does not work.
    Disable all is checked.

    Maybe you can ask the team of Adblock, you're very likely to get the best help there.

Maybe you are looking for