XmlDataModel setSource questions

Hello

I am trying to build a small application by using the following sample https://developer.blackberry.com/cascades/documentation/device_comm/networking/tutorial_http_comm.ht...

but the problem with the following line:

mListView->setDataModel(dataModel);

For some reason, the app crashes on this line (if I comment that line the app works without accident). So I think that the problem is in the dataModel. Probably the source is out of adjustment or it staff.

The file

QDir::homePath() + "/model.xml"

There are. I checked the path in the system target file browser.

So any body can help me with that? Any help would be appreciated.

It was my mistake. I forgot begin objectName of the ListView in QML file. Pretty stupid.

Tags: BlackBerry Developers

Similar Questions

  • XML file works only with XmlDataModel

    Hi all

    I'm developing a simple picture viewer using the online service www.imgur.com. It's going to be free and without advertising that allows using the normal API pretty easy. I followed the tutorials on the dev site to send an http request and receive the response. I managed to do all that finding, but I'm stumped trying to apply the http response in my ListView.

    The response is an XML file, but with child elements rather than attributes for more information. I tried to get my response working with the tutorial here:

    Networking Dev BlackBerry tutorial

    more specifically, this part of the code

    // Create the data model using the contents of the file. The
            // location of the file is relative to the assets directory.
            XmlDataModel *dataModel = new XmlDataModel();
            dataModel->setSource(QUrl("file://" + QDir::homePath() + "/model.xml"));
    
            // Set the new data model on the list and stop the activity indicator
            mListView->setDataModel(dataModel);
    

    But I can't work. I read from different people (but not confirmed what whether doc) that the XmlDataModel cannot be used with child element type XML files? If so, can someone point me in the direction of the conversion of an XML attribute type?

    The DataSource object can manage lists XML child element, and it manages the query part of network too. It is however quite limited in its ability to manage structures complex multi-level, so it may or may not be suitable for your use. Without an example XML file, I can't say for sure if DataSource would deal with it, but it's probably something worth investigating.

  • It is possible to sort by using the standard XmlDataModel?

    My subject pretty well covers the question: is it possible to sort using the standard XmlDataModel class? I have an XML source that inverts the order of the elements in virtually all applications, quite annoying for the user, if he decides to update.

    It is not support sorting. Convert the data in GroupDataModel or wrap XmlDataModel in a custom DataModel:

    http://supportforums.blackberry.com/t5/Cascades-Development-Knowledge/Using-a-Custom-DataModel-to-Fi...
    
  • What is the problem with my XmlDataModel?

    Hi, I have the following XML:

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    It display correctly, although I use the code for most on a tutorial. This is the code:

    XmlDataModel *dataModel = new XmlDataModel();
    dataModel->setSource(QUrl("file://" + QDir::homePath() + "/parkings.xml"));
    

    If I'm good enough download the XML, write to a file and then open it using the XmlDataModel. However, nothing is displayed in the ListView with the following ListItemComponents:

                listItemComponents: [
                    ListItemComponent {
                        type: "parkings"
                        StandardListItem {
                            title: ListItemData.name
                        }
                    }
                ]
    

    What I am doing wrong?

    If a few things were wrong. First of all I totally missed that the root tag is mandatory. Second, I wrote the text incorrectly the file that caused sort of characters to write to the file. And finally, he had problems with the bit. I hope this helps someone!

  • XmlDataModel could not open the file

    Hello

    I can't seem to understand how to fix this (attention: XmlDataModel could not open the file "... /..") /.. (' / data / model.xml ').

    what I have is the following,

    generate an XML file using the QXmlStreamWriter and after you have created the file (confirmed that the file exist) create a new XmlDataModel

    // modelfile is define in the h file like QFile *modelfile;
    
    modelfile = new QFile("data/model.xml");
    
    QXmlStreamWriter* xmlWriter = new QXmlStreamWriter();
    xmlWriter->setDevice(modelfile);
    
    // do the xml write stuff
    
    modelfile->flush();
    modelfile->close();
    
    XmlDataModel *dataModel = new XmlDataModel();dataModel->setSource(QUrl("../../../data/model.xml"));//dataModel->setSource(QUrl("modelx.xml")); << file in the asset folder to check if this works ( and this works )listview->setDataModel(dataModel);
    

    THX,

    Xtravanta

    Found the solution:

    dataModel-> setSource (QUrl::fromLocalFile(QDir::homePath() + "model.xml"));

  • iOS 10 people record problem/question

    Hello

    I have a couple of "faces" in the issue of people who are coming in white, but acknowledged same 'face' of many times.  Is anyway to update it for photo comes actually?  At a few faces, I don't know that facial recognition found since it is coming from white.

    Hi JohnP007,

    Congratulations on your iPhone 7 more running iOS 10! I understand that some of your faces in the album of people pull up as a draft and you want to refresh. You can try to use the steps below to fix the faces on the thumbnails in albums.

    Difficulty faces and names mixed-up

    If you notice that there is a photo of someone in a collection that is poorly identified, you can remove it.

    1. Tap the person you want to remove in the album of people > select.
    2. Type Show done face to emphasize his face in every photo.
    3. Press on each photo that is not the person.
    4. Type > not this person.

    Hide people

    You can hide the people or groups that you don't want in your album of people.

    1. Open the album people and press Select.
    2. Touch the people you don't want to see.
    3. Click Hide.

    If you want to see the people that you have hidden, press on show hidden people.

    People in the Photos on your iPhone, iPad or iPod touch

    This should be corrected without delay faces. Please use the Apple Support communities to post your question. Good day.

  • Questions - and answers forgotten

    How to get my 'secret' answers to the questions that I have noted the way back when?

    If you forgot the answers to your questions of security of Apple ID - Apple Support

  • I can't reset the security questions. We received notice as below:

    Hello world

    I can't reset the security questions. We received notice as below:

    "Cannot reset Security Questions."

    We have insufficient information to reset your security questions. "

    Please help me as soon as possible! Thank you very much.

    Hello

    You will need to contact the Apple Support.

    The information is available here:

    Contact Apple for assistance with the security of the Apple ID - Apple Support accounts

    (I'm afraid that no one here can solve the problem for you - this is a user-based community).

  • Question of cloning for SSD upgrade on 12 Macbook Pro

    Previously, I did an upgrade to SSD on my Macbook Air to 2012 according to the instructions of JetDrive transcend. Basically connection via USB 3 and using Mac OS X to clear (and format) disc utilities new SSD, then restore again SSD and then remove the original 128 GB SSD and insert the new 480 GB SSD.  For about a month and so far without problem.

    Now I'm trying to 2012 Macbook upgrade my Pro partner (on 10.11.6).  I got a Crucial SSD MX300 to replace his HARD drive.  Crucial comes with (or recommend) Acronis software.  And a lot of the messages of the forum recommend Carbon Copy Clone.

    My question is if I can use the same method for the cloning of the HD as my Macbook Air (just restore disk of Mac OS X utilities)?  This time, I'm upgrading HARD drive and I don't know if something is different.  At the same time, if I got lucky the first time, I don't not ruin Macbook Pro my spouse this time.

    Thank you.

    Yes, you can use disk utility to clone your MBP wives, but unlike CCC, it will not clone the recovery and Partition.

  • Question about resolution movie downloads

    If I buy a movie at a certain resolution (780p for example), but I want more later re - download at a higher or lower resolution (SD or 1080 p), can I do so and how?

    Same question perhaps for music. Some of my songs have been bought before the latest Apple codecs.

    Any help is appreciated!

    THX!

    Once you have made a purchase on the iTunes store, you will see your purchased items in the menu under accounts bar > bought. You can simply select the item purchased and re-upload.

    With regard to the resolution of the film for films that are offered, and you select the resolution, you can download it again and select a different resolution. For movies that are available as separate download to SD, 780, or 1080 points, you would be limited to the original resolution you selected.

  • Why I can't ask questions.

    I just have a question.  I said that I can't ask questions.

    Do exactly what you did to make this post, but your question in there instead.

  • Cannot reset the Security Questions

    Hello my dear

    -J' forgot my account security questions, but I remember password

    And I'm changing my Security Questions, but show me this sentence

    "Cannot reset Security Questions."

    We have insufficient information to reset your security questions. "

    -I want to solve this problem as soon as possible if permitted

    You should contact the account of Apple security team. To join, click here and choose a method; If this page does not list one for your country or if you are unable to call, complete and submit this form.

    (145081)

  • Bootcamp Windows 10 question

    Hi all

    Stumbled upon a problem, try to install Windows 10 an end 2014 27' iMac w/retina education runs Yosemite 10.10.5. Bootcamp is V 5.1.4. 32 GB, 3.5 ghz Intel I5. Disk of 1 TB of Fusion. Before you try this, I read the guide of Bootcamp to install windows, but also a number of other tutorials and forum messages about potential problems. This research, I learned that for EDU edition you must change the name of the file from Win10_1607_Education_English_x64.iso to Win10_1607_English_x64.iso. Apparently to have the former name of the file may cause OS X to not recognize the ISO. That fact I started Bootcamp, waited while the software downloaded and created a bootable USB key and partitioned my drive giving Windows 70 GB of space. After that, I got the message that my computer is restarts. Upon restarting, I got the black screen with the blue Windows logo and a spinning loading animation. After a few minutes, a blue screen with a message "Windows has encountered and error with computer and must restart," or something similar. He was pretty quick, so maybe it's not word for Word, but it was not a helpful post in terms of saying something specific. When the computer reboots, I am sent directly to OS X, though a bit slower than normal. I tried to restart with the flash drive to see if the installer would start up, no dice. Try now the Option key at startup, the flash player is not available. Went into my settings to see if I could change my startup on Win disk install USB, no luck it no more.

    Now for the question: How can I get the Windows installation again? What I have to start the process, and if so, what should I use Bootcamp to delete the partition that was created? I have re-run Bootcamp and the only option that is checked is the partition and start and install/uninstall windows and delete the partition.

    Thanks for the help.

    Perform the following two procedures

    Reset the management system (SCM) controller on your Mac - Apple Support

    How to reset the NVRAM on your Mac - Apple Support

    If you use a USB drive, not a USB flash drive, you will have problems. It is recommended to use a 8-16 GB USB2 flash drive.

    If the installation program is located on a USB Flash drive, stop your Mac, connect the USB key, restart and hold down the alt/option key and select the Windows icon in the USB port. This installs Windows in BIOS mode. If you click the start EFI icon, it will install using the EFI mode (faster). You may need to change the partition from MBR to GPT using GPT Fdisk.

  • Yahoo account question

    Yes, I understand these are the Apple support forums, but I don't know where else to ask this question and I thought some of you would have the answer to this question.

    I deleted my Yahoo account last week, but I've heard that the 500 million Yahoo accounts were hacked in 2014. I made my account in 2015. Im sure it is hacked since I made my account a year after the supposed hack, but if my account has been hacked and I deleted which would be safe?

    If your account did not exist in 2014, then it is has not been hacked. Removal of the guarantees it will not be new since there was more pirate. Normally, at least the hackers got access to more information in the narrative, as credit card numbers, change your Yahoo password would have sufficed.

  • Text backup question / deleted

    I accidentally deleted one of my iPhone SMS 6 Plus.  They always show on my iMac and iPad but I fear when an AutoSave occurs, it will back up the iPhone and remove them to two other devices. What will happen?  I use iCloud if that makes a difference.

    Hi melissahh625,

    I understand that you have questions about your messages deleted on different devices. I know that it is important to have a handle on your data, so I'm happy to help you.

    When you receive messages, they are stored on different devices. This means that when you delete a device they will not be deleted on the other. This is the case, even if one of your backup devices to iCloud that these backups are specific to devices, as well.

    Thank you for using communities Support from Apple. See you soon!

Maybe you are looking for

  • iMessage by iPhone and iPad question

    Hello world So I have a Plus 6 iPhone and iPad Pro. I want to keep my WE imessages - on both devices, but under the same Apple ID, it even works this way? My question is, I'm not all alone messages that I receive on my iphone sent to my iPad while I'

  • Satellite L20 - cannot save Win film director on cd

    When I create a movie in windows movie maker and try to save it ndo cd or dvd I can't do because this option is enabled. Also, I can't save it to my hard drive in avi format.What should I do if I want to save the movie in best quality on dvd?

  • Arbitrary signal generation

    Hello I would create a program that simulates the signal given by the contraction of a heart Chamber. It should be periodic with an adjustable frequency and amplitude. I use a structure of the event with a time-out interval equal to the time interval

  • Radeon HD 8750M

    I have a HP switchable 6 CTO Ultrabook with the Radeon HD 8750 M t-1200 and 4000 Intel graphics. Problem: When I'm working with Windows 8 they work normally, but after update to 8.1 Windows AMD drivers are not able to open and D3D. 1. most recent dri

  • How can I access a list of bbm contacts of the bbm in an application connected using friend javascripti friend am

    I'm developing an application that connects to bbm but I have a small problem, this application requires access to the bbm contact details. Please can someone help me on how I can do this...