• <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編程
             
            国产精品女同一区二区久久| 亚洲人成网站999久久久综合| 国产A三级久久精品| 亚洲成色WWW久久网站| 国产人久久人人人人爽| 国内精品久久久久久不卡影院| 婷婷久久五月天| 久久国产高清字幕中文| 伊人精品久久久久7777| 国产精品久久国产精麻豆99网站| 久久精品亚洲福利| 国产精品久久久久久久久鸭| 久久无码人妻精品一区二区三区| 日日噜噜夜夜狠狠久久丁香五月| 99久久国产热无码精品免费久久久久| 亚洲欧美另类日本久久国产真实乱对白 | 亚洲伊人久久综合中文成人网| 欧洲人妻丰满av无码久久不卡| 久久97久久97精品免视看| 一本色道久久88—综合亚洲精品| 婷婷久久综合九色综合98| 亚洲欧美伊人久久综合一区二区| 久久人妻少妇嫩草AV蜜桃| 国产精品久久精品| 亚洲中文字幕无码一久久区| 日本精品久久久久影院日本| 欧美777精品久久久久网| 色狠狠久久AV五月综合| 99久久国产宗和精品1上映 | 嫩草影院久久国产精品| 97久久国产综合精品女不卡| 久久久精品国产免大香伊| 亚洲另类欧美综合久久图片区| 久久se这里只有精品| 国产精品99久久久久久猫咪| 亚洲国产精品人久久| 国产精品久久久天天影视| 久久精品国产亚洲沈樵| 久久被窝电影亚洲爽爽爽| 99久久精品国产毛片| 国产精品欧美亚洲韩国日本久久 |