Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Filter Rss feed application items
Qt 6.11 is out! See what's new in the release blog

Filter Rss feed application items

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    <row>
    <field name="esid">539661</field>
    <field name="esname">sdsdsds</field>
    <field name="text">
    tyudsgfdsf
    </field>
    <field name="esinfo" xsi:nil="true"/>
    <field name="esbegin">2000-11-22</field>
    <field name="date">2012-03-31</field>
    <field name="time">19:00:00</field>

    <field name="venue">Colombo</field>
    </row>

    This is my RSS feed XML contains. I have created RSS feed application similar to demo Rssfeed example in QTCreator. Now I want to display only the items relevant to a date. this is RssFeeds.qml file. when user clicks on Today items belong to the current date should be listed in the area.

    ListModel {
    id: rssFeeds

    ListElement { name: "Today"; feed: "url" }
    ListElement { name: "This week"; feed: "url" }   
    

    }

    if anyone know how to implement this. please help me.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kahon
      wrote on last edited by
      #2

      Hi,
      it is so simple using XmlListModel.

      I have delete xsi:nil="true" because it was conflicted. Maybe you could do an replace of string and delete it.

      The solution would be like this:
      @
      XmlListModel{
      id:model
      query:"/row"
      XmlRole{name:"date";query:"field[attribute::name='date']/string()"}
      xml:"<row>
      <field name='esid'>539661</field>
      <field name='esname'>sdsdsds</field>
      <field name='text'>tyudsgfdsf</field>
      <field name='esinfo'/>
      <field name='esbegin'>2000-11-22</field>
      <field name='date'>2012-03-31</field>
      <field name='time'>19:00:00</field>
      <field name='venue'>Colombo</field>
      </row>"
      onStatusChanged: {
      if(status==XmlListModel.Ready){
      for(var i =0;i<model.count;i++){
      console.log(model.get(i).date)
      }
      }
      }
      }
      @
      thanks to gentooxativa for helping :).

      Best Regards.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved