how to change the dayDelegate for changing the image visible state?
-
style: CalendarStyle { dayDelegate: Item { id: calendarItem readonly property color sameMonthDateTextColor: "#444" readonly property color selectedDateColor: Qt.platform.os === "osx" ? "#3778d0" : "#d7d9dB" readonly property color selectedDateTextColor: "white" readonly property color differentMonthDateTextColor: "#bbb" readonly property color invalidDatecolor: "#dddddd" Rectangle { anchors.fill: parent border.color: "transparent" color: styleData.date !== undefined && styleData.selected ? selectedDateColor : "transparent" anchors.margins: styleData.selected ? -1 : 0 } Image { id: markedImage visible: eventModel.eventsForDate( styleData.date).length > 0 anchors.top: parent.top anchors.left: parent.left anchors.margins: -1 width: 12 height: width source: "qrc:/qss/res/img/ui/eventindicator.png" } Label { id: dayDelegateText text: styleData.date.getDate() anchors.centerIn: parent color: { var color = invalidDatecolor if (styleData.valid) { // Date is within the valid range. color = styleData.visibleMonth ? sameMonthDateTextColor : differentMonthDateTextColor if (styleData.selected) { color = selectedDateTextColor } } color } } }
the example what the qt offered that named the calendar of the qml.
i just want to refresh the state of the calendar for some days state.the dayDelegate called theeventModel.eventsForDate(styleData.date).length > 0
how to change the visible state ?the method upstairs