Update QML component c++

Hello

I was following the situation. Let's say I have a main QML file that is called from C++ as follows:

ShareTheMatch::ShareTheMatch(bb::cascades::Application *app)
: QObject(app)
{
    // create scene document from main.qml asset
    // set parent to created document to ensure it exists for the whole application lifetime
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);

    // create root object for the UI
    AbstractPane *root = qml->createRootObject();

    // Expose networking instance to QML so that from QML it is possible
    // to make queries to the network and the server
    NetworkManager *networkObject = new NetworkManager();
    qml->setContextProperty("networkObject", networkObject);

    // set created root object as a scene
    app->setScene(root);
}

Now, on the main.qml file, the user can do various activities, for example to navigate to a new .qml file.

Now, imagine a user has clicked a button on the file main.qml which he redirected a qml file, called

SecondDialog.qml. my problem is the following. Code C++ (see above), I want to be able to update

a component that is located on the SecondDialog.qml - how is possible to do this?

PS. I know not how I'd be able to do that if I were to update a component that was on the file main.qml (e.. g, using the findChild method), but I do not know how to proceed in the case of SecondDialog.qml (partially because she is recalled in another qml file). How to get there?

Any help greately appreciated.

set an object name

Button{
id: myButton
objectName: "secondPageButton"
}
Button *newButton = bb::cascades::Application::instance()->findChild("secondPageButton");

Tags: BlackBerry Developers

Similar Questions

  • Custom QML component not recognized

    From my understanding, to create a custom component of QML, you basically just create a new QML file, create the user interface, and you can immediately call the file name component. He does not like that for my application.

    Currently I have in my assets from the main.qml file, and I want to create a custom separator, so I create a new folder in assets called common, and I create a new QML file with QML container model, called CustomDivider.qml. So far, I'm following the example of Cookbook very well.

    The end result of my CustomDivider.qml is literally that:

    import bb.cascades 1.0

    {Of container

    Divider {}

    topMargin:10

    bottomMargin:1

    }

    }

    In my main.qml, I call CustomDivider {}, and it is not recognized by the IDE. When I run my application, the screen turns black, indicating that something is wrong

    Can someone tell me what exactly is the problem?

    You can also use import "nom_de_dossier".

  • How to upgrade qml component an act any

    Hello

    I need to display the remaining battery time. I tried to put some battery_info in their context but couldn't as long as it's not QObject. I need display the calendar in real time on my qml. How can I do

    Since you obvsiouly works on a sort of 'remaining-battery-life' - app. I will try to explain, in general, what you can do.

    First of all, you have your loop that checks for the remaining duration of the battery. You can either:

    1. keep looping and settings of the user interface for each loop (not a good idea!)
    2. Register for events and define the user interface on each event (best idea, but do not know if this is possible)
    3. Run the UI definition and method determineBatteryLifeRemaining every minute. (Variant 2)

    To update your qml components, you can only access from C++ and set the text. Small example how to proceed:

    QmlDocument *qml = QmlDocument::create("asset:///MainMenu.qml").parent(this);
    navigationPane = qml->createRootObject();
    TextArea* batteryText = navigationPane->findChild("batteryText");
    batteryText->setText("Nominate ZeZke for BB Elite!");
    
  • Access a QML component for a custom PPC file

    Hi guys.,.

    Please help me. I'm stuck with it for more than a week. I have a file with a listview in it qml. I need to access the imageSource that listview via my file CPC to set the image. I am also attaching to my snippet with this.

    QML file 
    
    ListView {
                    id: listView
                    objectName: "listView"
    
                    dataModel: ArrayDataModel {
                        id: myListModel
    
                    }
                    // Override default GroupDataModel::itemType() behaviour, which is to return item type "header"
                    listItemComponents: [
                        // define delegates for different item types here
                        ListItemComponent {
    
                            // StandardListItem is a convivience component for lists with default cascades look and feel
                            StandardListItem {
                                id:stdlst
                                title: ListItemData.postText
                                description: ListItemData.postDate
                                status: ListItemData.filePath
                                imageSource: "asset:///images/2.png"
                            }
                        }
                    ]
                    layoutProperties: StackLayoutProperties {
                        spaceQuota: 1.0
                    }
                    horizontalAlignment: HorizontalAlignment.Fill
                    verticalAlignment: VerticalAlignment.Fill
    
                }
    

    I need to change the imageSource inside the StandardListItem of the CPP file below.

    cpp file
    
    PostHttp::PostHttp(QObject* parent) :
    QObject(parent), m_networkAccessManager(new QNetworkAccessManager(this)) {
        QDeclarativeView *view = new QDeclarativeView;
         view->setSource(QUrl::fromLocalFile("myqmlfile.qml"));
         view->show();
         QDeclarativeItem *item = view.rootObject()->findChild("stdlst");
         if (item)
             item->setProperty("imageSource", "asset:///images/2.png");
    }
    

    Currently, I do like that., but the app crashes when I do that. Please help me...

    I based on this:
    http://supportforums.BlackBerry.com/T5/Cascades-development/download-images-dynamically/m-p/1927137#...

    I'm not allowed to share the code I use now, but this post should give you a good starting point.

  • How to update the component RichTree collectionModel

    Hi all

    I have a component of the tree in my adf page, I need to reset the collectionModel and update with the new CollectionModel of this part of the tree.

    How can I do this programmatically.

    Thank you and best regards,

    Miko Auntie.

    Hi all

    I found the solution for this problem... That's why the tree is formed in the list of the objects in the list. I have two iterators are iterator principal and the other is more child iterator as it is properly completed by the back-end, but the problem here is with the iterator links are not getting updated. so I created the lie subFoldersList object iterator. and when filling the data tree I'm refreshing both FolderDataIterator and SubFolderDataIterator (list of objects in the list).

    DCBindingContainer dcBindings = (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();

    DCIteratorBinding iter = dcBindings.findIteratorBinding("FolderDataIterator");

    iter.executeQuery ();

    DCIteratorBinding iter = dcBindings.findIteratorBinding("SubFolderDataIterator");

    iter.executeQuery ();

    Sorry for the delay in response...

    Thank you all for your valuable contributions.

    Thank you best regards &,.

    Miko Auntie.

  • Add/update a component in the CloverETL Designer

    Hi all

    I would check if the component add/update to update in the CloverETL Designer still exists in version 3.0, as I am unable to find it in this version of the designer. The component used in version 2.3.

    I want to update the records in my field of data without causing query processing for my domain data to stop completely. In addition, the document for Designer 3.0 always refers to the component.

    http://docs.Oracle.com/CD/E37502_01/Integrator.300/integrator_users/TOC.htm#choosing%20A%20loader

    Adding/updating component Records has been renamed Merge Records.   See http://docs.oracle.com/cd/E37502_01/integrator.300/integrator_migration/toc.htm#Integrator%20changes%20required%20by%20Endeca%20Server%20changes (halfway down the page).

    The page you cite has been forgotten during the updating of the documentation.  It will be updated for the next release.

    RLJII

  • How can I access a qml component in C++ of a page has been dynamically generated?

    Hello

    I am new to QML and stunts development and I have the following scenario. On my main page, I have a ListView and when you tap on a list item, a new page is created dynamically and push in the navigation stack. I am able to see the new page, but it is empty. Qml to this new page code is defined in a separate file called DirectionViewer.qml. To achieve this, in my main.qml file I have the following code:

    attachedObjects:]
    {ComponentDefinition}
    ID: directionViewer
    Source: "DirectionViewer.qml".
    }
    ]

    In DirectionViewer.qml, I created another display of list and gave it a name of object called directionList. My question is, how do I access 'directionList' in C++, so that I can put the dataModel of the list of my C++ code?

    Thank you.

    Write a method in C++ and pass your ListView.

    void ListViewUtil::setDataModel(QObject* listViewObject)
    

    In C++, you can cast QObject to ListView.

    ListView listView = dynamic_cast(listViewObject);
    

    Then set the data model.

  • Update a component without rebooting Siebel

    Hello!

    Is it possible to update some of the components of Siebel (Applets, business, integration of objects and other components)
    without restarting the service of Siebel?

    (I know it's possible for the tasks and the Workflow).

    Thank you much for the help!

    Hello

    Applets, BC & IO is called Siebel objects, no components. Any update or any change made in the Siebel objects must be compiled and the srf should be replaced in the server. There are certainly server restart to take effect.

    Kind regards
    Joseph

  • QML: Change the priority of the component display (layer)

    Hello

    Is it possible to change the order of Visual display of the QML component? For example, if I added containing A, then B container, but then I want to have with an overlay of containers at some point B (assuming DispositionAbsolue)

    Thank you!

    Thank you! Who did the trick. A little late in replying, but just to close the thread with solution - I've added the following code in the parent container that contains two elements that were to be exchanged... worked like a charm:

    Container {
        onCreationCompleted: {
            swap(0,1) // makes sure the title bar is on top...
        }
    
  • Specifying a custom component properties

    Hi all

    I use Multisim/Ultiboard 11.0 and would like to ask the next question. When I create a custom in Ultiboard component, I can attribute the imprint newly created for us Let's say a capacitor. The problem is that, in the spreadsheet, view in the field "Manufacturer" of Multisim indicates Ultiboard. I was wondering if it is possible to change this, Multisim or when you create a custom in Ultiboard.

    Thank you.

    Kind regards

    Viktar

    Hi Viktar,

    It's pretty easy to do. Try this:

    1. In Multisim, click Tools > Database > Database Manager
    2. Search for the component that you want to add the footprint of
    3. Click on change
    4. Click the tab of the print
    5. Select the mark that you want to change
    6. Click on change
    7. Specify a new manufacturer of print here
    8. Save the changes to the component and fingerprint
    9. Remember to update the component on your drawing.

    Hope that helps.

  • Windows Vista upgrade, updates, etc..

    I had problems with my computer for months now. I was able to install my security was last updated June 11, 2010. When support for Windows Vista has been cancel that I wasn't informed observation about covers them the free Windows 7 upgrade because my computer would not allow for me to read. "Now I am being faced with a constant demand to update my computer, but whenever I try to install an update and still less any other program Windows, I get an error message that looks like this: WindowsUpdate_80073712" "WindowsUpdate_dt000" I don't know what it means and the upgrade of Windows 7 was free, said the Microsoft Windows Web site. In short, I need to know how this problem can be fix and my computer will be at risk for a virus.

    Tino,

    Because the computer has not been updated in quite sometimes, strongly suggest that first of all, using Internet Explorer, see whether the system can be analyzed by the OneCare security analysis - Safety Scanner for Windows Vista and Windows 7
    Please post back with what, if anything, was detected when the system was analyzed.

    You have installed Vista Service Pack 1 again or is the computer already come with SP1 or SP2 even?

    As for the error, 0 x 80073712 ERROR_SXS_COMPONENT_STORE_CORRUPT update
    The component store is in an inconsistent state

    There is a tool that will try to correct the inconsistent to the component store but, State if the system resident malware, then it may not work properly.

    If no malware has been detected, then please download and Save the tool update system (or CheckSUR).
    Description of the preparation tool system update for Windows Vista for Windows Server 2008, for Windows 7 and for Windows Server 2008 R2

    Be sure to download the version of the tool that fits the computer architecture. If you don't know what it is, then click on the link under
    Method 2: Download the update directly system preparation tool from Microsoft Download Center
    who says "Click here to show or hide the instructions step by step with pictures"

    When the download is complete, please read this before run CheckSUR-
    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    Once you have configured and rebooted the system to clean boot state, run CheckSUR (. Windows6 0-KB947821-v10-x 86.msu or)
    Windows6.0 - KB947821-v10 - x64.MSU) with the system connected to the internet. It will download and try to fix the incompatible component store.

    NOTE: Start-up mode minimum state all the 3rd party firewalls will be disabled. Open Control Panel > firewall Windows to check the native Vista Firewall now on.

    When CheckSUR finishes running, restart the computer.
    See if it can be updated now by opening Windows Update in Control Panel by clicking check for updates in the left link.

    Expert MowGreen Windows IT Pro - consumer safety

  • Impossible to update AVG, error: oxcoo7o643

    Original title: help with my windowsXP Rootkit

    I tried to update my avg anti virse and I get that the rootkit is missing too, I get an error oxcoo7o643.

    Hello

    Thanks for posting in the Microsoft Community Forum, please be assured that we would do our best to help you.

    I suggest that you try the following steps and check if that helps:

    Step 1: Remove the temporary update files and check:

    Please open the "Update Manager" component settings:

    (a) open the AVG (for example by clicking the AVG User Interface
    on your desktop).

    (b) in the 'Tools' menu, select 'Advanced settings'.

    (c) select the item of "Update".

    (d) click the 'Manage' tab and click on the "temporary removal update
    files
    "button.

    (e) Update AVG program and check.

    Step 2: if it does not help I recommend you to uninstall and reinstall AVG and see if that will fix the problem:

    Check the following link to uninstall AVG:

    How to change or remove a program in Windows XP

    http://support.Microsoft.com/kb/307895

    You can download and install AVG from the following link:

    http://www.Avg.com/us-en/homepage

    If you have any questions do not hesitate to answer, we would be happy to help.

  • I receive error Code: 0 x 80070005 (access denied) for the KB2698365 & KB2719985 updates

    The environment is Windows XP SP3

    -Windows Update fails for these 2 updates

    -Fixit research and 'fixed' a problem to update storage location.

    -Windows Update still does not work

    -Download the update on Microsoft.com

    -Manual installation fails with 'Access denied' during installation.

    Runnng Bit Defender but it too fails when you try to automatically install these 2 updates.

    Yes, I am the administrator and the only user on the machine.

    Thoughts?  Help?

    THX!

    Hello

    1. what ran fixit?

    2. what version of Windows XP are you using (whether x32bit or x64bit)?

    3. you have made no changes to the computer before the broadcast took place?

    Follow the steps:

    Method 1:

     

    Follow the article:

    http://support.Microsoft.com/kb/968003

    Method 2: To run only the fixit for Windows update reset component

    http://support.Microsoft.com/kb/KB971058

    Restart the computer and the monitor upgrade of windows, if you get the same error then perform method 3.

    Method 3:  Run the Windows update agent and check.

    http://support.Microsoft.com/kb/943144

    a. click on the link above and download the appropriate version of Windows Agent and run it.

    b. restart the computer and control it upgrade of Windows.

    c. If the problem remains same run the run the Register the Wups2.dll file attach it in the above link and check for the issue.

    Registry warning:

    This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the link below to follow the steps to back up registry:

    http://support.Microsoft.com/kb/322756

    Hope the above information is helpful.

  • XP ' Change/Remove tool does not remove Roxio from my computer Update Manager. How can I remove it?

    I deleted the program Roxio from my computer, but the 'Roxio Update Manager' component will not uninstall.  How can I remove it?

    Hello

    You can follow the steps listed in the link below and check if it helps: how to manually remove programs from the add tool / remove programs: http://support.microsoft.com/kb/314481

    You can also post your request in the support of Roxio for any intervention on the same forum: http://forums.support.roxio.com/

  • Impossible to receive updates of windows vista Home premium and my AOL mail is blocked with other sites.

    Hello any help would be greatly appreciated, all of a sudden I could not receive the updates of windows vista Home premium and my mail AOL not the home page of AOL, but when I click on the mail tab sometimes blocked with explore and Firefox. I have checked all my security settings and toured various forums but have been unable to solve the problem. If anyone has any ideas please help. Thanks Steve

    Hello

    Question 1:

    I suggest that reset you the Windows update components and check if you have the same problem. You can check the link that will give you information on how to reset below updated Windows component update:

    http://support.Microsoft.com/kb/971058

    Question 2:

    Concerning the question associated with AOL mail, I suggest that you contact AOL support to help you. You can check the link that will give you information on the help of AOL Mail below:

    http://help.AOL.com/help/product/aol_webmail/

    Thank you
    Irfan H, Engineer Support Microsoft Answers

Maybe you are looking for