标题:Calendar控件的styleData.today属性一直为false
作者:yuyu414
日期:2019-10-18 15:47
内容:
想在日历上的今天标注一张图片,查到可以用styleData.today这个属性,但是日历控件的styleData.today属性一直为false
文档是这么说的:
readonly property bool styleData.today
true if this date is equal to today's date.
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.4
import org.qtproject.examples.calendar 1.0
ApplicationWindow {
visible: true
width: 640
height: 400
minimumWidth: 400
minimumHeight: 300
color: "#f4f4f4"
title: "Calendar Example"
SystemPalette {
id: systemPalette
}
SqlEventModel {
id: eventModel
}
Flow {
id: row
anchors.fill: parent
anchors.margins: 20
spacing: 10
layoutDirection: Qt.RightToLeft
Calendar {
id: calendar
width: (parent.width > parent.height ? parent.width * 0.6 - parent.spacing : parent.width)
height: (parent.height > parent.width ? parent.height * 0.6 - parent.spacing : parent.height)
frameVisible: true
weekNumbersVisibl ..