ListView filling does not

Hi all

ListView in my app is not filling, here is the code snippet

ListView {
                    id:sectionlistview
                    objectName: "sectionlistview"

                    ///dataModel: groupDataModel
                    listItemComponents: [
                        ListItemComponent {
                            id:row
                            type: "item"
                            CustomListItem {
                                dividerVisible: true
                                highlightAppearance: HighlightAppearance.Default
                                Container{
                                    opacity: 0.9
                                    background: Color.create("#c0c0c0")
                                    layout: StackLayout {
                                     orientation: LayoutOrientation.TopToBottom
                                    }
                                    Label {
                                        text: ListItemData.name
                                        textStyle.base: myStyle.style
                                        textStyle.color: Color.create("#ffffff")
                                    }
                                }
                            }

                        }
                    ]
                }
void ApplicationUI::fetchData(){
        listView = root->findChild("sectionlistview");
        model = new GroupDataModel(QStringList() << "name");
        model->clear();
        model->setGrouping(ItemGrouping::None);
        model->insert(dataName);
        listView->setDataModel(model);
}

dataName is a QVariantMap variable. The data are available in the variable, I checked that.

The following, almost identical to yours works for me. There are a few things in your code, which I don't see, so it is difficult to check every detail. First, create a new application and replace applicationui.cpp, applicationui.hpp and main.qml with my code and then test it. If it works, check if your code against mine. If not, let me know the device and the version of the OS that you are testing.

#ifndef ApplicationUI_HPP_
#define ApplicationUI_HPP_

#include 

namespace bb
{
    namespace cascades
    {
        class Application;
        class LocaleHandler;
    }
}

class QTranslator;

/*!
 * @brief Application object
 *
 *
 */

class ApplicationUI : public QObject
{
    Q_OBJECT
public:
    ApplicationUI(bb::cascades::Application *app);
    virtual ~ApplicationUI() { }
    Q_INVOKABLE void fetchData();

private slots:
    void onSystemLanguageChanged();
private:
    QTranslator* m_pTranslator;
    bb::cascades::LocaleHandler* m_pLocaleHandler;

};

#endif /* ApplicationUI_HPP_ */

applicationui. HPP

#include "applicationui.hpp"

#include 
#include 
#include 
#include 
#include 
#include 

using namespace bb::cascades;

static AbstractPane *root = 0;

ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
        QObject(app)
{
    // prepare the localization
    m_pTranslator = new QTranslator(this);
    m_pLocaleHandler = new LocaleHandler(this);

    bool res = QObject::connect(m_pLocaleHandler, SIGNAL(systemLanguageChanged()), this, SLOT(onSystemLanguageChanged()));
    // This is only available in Debug builds
    Q_ASSERT(res);
    // Since the variable is not used in the app, this is added to avoid a
    // compiler warning
    Q_UNUSED(res);

    // initial load
    onSystemLanguageChanged();

    // Create scene document from main.qml asset, the parent is set
    // to ensure the document gets destroyed properly at shut down.
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);

    // Create root object for the UI
    root = qml->createRootObject();

    // Set created root object as the application scene
    app->setScene(root);

    qml->setContextProperty("app", this);

}

void ApplicationUI::onSystemLanguageChanged()
{
    QCoreApplication::instance()->removeTranslator(m_pTranslator);
    // Initiate, load and install the application translation files.
    QString locale_string = QLocale().name();
    QString file_name = QString("SupportListView_%1").arg(locale_string);
    if (m_pTranslator->load(file_name, "app/native/qm")) {
        QCoreApplication::instance()->installTranslator(m_pTranslator);
    }
}

void ApplicationUI::fetchData()
{

    QVariantMap dataName;
    dataName["name"] = "Martin";
    ListView* listView = root->findChild((const QString) "sectionlistview");
    GroupDataModel* model = new GroupDataModel(QStringList() << "name");
    model->clear();
    model->setGrouping(ItemGrouping::None);
    model->insert(dataName);
    listView->setDataModel(model);
}

applicationui.cpp

import bb.cascades 1.2

Page {
    Container {
        //Todo: fill me with QML
        Label {
            // Localized text with the dynamic translation and locale updates support
            text: qsTr("Hello World") + Retranslate.onLocaleOrLanguageChanged
            textStyle.base: SystemDefaults.TextStyles.BigText
        }
        Button {
            text: "Fetch Data"
            onClicked: {
                app.fetchData();
            }
        }
        ListView {
            id: sectionlistview
            objectName: "sectionlistview"

            ///dataModel: groupDataModel
            listItemComponents: [
                ListItemComponent {
                    id: row
                    type: "item"
                    CustomListItem {
                        dividerVisible: true
                        highlightAppearance: HighlightAppearance.Default
                        Container {
                            opacity: 0.9
                            background: Color.create("#c0c0c0")
                            layout: StackLayout {
                                orientation: LayoutOrientation.TopToBottom
                            }
                            Label {
                                text: ListItemData.name
                                textStyle.base: myStyle.style
                                textStyle.color: Color.create("#ffffff")
                            }
                        }
                    }

                }
            ]
        }
    }
}

hand. QML

Good luck!

Martin

Tags: BlackBerry Developers

Similar Questions

  • Fill does not work in Photoshop CC - Windows 7

    Suddenly having a problem where the command 'Fill' does not work. It isn't okay if I use SHIFT + BACKSPACE or SHIFT + F5 or by going in Edition > fill. He's going through the motions and fill actions is recorded in the history panel, but the layer is not met. The only way that I filled with success is with the paint bucket, and it's just not as convenient.

    Screenshot:

    screenshot.jpg

    System details:

    Service Pack 1 of Windows 7 Professional x 64

    Photoshop CC 14.0 x 64

    Any help is greatly appreciated!

    Thank you.

    Make sure you that preserve transparency is unchecked.

  • Auto form fill does not work in Google

    I updated Firefox to 8.0 days and everything was OK, but today I discovered this forms AutoComplete does not work in google (it works on other sites, however). I checked through form story addon that historical form has not been deleted, it's just the auto form fill that do not work. This happens on both my work and home computer. From FF in safe mode (with extensions disabled) does not help.

    It works to disable JavaScript. Or using the URL http://www.google.com/webhp?complete=0 . Kinda weird, but seems to be the issue of google anyway.

  • Color of text field properties fill does not

    With the help of Acrobat 11.0.03 on a Mac:

    I'm creating a form for a client and we would like the grey background on one of the fields to indicate to their clients that they do not need to fill that (but the client would like to have always as a modifiable for their use text box). I entered in the properties box, click on the fill, selected color the color I want, turned off the coast of the transparent box, but when I close on the color picker, nothing happens.

    Screen Shot 2013-09-04 at 12.53.19 PM.png

    I tried several times, tried to change the color of the border instead, closed on editing the form and returned it, close the document, restarted Acrobat, and nothing seems to work yet. I know that I could go back into InDesign (where I created the original document) and that make a gray box, but I would rather try to understand why it does not work as it should (and previously).

    Any suggestings or is it possibly a bug? Thanks for your time!

    Several people have reported this kind of thing, so it could very well be a bug and you should consider reports. In the meantime, what happens if you try to set the color using JavaScript? For example, to add a temporary and defined button mouse Up JavaScript as follows:

    Mouse upwards to button script

    getField("Repair_Tracking_#").fillColor = color.ltGray;

  • LUN filling does not

    I'm testing the manual failover of a replicated Mirrorview LUN.  I broke the mirror and he added to the storage group in my site of DR.  I re-read my hosts and poped in anything.  If I add the LUN he invites me to keep signing I did.  The LUN is now one of my hosts.  I'm doing another rescan and it still does not show upward.

    Usually, if you add a logical unit number to a host, the others are able to see.  Ideas?

    If the logic unit number is considered a snapshot?

    http://KB.VMware.com/kb/1011387

  • Photoshop elements 13 Content Aware Fill does not

    Hello, all. I am kind of new to 13 items and seem to have run into a bit of a blockade. I am trying to remove a tree in the background of a photo with content aware fill capacity; However, when I try this it loads as if she was working on it, but when he finished nothing has changed. I thought that perhaps it was not important enough to recognize what Fill (which seemed unlikely), then I advanced and tried on something more secluded and still nothing happens. I feel that I must have something wrong because a lot of my other tools are not no longer works, but I can't imagine what it is that I did wrong.

    When the editor becomes weird, the first thing to do is to delete the preferences. Will the editor preferences > general, click this button and restart the Editor:

  • CS6: Group Fill does not record

    When you save a file that has a FILLING % defined for a group of layers (so the per cent of fill is defined for the group, not on each individual layer) it will not record it.

    When you then open the file, he forgot what had the fill value.

    Is this a bug or I use something I shouldn't use to fill on a group?

    See you soon,.

    -Dirk

    Hi Dirk,

    This is a bug that we recorded in our database. I don't think the Advanced Blending options to be saved on the group.

    Sorry,

    Steve

  • 'No background fill' does not work?

    I'm graphic overlay over another; in fact, the final objective will include three graphs but the principle remains the same.  I have another document of numbers where the "No. Background Fill" is on and I can superimpose on another table - no problem.  But for some reason, in this document, 'No background fill' and 'Fill color' have the same effect.

    Any help?

    Thank you!

    File > new in your attempt to menu open the model of «Charting Basics» You can drag a chart (no background fill) above a here?

    SG

  • Content aware fill does not work

    I have a spot on a picture in Photoshop CC 2014.  I want to remove it.

    I go to the Adobe tutorial and Julieanne Kost shows me exactly how high do this.  Lasso the question, go to Edition, select fill then Content Aware and press OK.  Nothing happens.

    Despite several attempts in a few months, I was unable to get any default replacement tools to work.  The PS is updated.

    Suggestions?

    I discovered what the problem is.  If I create a duplicate layer and change the overlap for anything but normal, so I am unable to do a content-aware fill.

  • other systems not using fill does not APEX

    I have 3 different systems that uses the Oracle database.
    One of the systems is to use APEX.
    Is it possible to fill out a form of APEX in the application and it will also fill the other systems using Oracle?
    I think it's Yes. But how this can be done?
    As a dblink? Or permission from the other database and include them in my application or something?

    As a dblink?

    Yes. You can create a DB link to other databases and create synonyms for tables in the other PB:

    create synonym some_table for some_table@db_link
    
  • Phone - digital keyboard filling does not

    I always felt a need to 'premium' my request for the keyboard when using the phone stock feature. (with the exception of Handcent SMS, everything is stock on my phone).

    When I go into the cool phone menu - which means that I don't have it in the list of recent applications, I get the speed dial images (see attachment). I then press the icon in the middle of the keyboard. I am taken to a new screen that is empty (see attachment). I have to press return, and then repeating the claim dialpad. Then, I'm given the keyboard as expected.

    Is anyone else able to reproduce this bug?

    I think you see this, if you have disabled animations in the developer Options.

    Define your parameters of 3 animation at least .5x and dialpad should work correctly.

  • Alignments works does not go as planned?

    Hello

    I had some problems with the alignment of the stuff in my project, broken down according to the simplest form, it looks like this:

    Page{
        Container{
            HorizontalAlignment: HorizontalAlignment.Fill
            [Stuff]
            Container{
                layout: StackLayout {
                            orientation: LayoutOrientation.LeftToRight
                        }
                horizontalAlignment: HorizontalAlignment.Fill
                Label{text:"Hello"}
                Label{
                    text: "World!"
                    horizontalAlignment: HorizontalAlignment.Right
                }
            }
        }
    }
    

    With this, filled with "World!" label should remain the very right of the screen for each top container fills the available horizontal space, but etiquette guard appearing to stick to each other.

    Can someone help me? Or I'm fundamentally wrong?

    Best regards

    Wildcat

    Edit: another example:

    PickerItemComponent {
                                 type:"color"
    
                                 content:Container{
                                     layout: DockLayout {}
    
                                     Container {
                                         background: Color.create(pickerItemData.colorcode)
                                         horizontalAlignment: HorizontalAlignment.Left
                                         verticalAlignment: VerticalAlignment.Center
                                         minHeight: 60
                                         minWidth: 60
                                     }
                                     Label{
                                         verticalAlignment: VerticalAlignment.Center
                                         horizontalAlignment: HorizontalAlignment.Center
                                         text: pickerItemData.displayname
                                     }
                                 }
                             }
    

    If the space between the 2 dividers is the PickerItemComponent, there is no way that the colorful box is centered vertically, or I'm squinting?

    I think that the filling does not work with LeftToRight.
    You can probably use spacequota to work around that.

    regarding your second question, I think that it is because the external container is not as centered.

  • Look &amp; filling is not correct in IE and Chrome for page OFA

    Hi all

    I have some doubts:

    1.I have added a custom page RN standard oracle. It works very well in the Google Chrome browser, but the look & filling does not come right in Internet Explorer.

    2. I have 4 combo in my RN, when I select all the values of the PPR should fire... It works fine but on the standard page validation is ignition so only my cutom RN is to come.

    I HAV etried by changing: the methods super.processRequest and super.processFormRequest upwards and downwards... even I deleted this my CO custom methods but still standard page validations are firing of first, please suggest me how I can remove it.

    Thanks in advance

    Mahesh

    Hi all

    This problem is resolved... it is strange in the OPS.

    I just changed the id of another name and imported from the page... it works

    All Thakns

  • ListView does not populate when entered second time

    Hi all

    It comes to my previous query:

    http://supportforums.BlackBerry.com/T5/Cascades-development/problem-with-findChild/m-p/2441175#M2524...

    Now when opening the app, I can see the listview in the note.qml and after click on return of the navigation pane and enter the same page (note.qml) still I am not able to see the ListView.

    The code is available in the link above.

    I guess that groupDataModel is exposed via C++ right? Is Qt.objectCrypt.fetchNotes () who is to fill the data model?

    I think your problem might be that the ListView takes possession of the "groupDataModel". Then he destroyed it once the page is destroyed. And the second time, it does not appear because the data model is already destroyed.

    See the documentation of the ListView, as soon as you assign it a dataModel is supported if the datamodel does not have a previous parent. So your solution is perhaps here give the groupDataModel a parent existing if ListView does not try to take ownership.

  • Firefox does not fill automatic password which he saved?

    It is a strange problem I have met only on a few sites. Always happens on a specific site of the game (quakelive.com).

    In any case, I have my password for my registered account. When I connect, however, Firefox does not automatically fill in the login or password fields. If I go the login, it still does not automatically fill in the password field. I know that Firefox is the password, because if I go that wrong (as I often do), I get a window pop up with something like "would you like to update the saved password on...? Well, no, Mr. Firefox, I would not be updated, but I * would * like you to fill if you (what you do).

    I've checked and checked all the basics in other articles; I'm pretty confident that all my security settings and password are correct. I rarely problems on other sites, even if I can remember what happens elsewhere before (quakelive seems to be the main culprit here, and it may be a specific problem with this site). I can always go in password manager and find it, but that kind of defeats the purpose.

    Any ideas?

    I believe that this is caused by the site, some Web sites may voluntarily make sure you can't use her AutoFill, it is usually for reasons of security or anti spam measures.

Maybe you are looking for

  • Satellite A300 1 5 stops instantly and then won't start.

    Forgive me if I posted in the wrong section, but I do not know if this falls of virus and security. Since about 3 weeks my A300 1 5 has been stop under its own, however, it does NOT close properly, all that happens is that when I'm in the middle of s

  • Y50: 6.42 usable GB (8.00 GB

    I have the version of 960 m Lenovo Y50 (8GB). I can only use 6.42 GB of 8 GB! Resource monitor shows 1614 MB are reserved! How to fix this please? I heard about being GFX card using this reserved memory, but I do not think this is the case! It is 960

  • HP 15-AC106NQ: lan

    HelloW I just got a computer hp laptop 15 ac106nq of budget, on which I am unable to install LAN driver, I tried for the last 3 days only try to solve this problem, if I understand well using aida64, this laptop comes with a Realtek RTL8139/810 x Fas

  • I get an error blue screen BCCode: fe

    Vista, HP DV6700 Windows has recovered from an unexpected shutdown:   Signature of the problem: Problem event name: BlueScreen The system version: 6.0.6002.2.2.0.768.3 Locale ID: 1033 More information about the problem: BCCode:                       

  • Linksys E4200 and VoipBuster sip call

    Hello Just recently bought a router Linksys E4200 and it was rocking so far! I've updated since a WRT320N. However it seems that the call SIP (using my account Voip Buster) no longer works... I don't seem to be able to register with the Voip service.