• <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++高級(jí)工程師 Android高級(jí)軟件工程師 IT集成工程師 音頻工程師 熟悉c,c++,java,c#,py,js,asp等多種語(yǔ)言 程序猿
            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 閱讀(1289) 評(píng)論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            国产精品成人99久久久久91gav| Xx性欧美肥妇精品久久久久久| 久久久久综合国产欧美一区二区| 99久久国语露脸精品国产| 久久久久亚洲精品无码蜜桃| 国产91久久精品一区二区| 国产精品综合久久第一页| 热综合一本伊人久久精品| 无码日韩人妻精品久久蜜桃 | 久久精品一区二区国产| 久久最近最新中文字幕大全| 四虎影视久久久免费观看| 久久久久久亚洲AV无码专区 | 2019久久久高清456| 精品熟女少妇a∨免费久久| 久久精品国产色蜜蜜麻豆| 久久久一本精品99久久精品66| 精品久久国产一区二区三区香蕉| 日韩乱码人妻无码中文字幕久久| 韩国三级中文字幕hd久久精品| 欧美精品久久久久久久自慰| 久久人妻少妇嫩草AV蜜桃| 久久国产成人精品麻豆| 久久综合给合久久国产免费| 内射无码专区久久亚洲| 伊人久久综合热线大杳蕉下载| 亚洲综合伊人久久综合| 狠狠色丁香久久婷婷综合蜜芽五月 | 久久人人爽人人人人片av| 久久国产精品无码网站| 国产成人久久激情91| 久久精品中文騷妇女内射| 一本色道久久综合亚洲精品| 久久久国产99久久国产一| 久久青青国产| 无码乱码观看精品久久| 久久久人妻精品无码一区| 久久综合九色欧美综合狠狠| 久久精品国产亚洲av瑜伽| 久久久久久久亚洲精品| 久久国产成人精品国产成人亚洲|