• <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 閱讀(1331) 評論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            亚洲国产另类久久久精品| 久久99国产精品久久99| 久久久久成人精品无码| 亚洲国产精品成人AV无码久久综合影院| 久久91亚洲人成电影网站| 久久国产三级无码一区二区| 久久久国产亚洲精品| 国产V亚洲V天堂无码久久久| 久久国产成人| 久久99国产亚洲高清观看首页| 色综合久久久久综合99| WWW婷婷AV久久久影片| 青青草原综合久久大伊人导航| 久久99久久99精品免视看动漫| 久久人人爽人人爽AV片| 国产精品18久久久久久vr| 亚洲午夜久久久久妓女影院| 久久免费视频6| 精品久久人妻av中文字幕| 伊人 久久 精品| 久久精品国产亚洲一区二区三区 | 婷婷国产天堂久久综合五月| 久久精品国产99国产电影网| 亚洲中文字幕久久精品无码喷水 | 成人国内精品久久久久影院VR| 伊人久久大香线蕉综合Av| 7777精品伊人久久久大香线蕉| 国产日韩欧美久久| 99久久精品久久久久久清纯| 国产精品一久久香蕉国产线看 | 国产999精品久久久久久| 久久97精品久久久久久久不卡| 久久精品国产清高在天天线| 久久综合久久自在自线精品自| 久久久久亚洲精品日久生情| 狠狠色综合网站久久久久久久高清| 亚洲国产综合久久天堂| 中文字幕久久亚洲一区| 精品久久人人爽天天玩人人妻| 久久综合亚洲鲁鲁五月天| 无遮挡粉嫩小泬久久久久久久 |