• <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等多種語言 程序猿
            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 閱讀(1298) 評(píng)論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            伊人久久大香线焦综合四虎| 欧美亚洲国产精品久久高清| 一本色综合网久久| 久久久久久久久久久| 久久天堂电影网| 久久午夜夜伦鲁鲁片免费无码影视| A级毛片无码久久精品免费| 精品国产福利久久久| 伊人久久大香线蕉av一区| a级毛片无码兔费真人久久| 亚洲午夜久久久久久噜噜噜| 国产成人无码精品久久久免费| 久久久久久综合网天天| 99久久国产综合精品网成人影院| 国产免费久久精品99re丫y| 91精品国产91久久| 精品久久久久久无码专区| 人人狠狠综合久久亚洲高清| 久久国产精品-久久精品| 亚洲欧美日韩中文久久| 亚洲综合久久夜AV | 久久99久久成人免费播放| 99久久99久久久精品齐齐| 亚洲AV无码久久| 亚洲精品乱码久久久久久| 性欧美大战久久久久久久| 久久艹国产| 久久久精品国产亚洲成人满18免费网站 | 亚洲精品NV久久久久久久久久| 久久成人影院精品777| 久久精品国产亚洲av影院| 亚洲国产精品无码久久一区二区| 亚洲人成电影网站久久| 亚洲精品国产第一综合99久久| 亚洲伊人久久综合影院| 欧美久久一区二区三区| 一级女性全黄久久生活片免费| 欧美激情一区二区久久久| 亚洲国产精品无码久久98| 久久精品水蜜桃av综合天堂| 久久99精品国产自在现线小黄鸭 |