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. Refreshing model in Repeater
Forum Updated to NodeBB v4.3 + New Features

Refreshing model in Repeater

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 305 Views
  • 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.
  • C Offline
    C Offline
    cidwel
    wrote on last edited by
    #1

    Hi! This is my first post! I was learning a bit of QT for first time this last week. I started trying to create some really simple KDE plasmoids based on others, and I'm struggling a bit with some topics.

    So I have a Repeater that gets a bunch of data related with events. So I want to filter the content of the model to get specific data based on the date

    so I have implemented a plasma model for filtering it

                              model: PlasmaCore.SortFilterModel {
    				id: test
    					filterCallback: function(index, date) { 
    						return date.toDateString() == selectedDate.toDateString()
    					}
    					sourceModel: root.agendaModel
    				}
    

    And this works. It filters to only show the data that has the same date as the selectedDate. So. I want this to be repainted, refreshed, retrigered or updated (not sure what kind of concept would be) when I change selectedDate.

    I creted a connection in my QML with the parent QML so whenever the selectedDate changes it fires the event function 'onDateSelected'

    Connections {
    		target: monthView
    		onDateSelected: {
    			// logger.debug('onDateSelected', selectedDate)
    			console.log("I think here I need to trigger an update")
    		}
    	}
    

    This works too, selectedDate variable gets updated but I can't figure out how I could refresh the model to trigger again the filterCallback function.

    I'm actually not sure if this is something more specific with PlasmaCore than QT itself. Sorry if this is the case.

    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