How to get the content of the list item selected ListView using CPP?

Hello

I do a simple application, get the content of the list item selected ListView using CPP, in the main.qml file, I created a listview using XMLDataModel and I got the selected listview using dataModel.data (row) .attributeNameInXmlfile in qml. content as in the same way the ListView using cpp.please help me I want to get the content of the listitem selected.

Here is my code

hand. QML

import bb.cascades 1.0

Page {
    content: Container {
        id: mainContainer
        objectName: "container"
        // property alias selectedText: selectedTextField.text
        //property alias deselectedText: deselectedTextField.text
        ListView {
            objectName: "listView"
            dataModel: XmlDataModel {
                source: "models/items.xml"
                id: model
            }
            listItemComponents: [
                ListItemComponent {
                    type: "item"
                    StandardListItem {
                        title: ListItemData.title
                    }
                }
            ]
        }
        TextField {
            id: selectedTextField
            objectName: "selectedTextField"
            text: ""
        }
        TextField {
            id: deselectedTextField
            objectName: "deselectedTextField"
            text: ""
        }
    }
}

App.cpp

#include "app.hpp"

#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;

using namespace bb::cascades;
QObject *textFieldSelected ;
QObject *textFieldNotSelected;
QObject *list;
App::App() {
    QmlDocument *qml = QmlDocument::create("main.qml");
    AbstractPane *root = qml->createRootNode();
    list = root->findChild("listView");
    textFieldNotSelected = root->findChild("deselectedTextField");
    textFieldSelected = root->findChild("selectedTextField");
    QObject::connect(list,SIGNAL(selectionChanged (QVariantList, bool)),this,SLOT(changeText(QVariantList, bool)));
    Application::setScene(root);
}

void App::changeText(QVariantList indexPath,bool selected) {

}

App.HPP

#ifndef APP_H
#define APP_H

#include 
#include 
#include 

/*!
 * @brief Application GUI object
 */
class App : public QObject
{
    Q_OBJECT
public:
    App();
public slots:
void changeText(QVariantList ,bool );

};

#endif // ifndef APP_H

Try this.

void App::changeText(QVariantList indexPath,bool selected) {
    XmlDataModel *model = (XmlDataModel *)list->dataModel();
    QVariantMap map = model->data(indexPath).toMap();
    // map is your data in QVariant
    qDebug() << map["title"].toString();
}

Tags: BlackBerry Developers

Similar Questions

  • How to get the list of RDM?

    Hi all

    In our environment both of RDM is presented to different virtual machines in physical compatibility mode. It was very difficult for me to keep track

    Could you get it someone please let me know, how to get the list of the RDM presented to ESXI 5.0 host?

    Thank you!

    Ravindra Reddy

    Thank you... A P... for your response tools RV is the right tool, but I wanted to naa number of LUNS as well.

    After 2 hours, I had below power CLI command to get the list of the virtual machine.

    PowerCLI C:\ > Get - VM | Get-hard drive - DiskType "RawPhysical", "RawVirtual" | Select name, Parent, ScsiCanonicalName, DiskType | FL | Out-file C:\RDMlist.xlx

    Thank you!

  • How to get the list of active users in Essbase 6.5.6

    Hi gurus,

    How to get the list of active users in Essbase version 6.5.6

    I can't find any Esscmd list of active users...

    I used the command LISTLOGINS in ESSCMD, but it did not help me...

    pls suggest me an approach to find the list of active users.

    Thanks in advance...

    Hi guru,.

    When you connect to the application, you will find the security option---> connect you will find active use in the ESSBASE.

    If you need the list of users in the use of ESSBASE that recommends essmsh

    go for the race---> essmsh---> login user server use this tribute

    (1) session view all this;

    If you want to export the active users usebelow congratulate.

    2)

    spool to 'D:\suresh.txt ';

    poster session;

  • How to remove the list item empty forms of oracle?

    Hello

    How to remove the list item EMPTY forms of oracle?

    I create two list items

    (1) basic

    (2) advanced

    But when I select list or display the runtime display form element 3 element EMPTY automatically, but I add what it shows I want to delete! How?

    He has named REQUIRED = NO item property

    If you set YES and then it does not show. but you must give an initial value.

    Hamid

  • How to get the frame number current timeline using jsx?

    How to get the frame number current timeline using jsx?

    Thanks for the link!

    Clarification: I was looking for the current image on the timeline of the video. OP he mentions that he had found how to get that so I searched a bit more and found this thread: Re: can I inpoint in read/write and out-point of the clips in a group of video with scripts? They have the following functions, I have not tried yet, but it seems like it should work.

    function getCurrentFrame() {}

    try {}

    Var ref = new ActionReference();

    ref.putProperty (charIDToTypeID ('Rprp'), stringIDToTypeID ('currentFrame'));

    ref.putClass (stringIDToTypeID ('timeline'));

    var / / desc = new ActionDescriptor();

    desc.putReference (charIDToTypeID ('null'), ref);

    var TC = executeAction (charIDToTypeID ('getd'), desc, DialogModes.NO);

    Return TC.getInteger (stringIDToTypeID ('currentFrame'));

    } catch (e) {return null ;}

    };

  • How to get the list of files for a virtual machine?

    Hello

    Virtual machines can have their files distributed on several issues (even through several data warehouses).

    PowerCLI gives us an easy way to retrieve the data warehouse associated with a virtual (Get-data store) machine, but it doesn't seem to be a built-in method to get the list of all records where a given virtual machine stores all its files. Or maybe I'm just blind ;-)

    Can anyone offer an overview on how to achieve this?

    Thank you

    No, that sounds like a good idea to copy/back up virtual machines.

    I adapted the script. She now returns one row for each unique record

    foreach($vm in Get-VM){
      $folders = $vm.ExtensionData.LayoutEx.File | %{$_.Name.Split('/')[0]} | Sort-Object -Unique  $folders | Select @{N="VM";E={$vm.Name}},@{N="Folder";E={$_}}
    }
    
  • How to get the CPU usage in LabWindows using C program

    Hi all

    Please help me...

    How to get the CPU usage and the use of the RAM in LabWindows CVI 12.0 using C.

    Any help with this will be appreciated.

    Thank you in advance


  • How to get the FileSystemTree coordinates selected item?

    Hi can we idea me in how to get the coordinates of the itwn selected in a FileSystemsTree?

    THX

    g

    You should do something like this:

    var itemRenderer:DisplayObject = fileSystemTree.itemToItemRenderer (fileSystemTree.selectedItem) as DisplayObject;
    Contact information: Point = itemRenderer.parent.localToGlobal (new Point (itemRenderer.x, itemRenderer.y)) var;

    contact information is now an object point representing the coordinates of your itemRenderer in the global coordinate system.

  • Switch poplist display of the list item selected for its value of list item

    Is it possible to change the display in a poplist of the list item to its corresponding list item value?

    For example, I have a list item is filled with a group of records. Name of the country (e.g., Canada) is the list item, and the country code (e.g. CA) is the value of a list item.

    I want users to be able to see the names of countries, when the list is expanded. However, once users choose and click on a country, the country code must be included in the display.

    I suppose that if it is possible to do at all, he would be using a trigger a times-news-point-instance, but I do not know where to go to from there. Please let me know if you need clarification or more information from me. I'd appreciate any help you can give me.

    With the help of Oracle Developer Suite 10 G
    Version of Forms - 9.0.4.3.0

    Hello
    Welcome to the forum,

    Just an idea. Why you do not keep the country with the description at the time code. I mean, it's like you say you query group will be like this...

    SELECT code, description
    FROM table_name;
    

    So, I mean just change this query to concatenate the code with description. for ex.

    SELECT code, code||' - '||description as description
    FROM table_name;
    

    It will show you the code and the name in the list. So, it will not trigger etc.

    -Clément

  • Please, I beg you! Need a c# example on how to get the list of all host ESX via SDK... I can connect... etc...

    Hello

    I am train to figure this out for a few hours now... and all I find is some examples related to the properties of the VM or something else.

    Now I am able to connect to the server and retrieve things like: Server date and time, version of the API etc...

    I would like to get a code example that would give me the list of ESX servers include within a Virtual Center Server... the last thing I used I got something like: If. Content.searchIndex.ToMo & lt; Indexderecherche & gt; (so). FindEntities & lt; HostSystem & gt; (null, null);...

    This well liked not... Maybe it was too easy...; (o)

    And if you also have a quick way to let me know how to retrieve a simple thing as a host network adapter config... as if I want to know if it is a static address or dhcp etc...

    PS. I have created also a ref to the service instance and service content.

    Here's an example to get the version of the API: (I want that same thing as host nic for setting... but have not yet found the correct syntax)

    var test = SERVICE_CONTENT.about.apiVersion.ToString ();

    MessageBox.Show ("test");

    Also... YES, I'm looking at the SDK prog. Guide... but all of the examples in which are in java... and a little far, the syntax is the same as c#

    Jon

    Thank you and I will award points to a significant response...

    consoleVnic is an array of HostVirtualNic. Therefore, you must print a specific item from the array and not the array itself. It seems that this is the problem.

  • How to get the list of video playback

    Hello

    can anyone suggest me how can I get the number of playlist, the name of all the playlist available in videos and the number of items in each list of reading...

    Thank you...

    QString currentpath(QDir::currentPath());)
    currentpath = music_database_path + "/ db/mmlibrary.db";

    SqlDataAccess sqlDataAccess (music_database_path);

    SqlData QVariantList = sqlDataAccess.execute ("Select c0filename, c2artist, c3album, c4genre, c5composer, c6title, audio_search_content c7description') .value();

    using this we can get all the file name, playlist, albums, genre, etc.

  • How to get the list permissions wise page name or menu-wise

    Hello

    I want to know this authorization list associated with a specific page or a menu. Please help me how to get that

    Check the following on the internet regarding the area of authorizedaction, which contains the information you need.

    http://peoplesoftwiki.blogspot.nl/2009/12/finding-barname-ItemName-and-all-about.html

    you want to hide the PeopleTools menu? If so, mke sure (s) he doesn't have the permision list that grants the permissions so that you do not want.

  • How to get the list view in iTunes 12.4.3 for Windows

    Guys, I'm LOSING MY MIND. I had to re - download iTunes (which I refused to update in eternity because I know of updated versions are generally never good), and this new Interface is making me remove my hair and cry. Not only is it completely intuitive, but it makes it incredibly difficult to navigate.

    I'm seeing all my music in classic list view, which I know he can do. When I first loaded it upward, she appeared in list view, but the time that I started clicking around, it became this heavy nightmare of the image. Every article I've read has a UI that I don't HAVE, where there is a drop-down list of some sort. Does anyone know how? I have attached a screenshot. BTW, that blue icon that you THINK would be seen list said just what is the next song. Complete waste of space. Jesus, just put it in a status bar, or scroll across the top.

    FYI: the only changes that I made in the preferences has been disable anything itunes store or apple related radio because literally ALL itunes became ads.

    How can I view my mode music list in iTunes 12.4?

    In the drop-down list, select music. Once in the music, in the sidebar, select the songs and you should be intraditional list view.

  • How to get the list of parameters of a stored procedure in Oracle?

    I'm calling an Oracle stored procedure and use the OCIBindByPos for each parameter.
    Example:
    /* Do the bind for date, using OCIIOV */
    OCIBindByPos (stmthp, &bindhp2, errhp, 2, (void *)&bvec[0], 
                  sizeof(buf_1[0]), SQLT_STR, 
                  (void *)inddate, (ub2 *)alendate, (ub2 *)rcodedate, 0,
                  (ub4 *)0,  OCI_IOV);
    In this case, its necessary for a list of the parameters of the stored procedure, information such as type and the input/output parameter, etc.

    I can get the parameters of a stored procedure using the DESCRIBE statement.
    Example:
    SQL> DESCRIBE SP_GETCITIES
    PROCEDURE SP_GETCITIES
     Argument Name                  Type          In/Out Default?
     ---------------------- --------------------- ------ --------
     STATE_KEY              VARCHAR2               IN
     FECHA                  DATE                   IN
     RC1                    REF CURSOR             OUT
    
    SQL>
    Is there a better way to get the name, type, input/output for each parameter of an Oracle stored procedure, using the BEAK?

    Best regards.

    Antonio García (Mexico)

    Hi Antonio,.

    Take a look at "Describing metadata schema" in the programmer's Guide. He has this kind of information, which may be enough to get you going in the right direction. The guide is here:

    http://download.Oracle.com/docs/CD/E11882_01/AppDev.112/e10646/oci06des.htm#i446492

    In particular, see the code example in the section "describing the stored procedure.

    Kind regards

    Mark

  • How to refresh the list of selection LOV

    Hello

    I use a search of VO show three fields as a, b, c.

    My query VO is selet 'a,' b, "double c.

    For these 3 attributes, I created three different LovVO with queries to display in the database.

    Select a from table1 - values of retrun as a1, a2, a3

    Select b from table1. - return as b1, b2, b3 values

    c select table1. -returns the values such as c1, c2, c3

    Based on the input parameters I am looking for data and I am also erase data from database using callable statement.

    For Eg: I select a1 lov of an attribute and search and click on delete button. record a1 will be deleted from the DB but it shows in the dropdown attribute one.

    When deleting, I want to update my list of selection.

    How can I do this? Please notify.

    Thank you

    1925321 wrote:

    I LOV VO'; attached s looking for VO.

    The method you gave, I tried to implement even in SearchVORowImpl.java and AMImpl.java

    This method should be in the SearchVORowImpl.java only and NOT in the AMImpl.

    Here is the screen shot of JDev 11.1.1.6, so you can see there is method get: ListBindingDefs()

    The lovs list - it is just java.uitl.List, so import that class in theSearchVORowImpl.java, or simply declare

    java.util.List lovs is getViewDef () .getListBindingDefs ();.


    Then go to the section Java in SearchVO and this method in the customer line to export Interface:

    Now you can add this method in the method of the pageDef and executables, as methodAction:

    Then simply call him when you need it ;-)

Maybe you are looking for