• <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 閱讀(1333) 評論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            欧美伊香蕉久久综合类网站| 国产精品美女久久久久av爽| 亚洲精品国产第一综合99久久| 一本大道久久东京热无码AV| 亚洲中文字幕无码久久综合网| 久久香蕉超碰97国产精品 | 精品久久久久久无码免费| 亚洲人成无码网站久久99热国产| 亚洲精品美女久久久久99| 久久精品国产亚洲综合色| 久久亚洲精品无码VA大香大香| 国产福利电影一区二区三区久久久久成人精品综合 | 日本一区精品久久久久影院| 亚洲国产婷婷香蕉久久久久久| 亚洲精品无码久久一线| 久久久久国色AV免费观看| 日产精品99久久久久久| 日韩欧美亚洲综合久久影院Ds | 亚洲中文精品久久久久久不卡| 久久精品18| 91精品国产高清久久久久久国产嫩草| 一级a性色生活片久久无少妇一级婬片免费放| 久久久无码精品亚洲日韩蜜臀浪潮| 久久精品国产亚洲AV不卡| 成人免费网站久久久| 一本色道久久88精品综合 | 99久久精品毛片免费播放| 亚洲国产精品成人久久| 性欧美大战久久久久久久| 热综合一本伊人久久精品 | 久久国产免费| 中文字幕亚洲综合久久2| 久久久久久综合一区中文字幕| 国产精品久久成人影院| …久久精品99久久香蕉国产 | 免费精品国产日韩热久久| 久久久久九国产精品| 欧美激情精品久久久久久| 久久久久97国产精华液好用吗| 久久久WWW免费人成精品| 色狠狠久久综合网|