Results 1 to 3 of 3

Thread: QT for Android QML ListView is not updated ,

  1. #1
    Join Date
    Apr 2016
    Posts
    2
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows Android

    Angry QT for Android QML ListView is not updated ,

    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 :

    Qt Code:
    1. #ifndef WOLISTUPDATE_H
    2. #define WOLISTUPDATE_H
    3.  
    4. #include <QObject>
    5.  
    6. class wolistupdate : public QObject
    7. {
    8. Q_OBJECT
    9. Q_PROPERTY(QList<QObject*> wolist READ wolist WRITE setWolist NOTIFY wolistChanged)
    10. public:
    11. wolistupdate(QObject *parent = 0);
    12.  
    13. QList<QObject*> wolist() const;
    14. void setWolist(const QList<QObject*> &wolist);
    15. signals:
    16. void wolistChanged();
    17.  
    18. private:
    19.  
    20. QList<QObject*> m_wolist;
    21. };
    22.  
    23. #endif // WOLISTUPDATE_H
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. #include "wolistupdate.h"
    2.  
    3.  
    4. wolistupdate::wolistupdate(QObject *parent) : QObject(parent)
    5. {
    6.  
    7. }
    8.  
    9. QList<QObject*> wolistupdate::wolist() const
    10. {
    11. return m_wolist;
    12. }
    13.  
    14. void wolistupdate::setWolist(const QList<QObject *> &wolist)
    15. {
    16. if(wolist!=m_wolist)
    17. {
    18. m_wolist=wolist;
    19. emit wolistChanged();
    20. }
    21. }
    To copy to clipboard, switch view to plain text mode 
    What is the solution. Thanks you
    Last edited by anda_skoa; 5th April 2016 at 14:29. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT for Android QML ListView is not updated ,

    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,
    _

  3. #3
    Join Date
    Apr 2016
    Posts
    2
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows Android

    Default Re: QT for Android QML ListView is not updated ,

    anda_skoa , my programs works on windows(MinGW) well , When I compileted to android , listview not updated

Similar Threads

  1. ListView - ListView communication
    By MarkoSan in forum Qt Quick
    Replies: 1
    Last Post: 30th October 2015, 11:18
  2. Replies: 0
    Last Post: 30th May 2015, 10:45
  3. Replies: 4
    Last Post: 10th July 2014, 16:22
  4. How do you make android applications display correctly on android phone?
    By Cyrebo in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 17th August 2013, 08:31
  5. Replies: 3
    Last Post: 15th June 2013, 13:39

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.