• <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: 86
                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

                    property real rotate: 0.0

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

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

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

                        ctx.translate(width/2,height/2)
                        ctx.rotate(rotate*Math.PI/180.0)
                        ctx.translate(-width/2,-height/2)

                        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();
                    
            }

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

                    Timer
            {
                        id
            : timer
                        interval: 150
            ;
                        running
            : true
                        repeat: true
            ;
                        onTriggered
            : {
                            canvas.rotate += 5
                        
            }
                    }
                }
            }
            posted on 2019-09-18 10:59 ccsdu2009 閱讀(1290) 評論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            99热成人精品免费久久| 91久久婷婷国产综合精品青草 | 欧美久久综合九色综合| 精品无码久久久久久国产| 久久经典免费视频| 久久99精品国产99久久| 日韩欧美亚洲综合久久影院Ds | 久久99久久成人免费播放| 99久久精品免费看国产一区二区三区| 久久偷看各类wc女厕嘘嘘| 国产成人无码精品久久久久免费| 亚洲午夜精品久久久久久浪潮| 国内精品久久久久久久97牛牛| 久久亚洲2019中文字幕| 成人久久综合网| 久久水蜜桃亚洲av无码精品麻豆 | 一本色综合网久久| 热久久最新网站获取| 99热成人精品免费久久| 久久精品草草草| 久久AV高清无码| 久久久久久精品成人免费图片 | 国产精品成人久久久久久久| 国产成人久久精品一区二区三区| 亚洲精品国产成人99久久| 久久久久久亚洲Av无码精品专口| 久久久久亚洲AV无码专区网站 | 日本WV一本一道久久香蕉| 午夜精品久久久内射近拍高清| 国产呻吟久久久久久久92| 91久久福利国产成人精品| 久久夜色tv网站| 久久国产高清字幕中文| 九九久久99综合一区二区| 99久久99久久久精品齐齐| 99久久国语露脸精品国产| 久久久久亚洲AV片无码下载蜜桃| 亚洲AV成人无码久久精品老人| 久久久久国产精品嫩草影院| 香港aa三级久久三级老师2021国产三级精品三级在 | 青青热久久综合网伊人|