• <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 閱讀(1275) 評論(0)  編輯 收藏 引用 所屬分類: QT編程
             
            久久人人妻人人爽人人爽| 久久午夜电影网| 亚洲AV无码久久精品蜜桃| 久久人人爽人人爽人人AV东京热| 国内精品久久久久久99蜜桃| 国产精品熟女福利久久AV| 精品久久久久成人码免费动漫| 久久99精品久久久久久hb无码| 久久久精品波多野结衣| 久久夜色精品国产欧美乱| 久久久久97国产精华液好用吗| 日韩人妻无码精品久久久不卡 | 少妇精品久久久一区二区三区 | 欧美伊人久久大香线蕉综合| 国产精品久久久久久福利69堂| 亚洲另类欧美综合久久图片区| 久久精品国产亚洲AV香蕉| 无码八A片人妻少妇久久| 国产综合免费精品久久久| 久久丫精品国产亚洲av| 综合久久一区二区三区| 久久精品亚洲欧美日韩久久| 国产精品久久久亚洲| 久久人妻少妇嫩草AV蜜桃| 久久播电影网| 成人a毛片久久免费播放| 精品综合久久久久久888蜜芽| 久久久久久免费视频| 久久久国产精华液| 国内精品久久久久久久亚洲| 久久99久久99小草精品免视看| 婷婷久久久亚洲欧洲日产国码AV| 亚洲精品无码专区久久同性男| 国产无套内射久久久国产| 久久er热视频在这里精品| 国产亚洲综合久久系列| 久久66热人妻偷产精品9| 中文精品久久久久人妻不卡| 久久这里只有精品首页| 欧美日韩精品久久久免费观看| 偷窥少妇久久久久久久久|