• <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 閱讀(1277) 評論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            思思久久99热只有频精品66| 久久精品国产91久久麻豆自制| 国内精品久久国产大陆| 久久精品国产亚洲av麻豆小说| 国产亚洲欧美精品久久久| 麻豆精品久久精品色综合| 大香网伊人久久综合网2020| 亚洲性久久久影院| 精品久久久噜噜噜久久久| 久久久久久久久久免免费精品| 欧美黑人又粗又大久久久| 99热热久久这里只有精品68| 亚洲香蕉网久久综合影视| 久久久久无码精品| 久久99亚洲网美利坚合众国| 欧美一级久久久久久久大片| 久久99国产精一区二区三区| 久久久无码精品亚洲日韩京东传媒 | 日日狠狠久久偷偷色综合免费| 伊人久久大香线焦AV综合影院| 久久精品国产99久久丝袜| 国产精品久久久久AV福利动漫| 综合久久精品色| 很黄很污的网站久久mimi色| 丰满少妇高潮惨叫久久久| 四虎国产精品成人免费久久| 日韩亚洲国产综合久久久| 国产免费久久精品丫丫| 97超级碰碰碰碰久久久久| 久久精品国产只有精品2020| 亚洲精品乱码久久久久久中文字幕 | 久久影院亚洲一区| 国産精品久久久久久久| 26uuu久久五月天| 久久青青草原综合伊人| 韩国免费A级毛片久久| 欧美午夜精品久久久久免费视| 久久久久久亚洲精品成人| 无码人妻久久一区二区三区 | 精品国产乱码久久久久久呢 | 国产亚洲精午夜久久久久久 |