• <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久久久久| 大伊人青草狠狠久久| 人人狠狠综合久久亚洲88| 午夜福利91久久福利| 久久久久青草线蕉综合超碰| 久久久久高潮毛片免费全部播放| 国产精品日韩欧美久久综合| 免费一级欧美大片久久网| 久久久国产精品亚洲一区| 91精品无码久久久久久五月天| 欧美日韩成人精品久久久免费看 | 亚洲国产一成久久精品国产成人综合| 亚洲?V乱码久久精品蜜桃| 99久久无色码中文字幕 | 精品久久久久久中文字幕人妻最新| 青青青国产精品国产精品久久久久| 久久人人爽人人爽人人av东京热 | 久久人人爽爽爽人久久久| 久久免费香蕉视频| 一本一道久久精品综合| 色欲综合久久躁天天躁蜜桃| 久久人人爽人人澡人人高潮AV| 粉嫩小泬无遮挡久久久久久| 久久精品国产精品亚洲精品| 久久久精品日本一区二区三区 | 国产精品天天影视久久综合网| 久久久久人妻一区二区三区| 久久久久亚洲爆乳少妇无| 亚洲乱亚洲乱淫久久| 91精品国产高清久久久久久io| 97精品依人久久久大香线蕉97| 久久无码一区二区三区少妇| 久久99精品国产99久久6| 91精品国产91久久久久久青草| 国产精品久久精品| 久久96国产精品久久久| 日本免费久久久久久久网站| 伊人热人久久中文字幕| 国内精品伊人久久久久网站|