Advertisement

QML圆环颜色选择器

阅读量:

无需过多赘述,直接展示效果示意图:

在这里插入图片描述

上述演示案例的完整项目源代码存储位置为:
https://github.com/lesliefish/QMLInAction/tree/master/demos%26projects/Components/ColorSelector


以下为ColorSelector组件的具体实现代码,如存在疑问,欢迎留言反馈:

复制代码
    import QtQuick 2.0
    import QtQuick.Controls 2.2
    Item {
    id:baseItem
    width: 350
    height: width
    signal colorChanged(string newColor);
    property int circleWidth: 40;//圆环宽度
    property var curColor: undefined;
    
    Rectangle {
        id: control
        width: baseItem.wid

全部评论 (0)

还没有任何评论哟~