Expose a list of custom objects from C++ to QML (via QDeclarativeListProperty)

Hello

I am trying to expose a list of custom from C++ to QML objects. I have a scene object that uses QDeclarativeListProperty (I followed the example here: http://harmattan-dev.nokia.com/docs/library/html/qt4/declarative-cppextensions-referenceexamples-pro...)

When I try to add a location to the list object, I get the following error in C++:

no matching function for call to 'bb::cascades::Locations::setLocation(bb::cascades::Location*&)'

applicationui. HPP:

ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
QObject(app) {

QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
qml->setContextProperty("app", this);

qml->setContextProperty("locationList", locations);

app->setScene(tabbedPane);

Locations.h:

#ifndef LOCATIONS_H_
#define LOCATIONS_H_

#include 
#include 

namespace bb {
namespace cascades {

class Locations : public QObject {
Q_OBJECT
Q_PROPERTY(QDeclarativeListProperty locations READ locations WRITE setLocation)

public:
Locations();
virtual ~Locations();

QDeclarativeListProperty locations();
int locationsCount() const;
Location *getLocationAt(int) const;

Q_SLOT void setLocation(Location newLocation);

private:
QList m_locations;
};

} /* namespace cascades */
} /* namespace bb */
#endif /* LOCATIONS_H_ */

Locations.cpp:

#include "Locations.h"

namespace bb {
namespace cascades {

Locations::Locations() {
}

Locations::~Locations() {
}

QDeclarativeListProperty Locations::locations()
{
return QDeclarativeListProperty(this, m_locations);
}

int Locations::locationsCount() const
{
return m_locations.count();
}

Location *Locations::getLocationAt(int index) const
{
return m_locations.at(index);
}

void Locations::setLocation(Location newLocation)
{
m_locations.append(newLocation);
}

} /* namespace cascades */
} /* namespace bb */

and here is my controller, when I try to add an object location :

Location *loc = new Location();
app->locations->setLocation(loc);

I'm getting the error on:

app->locations->setLocation(loc);

Any ideas? Thank you!

I wonder about your use of setLocation as a writable property for the list, strange to have a single object as a setter for the list of sounds.

I use is no longer QDeclarativeListProperty that it doesn't work in some cases, instead I keep the list in c ++ and publish the size to and handling using Q_INVOKABLE methods necessary.

Tags: BlackBerry Developers

Similar Questions

  • The default value based on the field from another table to a custom object

    I'm trying to set the default value to a field in the custom object to the value of a field of account. I tried the syntax 50 ways different and just don't get the case. The label for the account field displays the form of s/n, the integration of the tag is ltDBA_ACCT and it appears in the fx reports area as Account.Text_22.

    The field of custom object that I am triying update is also called s/n, which was originally the required field 'NAME '. The name of the table, account, should it be included? Do I need a function to the field?

    I've updated the external ID using the line with syntex < ID > ID (at least higher ID) so I know that it is possible to define a default value, but s / < n >, < ltDBA_ACCT >, 'account '. "" S/n "and so on are simply not working.

    If anyone knows how to get into what I would be really grateful for the help.

    OK, so if you default a field to the value of another object, you must use the JoinFieldValue function. I think you understand that, based on your original post, but I want to be sure you do.

    Then this won't work by default if the folder is created from the object that you want to join the because a default works in record creation and the ID must be available so that it works correctly. It will not work if you choose the record of the related object after that registration of the custom object is created. You can set the default after, but that does not meet your requirements.

    The syntax of the default are the following: JoinFieldValue (ref_record_type, foreign_key, field_name).

    In your case, ref_record_type is '', foreign_key is [] and field_name is ''. The best way is to determine what is the name of the field to create a new workflow for the account and use the Workflow Rule Condition expression builder to choose your field ("DBA") in the list. The value returned by the expression builder must be placed in the field_name variable in the function JoinFieldValue (minus the parentheses and quotes).

    Give it a shot and let me know how you do.
    Thom

  • API bulk: creating custom objects, fields, and lists?

    Hi all

    I have searched and passed through the ticket of support for routing, but have not yet managed to find an answer to this question, so I thought that maybe the people who write the API would be the best ones to talk to

    Anyway, in summary, my question is:-

    Is it possible to create lists of contacts, the Contact fields and items customized by using the bulk API 1.0?

    I know, it is possible to create new contacts and add them to an existing list, but I want to create a new list with the bulk API and then add my contacts on this new list.

    Same kind of thing for the Contact fields. I want to be able to check if there is a Contact field and if not create one and then fill in the import.

    Once again, even for custom objects. I know I can do a GET for all currently available Custom objects, but can I create a new using the API as a whole?

    Any help would be most appreciated.

    Thank you

    Hi Chris,

    You cannot create contact fields, shared lists or the custom objects through the bulk API (which in fact is a RESTful API), they must exist already.

    You can use the REST or lists The SOAP API to create only shared the REST API to create the contact fields, but SOAP or REST currently supports the creation of custom data objects.

    If you don't have it already, please take a look here, building on The Eloqua Platform - A Resource Guide and there REST API - Documentation for kernel objects that will hopefully more questions.

    T.J.

  • RemovePopUp method removes the object from the display list?

    I'm setting up an AIR application that uses several pop-up windows, and I get as much memory as possible windows pop up closed at each Garbage Collection.  Reading through forums / Articles / documentation, I see instances of object created by pop ups stay in memory (No GC would be) up to:

    -all references to the object are = null (cancelled)

    -all receivers on the object are removed (or are weakly referenced)

    -l' object is removed from the display list.

    My question is:

    Does

    PopUpManager.removePopUp (this);

    remove the object from the display list?

    I use PopUpManager.createPopUp () to instantiate a container to display mx:TitleWindow objects.

    The pop-up closed deletion function, however, I'm not sure if it is 'removed from the display list' completely.

    A simple answer is the best, what moves me in the direction of answering the question. (Also useful: How can I see the objects in the display list at a certain point during execution of the application?)

    Thank you all!

    He,

    Yes, removePopUp removes it from the display list.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Web Service object from the list of choices

    I am using the drop-down list of web Services and try to use them against a custom object. They work very well for standard objects such as account, but do not reach my custom object. I tried calling it 'Custom object 01', 'CustomObject1', 'connection' etc. I feel that these web services do not work against custom objects... Does anyone have a contrary experience?

    createSession();
    selection list. List drop-down selection = new iLink.picklist.Picklist ();
    Pick. URL = session. GetURL();
    selection list. Entry PicklistWS_GetPicklistValues_Input = new iLink.picklist.PicklistWS_GetPicklistValues_Input ();
    selection list. PicklistWS_GetPicklistValues_Output output = new iLink.picklist.PicklistWS_GetPicklistValues_Output ();
    entry. RecordType = "CustomObject1";
    entry. FieldName = "IndexedPick0";
    output = pick. GetPicklistValues (input);
    session. Destroy(session.) SessionID);

    Thanks in advance for your comments...

    Hello

    Please, try the following:

    entry. RecordType = "object custom 1";

    Thank you
    Sean

  • Get custom object drop-down list values

    I am using the drop-down list of web Services and try to use them against a custom object. They work very well for standard objects such as account, but do not reach my custom object. I tried calling it 'Custom object 01', 'CustomObject1', 'connection' etc. I feel that these web services do not work against custom objects... Does anyone have a contrary experience?


    createSession();
    selection list. List drop-down selection = new iLink.picklist.Picklist ();
    Pick. URL = session. GetURL();
    selection list. Entry PicklistWS_GetPicklistValues_Input = new iLink.picklist.PicklistWS_GetPicklistValues_Input ();
    selection list. PicklistWS_GetPicklistValues_Output output = new iLink.picklist.PicklistWS_GetPicklistValues_Output ();
    entry. RecordType = "CustomObject1";
    entry. FieldName = "IndexedPick0";
    output = pick. GetPicklistValues (input);
    session. Destroy(session.) SessionID);

    Thanks in advance for your comments...

    I recommend you post this question on the forum of CRM on demand integration development.

    Published by: bobb on June 9, 2009 08:02

  • Related custom object records the Segment export view

    Hello

    I have records history of purchases in Eloqua-specific custom objects.

    These records are related to contacts.

    When I create a segment, I have the ability to filter the contacts based on the data stored on these custom objects.

    I want to export all the records in the custom objects related to all the contacts in the segment view, I can do?

    Hi Ofir,

    There is no way to do it directly from Eloqua. Segments will allow you only to view Contact data, and there is no equivalent way to custom segment object stores the data. To generate this list, you will need to export all history of purchase of your custom object records and then cross the two lists to identify records of custom object related to the Contacts in your industry to export all the contacts from your Segment view.

  • JoinFieldValue - Custom object Workflow 4

    Hello

    How can I recover data from a custom field item 4 at the request of Service.

    I used 4 custom object to load our Machines. And, at the request of service, I exposed the custom object 4 Service field request for Page to let users choose a Machine. So when users select a machine, I want to carry some additional details of the Machine and fill it in the service request page

    I'm doing it with a workflow using Joinfieldvalue on Custom Object4 but running issues.

    JoinFieldValue ("' < CustomObject4 > ', < CustomObject4Id >, ' < IndexedPick0 > '"). His giving syntax error saying invalid field customobject4.



    Thank you

    ORIENTED

    Hello

    You can receive 4 custom to the Service request object.

    You can get data only from the following objects:

    Account
    Assets
    Contact
    CustomObject1
    CustomObject2
    CustomObject3
    Trader
    Product
    User

    Kind regards

    Paul Swarnapandian

  • Import/update of data on custom objects

    Hello

    We use the Object1 Custom for the capture of data from site within the opportunity. Because the custom object does not have the ability to control the duplicates, users have now entered the data in this object that have a lot of duplicates and also the quality data and integrity is lost. I am trying to see if there is an option to export these data and re-import them back after cleaning up the data.
    Then I realized when importing custom objects, the only option available is to use external IDs. All sites that were seized by the users have no any external unique id. Also it has no option to do a mass deletion of folders within the custom object1.

    I understand that the only option to clean and reimport them in ondemand uses web services. I want to use web services as a last option.

    Y at - it another option to reimport them in ondemand using the import utility after cleaning up the data.

    I would like to know what is the best practice using custom objects. It is advisable to fill a default value for the external unique id for the custom when creating new records objects. If I had filled a value in the external unique IDS when creating these files, I would have had the opportunity to update existing records. Now I do not have this option.

    I am looking for some suggestions for this problem.

    Thank you
    Swami

    Swami,

    The only way I can think is:

    a / insert a default value in the EUI of Row ID so that all created nine will get an EUI.
    b / write a workflow when a record is modified is updates EUI with the row ID.
    c / put a check box on the page
    d / create a list where the EUI is null and put the box on the list
    e / manually go down the list and check the box, this will update the record and update your EUI.

    Painful and slow, but it's the only other way in addition to web services.

    see you soon
    Alex

  • Custom object of the quantities Record Field (best practices)

    Hello

    I've been searching but can't seem to find the best practices or recommendations on how many fields to the max may or must be in a single record from custom object. Is there someone out there who could give some information on this? or perhaps point me to some documents or articles on the subject?

    Thank you!

    You can take the class effective Marketing with the custom object class to better understand.  An excerpt from the guide of the student with the limitations thereon:

  • How to create the data control to a custom object of sale cloud using web service.

    Hi all

    I'm working on a requirement I need to display the common custom object data and their children object. After the display of the data user will be able to select multiple records by using the check box and then update the State to close.

    So basically, I need to create a table in which the data will fill with the checkboxs and when the user clicks on the button update then I need to update a field in the parent object.

    Any help would be appreciated.

    Thank you

    You must follow the steps below

    1. right click on the template project, select the new option

    2 Select the data control in the left hand side of the tab "All Technologies"

    4 Select "control of data from the Web Service" in the right side panel

    3. Enter the name of the data control (custom name)

    4. provide your WSDL to the URL https://crm-domain.oracleoutsourcing.com/foundationCustExtn/CrmCommonReferenceService?wsdl

    5. click Next, next if all methods to winow than wsdl, mix to the right and click Finish button

    6 refresh "data control" in your right side panel to request

    7 expand control of data and select only control data that you have already given

    8. then you can see the methods that comes from your wsdl.

    9. Select the method and expand it, you will get the return values

    10. drag and drop the return as a table value, you will get the af:table on the page

    11. don't want to operatet this table.

  • Custom object filters (data card)

    How do you run the filters with data cards?

    We have Contact information stored in the Contact record, and our products are stored against cards of data with the email address as a common link between them.

    I need to run reports for some products, that lists all the products selected for some countries.

    Kind regards

    John

    He discovered. Using the "field of the linked object Custom' and 'A related custom object' in the contact filter allows filtering in the game of the data card.

  • Menus custom objects

    I'm starting with custom objects, but the menu does not match other screenshots I've seen here on topliners. In the custom menu object, the only option is 'Search for custom object records' (see screenshot). Y at - it something I need to install or configure to use these, or am I just missing something?

    Well Yes, Michael is right – not everyone has CDO, according to your level of finish. If you are on Basic of Eloqua trim, then you need not CDO unless pay you extra. The cost for the extra features depends on the size of your database, so I would recommend reaching out to your ad

    Also, here is the list of features produced in case you need more information: Oracle Eloqua price | Marketing, management and integration costs. Eloqua Oracle products

  • Automatic assignment of record parent registration RN when created by OPA and involve a custom object

    The question that we face, it's what seems to be the forced transfer of the child for parent records records when she is using OPA integrated with RightNow to create records. This scenario is a little complex, so I put try it below with a structure to make it easier.

    • Scenario: creating records in RightNow across an interview of the OPA
    • OPA setting of mapping:
      • Personal contact Center (account)
      • At the beginning of the interview, load data related to an individual: Incident
      • At the end of the interview, update Incident
    • Data models:
      • OPA: Global-> [object custom-1] > [custom object 2]
        • all containment relationships
      • RN: Incident-> 1-> object custom object custom 2
        • All relationships of association
    • Detailed description: in Takeovers we are inferring creating two records personal 2 object with a Custom single object 1. In these registers Custom object 2, we put directly the field that contains the link PK 1 custom, object so that each personal object 2 is actually assigned in RN for different Custom object 1s. Some examples of data to explain:
      • Custom 1 object associated with the Incident, read in the OPA
        • ID is set to 123
      • 2 custom object created in OPA under instance of Custom 1 object with ID = 123
        • Link to PK for 1 item 123-custom
      • 2 custom object created in OPA under instance of Custom 1 object with ID = 123
        • PK link for 1 custom object on 345 (different from the Custom object 1 read OPA)
    • Expected behavior: the object two custom 2s are created and assigned to their respective different personal 1 item RightNow records.
    • Actual behavior: the object two custom 2s are created and assigned to the Custom object with ID 123 1

    To continue the investigation, we then tested using a different set of objects, standard objects, but with the same rules:

    • Data models:
      • OPA: Global-> contact-> the incident
        • all containment relationships
      • RN: Organization-> (current) Contact-> Incident (custom object)
        • all relationships of association
      • Detailed description: same logic as the previous
      • Customer expected: same as previous
      • Actual behavior: Matches expected behavior. The Incidents have been correctly assigned to their two different respective Contacts

    This behavior of divestiture now seems specific to custom objects, but can ayone confirms that this is the case and the behavior expected please?

    In addition, we are confident that when you test this feature about 2 weeks ago, we received the expected behavior in BOTH cases to 80%. Maybe it's because changing the configuration in our RN environment that we are not aware of, so we are investingating cela, but are there changes to the OPA / connectors deployment for customer environments in recent weeks that could have caused this please?

    Finally, if this could be affected by a change of configuration of RN, nobody knows what this configuration can be please?

    I can confirm that this is the expected behavior. A few more details are given in the article of doco hierarchies entity Understand - he explains how the containment relationships mapped determines the assignment to the parent.

    The reason for this behavior is that most of the time, it makes sense that the registration of the new entity instances to 'work', feel that they are saved in exactly the same hierarchy of containment that was present in the OPA, and in a way that ensures referential integrity (we support in particular the case where the whole hierarchy of objects is created at the same time if the parent does not yet exist at the time of the creation of the rule (, so you couldn't possibly know its ID). Otherwise, as Matt says, is up to the author of the rule to make sure that, for example, 345 is a valid foreign key.

    This behavior should be the same for the built-in objects as well as custom objects, and as Brad says he has not changed recently. If you see this behavior in some cases but not in others, what this means is that probably in cases where it works as expected, there are multiple relationships between the parent and the child object, and it happens that the foreign key that you set manually is different from the foreign key of the mapped containment relationship.

  • Does not receive the table name in the list of schema objects creating EO

    Hello

    IAM does not have my name of the table custom in the list of schema objects during the creation of EO.

    I created a custom table and I need to use this table looks for creation EO,

    But while creating the EO, I'm not able to find the table in the schema object list.

    in the connection database, these tables are present, but only in this window (window of creation of Eo) these tables do not come

    can someone please help how to solve this problem.

    Hello

    I found the solution

    in business components that there is another database link that I've changed now, it works fine now

Maybe you are looking for