查看完整版本: [-- zhengtianzuo系列-Qml日历 --]

QTCN开发网 -> Qt代码秀 -> zhengtianzuo系列-Qml日历 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

zhengtianzuo 2017-11-01 10:56

zhengtianzuo系列-Qml日历

目前显示日历还没有QtQuick.Controls2, 只能用1显示

```
    Calendar {
        anchors.centerIn: parent

        style: CalendarStyle {
            gridVisible: false
            dayDelegate: Rectangle {
                property bool dayIsValid: dayValid(styleData.date.getDate().toString())

                gradient: Gradient {
                    GradientStop {
                        position: 0.00
                        color: styleData.selected && dayIsValid ? "#148014" : (styleData.visibleMonth && styleData.valid ? (dayIsValid ? "#CCCCCC" : "#FFFFFF") : "#FFFFFF");
                    }
                }

                Label {
                    text: styleData.date.getDate()
                    anchors.centerIn: parent
                }

                Rectangle {
                    width: parent.width
                    height: 1
                    color: "#EEEEEE"
                    anchors.bottom: parent.bottom
                }

                Rectangle {
                    width: 1
                    height: parent.height
                    color: "#EEEEEE"
                    anchors.right: parent.right
                }
            }
        }
    }
```



需要完整代码请访问 QtQuickExamples

angelus 2017-11-01 11:15
Controls2的日历是单独存在的!
Qt Labs Calendar 模块!


查看完整版本: [-- zhengtianzuo系列-Qml日历 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled