PDA

View Full Version : QT for Android QML ListView is not updated ,



dj_yoshimitsu
5th April 2016, 13:06
Hi ,
I don't know if ı open topic in right place.I am developing an Android apps with qt . First I try it on MinGW. I have a listview which bind with Q_Property.My code is work in MinGW but there is no affect on Android. MY code :



#ifndef WOLISTUPDATE_H
#define WOLISTUPDATE_H

#include <QObject>

class wolistupdate : public QObject
{
Q_OBJECT
Q_PROPERTY(QList<QObject*> wolist READ wolist WRITE setWolist NOTIFY wolistChanged)
public:
wolistupdate(QObject *parent = 0);

QList<QObject*> wolist() const;
void setWolist(const QList<QObject*> &wolist);
signals:
void wolistChanged();

private:

QList<QObject*> m_wolist;
};

#endif // WOLISTUPDATE_H




#include "wolistupdate.h"


wolistupdate::wolistupdate(QObject *parent) : QObject(parent)
{

}

QList<QObject*> wolistupdate::wolist() const
{
return m_wolist;
}

void wolistupdate::setWolist(const QList<QObject *> &wolist)
{
if(wolist!=m_wolist)
{
m_wolist=wolist;
emit wolistChanged();
}
}

What is the solution. Thanks you

anda_skoa
5th April 2016, 13:31
When you write that the list view is not updated, you mean that when you add/remove objects from the list, then the listview is not adding/removing delegates?

Is the property getter being called after you've emitted the change signal?

Cheers,
_

dj_yoshimitsu
5th April 2016, 19:07
anda_skoa , my programs works on windows(MinGW) well , When I compileted to android , listview not updated