• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            Cpper
            C/C++高級工程師 Android高級軟件工程師 IT集成工程師 音頻工程師 熟悉c,c++,java,c#,py,js,asp等多種語言 程序猿
            import QtQuick 2.5
            import QtQuick.Layouts 1.2
            import QtQuick.Controls 1.4
            import QtQuick.Controls.Styles 1.4

            Rectangle 
            {
                id
            : circularProgressBar
                width: 60
                height: 60

                color: "#333333"
                property real currentValue: 0
                property bool textVisible: true
                property bool canClick: false

                Canvas {
                    id: canvas
                    anchors.fill: parent
                    antialiasing: true

                    property color primaryColor: "transparent"
                    property color secondaryColor: "lightblue"

                    property real centerWidth: width / 2
                    property real centerHeight: height / 2
                    property real radius: Math.min(canvas.width-10, canvas.height-10) / 2

                    property real minimumValue: 0
                    property real maximumValue: 100
                    property alias currentValue : circularProgressBar.currentValue

                    property string text: "0"
                    property real angle: (currentValue - minimumValue) / (maximumValue - minimumValue) * 2 * Math.PI
                    property real angleOffset: -Math.PI / 2

                    onPrimaryColorChanged: requestPaint()
                    onSecondaryColorChanged: requestPaint()
                    onMinimumValueChanged: requestPaint()
                    onMaximumValueChanged: requestPaint()
                    onCurrentValueChanged: requestPaint()

                    onPaint: {
                        var ctx = getContext("2d")
            ;
                        ctx.save();

                        ctx.clearRect(0, 0, canvas.width, canvas.height);

                        if(mouseArea.pressed) {
                            ctx.beginPath();
                            ctx.lineWidth = 10;
                            ctx.fillStyle = Qt.lighter(canvas.secondaryColor,1.25);
                            ctx.arc(canvas.centerWidth,
                                    canvas.centerHeight,
                                    canvas.radius,
                                    0,
                                    2*Math.PI);
                            ctx.fill();

                            timer.running = true;
                        
            }

                        ctx.beginPath();
                        ctx.lineWidth = 10;
                        ctx.strokeStyle = primaryColor;
                        ctx.arc(canvas.centerWidth,
                                canvas.centerHeight,
                                canvas.radius,
                                angleOffset + canvas.angle,
                                angleOffset + 2*Math.PI);
                        ctx.stroke();

                        ctx.beginPath();
                        ctx.lineWidth = 3;
                        ctx.strokeStyle = canvas.secondaryColor;
                        ctx.arc(canvas.centerWidth,
                                canvas.centerHeight,
                                canvas.radius,
                                canvas.angleOffset,
                                canvas.angleOffset + canvas.angle);
                        ctx.stroke();

                        ctx.restore();
                    }

                    Text 
            {
                        id
            : progressText
                        anchors.centerIn: parent

                        font.pixelSize: 16
                        text: canvas.text
                        visible: circularProgressBar.textVisible
                        color: canvas.secondaryColor
                    
            }

                    MouseArea 
            {
                        id
            : mouseArea
                        anchors.fill: parent
                        visible: circularProgressBar.canClick
                        onClicked: canvas.clicked()
                        onPressedChanged: canvas.requestPaint()
                    
            }

                    Timer
            {
                        id
            : timer
                        interval: 100
            ;
                        running
            : true
                        repeat: true
            ;
                        onTriggered
            : {

                            if(circularProgressBar.currentValue === 100) {
                                circularProgressBar.currentValue = 0
            ;
                                progressText.text = "0"
                            
            }

                            circularProgressBar.currentValue += 1;
                            progressText.text = circularProgressBar.currentValue.toString()+"%";
                        }

                    }
                }
            }
            posted on 2019-09-16 16:38 ccsdu2009 閱讀(1310) 評論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            久久99热这里只有精品国产| 久久精品国产2020| 久久久精品国产Sm最大网站| 内射无码专区久久亚洲| 久久99精品国产麻豆宅宅| 久久亚洲精品中文字幕三区| 久久久99精品一区二区| 色妞色综合久久夜夜| 97超级碰碰碰碰久久久久| 亚洲日本久久久午夜精品| 91精品国产色综久久| 日韩精品久久无码中文字幕| 久久精品免费网站网| 久久久久高潮毛片免费全部播放| 久久中文精品无码中文字幕| 91视频国产91久久久| 奇米影视7777久久精品人人爽| 久久久久国产一级毛片高清版| 老男人久久青草av高清| 久久国产精品免费一区| 国产成人久久激情91| 青青草原精品99久久精品66| 久久亚洲国产成人精品无码区| 777久久精品一区二区三区无码| 久久久久久国产精品无码超碰| 久久91精品国产91| 一级A毛片免费观看久久精品| 国产精品99久久精品爆乳| 久久精品国产精品亚洲毛片| 亚洲日本va中文字幕久久| 精品综合久久久久久98| 久久成人国产精品免费软件| 无码国内精品久久人妻麻豆按摩| 久久精品中文字幕第23页| 久久久久国色AV免费看图片| 99久久精品免费观看国产| 香蕉久久一区二区不卡无毒影院| 久久免费精品视频| 品成人欧美大片久久国产欧美... 品成人欧美大片久久国产欧美 | 久久精品国产亚洲av瑜伽| 亚洲国产精久久久久久久|