• <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編程
             
            偷窥少妇久久久久久久久| 亚洲国产精品久久久久网站| 久久综合伊人77777| 久久精品国产日本波多野结衣| 伊人久久精品无码二区麻豆| 中文字幕成人精品久久不卡| 精品综合久久久久久97| 国产午夜精品久久久久九九电影 | 情人伊人久久综合亚洲| 久久精品免费网站网| av午夜福利一片免费看久久| 久久无码精品一区二区三区| AV色综合久久天堂AV色综合在| 国内精品免费久久影院| 久久国产精品无码HDAV| 亚洲人成无码网站久久99热国产 | 成人国内精品久久久久影院| 青青草国产97免久久费观看| 伊人久久免费视频| 久久er99热精品一区二区| 久久天天躁狠狠躁夜夜躁2014| 国产高潮国产高潮久久久91 | 久久久久久久尹人综合网亚洲| 伊人久久大香线蕉亚洲五月天| 国产激情久久久久影院小草| 99久久er这里只有精品18| 亚洲国产精品成人久久| 久久青青草视频| 伊色综合久久之综合久久| 久久人人爽人人爽人人片AV东京热 | 国产巨作麻豆欧美亚洲综合久久| 国产成人久久AV免费| 久久国产乱子伦免费精品| 亚洲AV乱码久久精品蜜桃| 中文国产成人精品久久不卡| 亚洲中文字幕无码一久久区| 99久久精品国产一区二区| 人人狠狠综合久久88成人| 亚洲va中文字幕无码久久| 久久国产精品成人片免费| 久久99热国产这有精品|