C++博客-Cpper http://www.598club.com/gaimor/C/C++???o??????? Android???o???????????? IT???????????? ?3????????? ??????c,c++,java,c#,py,js,asp?-??????-? ???o????zh-cnThu, 16 Jan 2020 04:38:10 GMTThu, 16 Jan 2020 04:38:10 GMT60C++博客-Cpper http://www.598club.com/gaimor/archive/2019/09/19/216846.htmlccsdu2009ccsdu2009Thu, 19 Sep 2019 10:22:00 GMThttp://www.598club.com/gaimor/archive/2019/09/19/216846.htmlhttp://www.598club.com/gaimor/comments/216846.htmlhttp://www.598club.com/gaimor/archive/2019/09/19/216846.html#Feedback0http://www.598club.com/gaimor/comments/commentRss/216846.htmlhttp://www.598club.com/gaimor/services/trackbacks/216846.htmlimport QtQuick 2.11

Rectangle 
{
    width
: 640
    height: 480
    color: "#0ff90f"

    Flipable {
            id: flip
            width: 300
            height: 300
            anchors.centerIn: parent

            property bool flipped: false

            front: Image{
                anchors.fill: parent
                source: "file:///C:/Users/Administrator/Desktop/11111/2099720.png"

                transform: Rotation{
                    origin.x: flip.width / 2
                    origin.y: flip.height / 2
                    axis.x: 0
                    axis.y: 1
                    axis.z: 0
                    angle: 180
                
}
            }

            back: Image
{
                anchors.fill
: parent
                source: "file:///C:/Users/Administrator/Desktop/11111/2099720.png"
            
}

            transform: Rotation
{
                id
: rotation
                origin.x: flip.width / 2
                origin.y: flip.height / 2
                axis.x: 0
                axis.y: 1
                axis.z: 0
                angle: 0
            
}

            states:State
{
                PropertyChanges {
                    target
: rotation
                    angle: 180
                
}
                when:flip.flipped
            }

            transitions: Transition
{
                NumberAnimation{
                    target
:rotation
                    properties: "angle"
                    duration: 240
                
}
            }

            MouseArea 
{
                anchors.fill
: parent
                onClicked:  flip.flipped = !flip.flipped
            
}
        }
}


ccsdu2009 2019-09-19 18:22 ???????o
]]>
C++博客-Cpper http://www.598club.com/gaimor/archive/2019/09/19/216845.htmlccsdu2009ccsdu2009Thu, 19 Sep 2019 09:33:00 GMThttp://www.598club.com/gaimor/archive/2019/09/19/216845.htmlhttp://www.598club.com/gaimor/comments/216845.htmlhttp://www.598club.com/gaimor/archive/2019/09/19/216845.html#Feedback0http://www.598club.com/gaimor/comments/commentRss/216845.htmlhttp://www.598club.com/gaimor/services/trackbacks/216845.htmlimport QtQuick 2.11

Rectangle 
{
    width
: 640
    height: 480
    color: "#0909ff"

    Flipable {
            id: flip
            width: 300
            height: 300
            anchors.centerIn: parent

            property bool flipped: false

            front:Image{
                anchors.fill: parent
                source: "file:///C:/Users/Administrator/Desktop/11111/2099720.png"
            
}

            back:Image
{
                anchors.fill
: parent
                source: "file:///C:/Users/Administrator/Desktop/11111/2099720-flip.png"
            
}

            transform: Rotation
{
                id
: rotation
                origin.x: flip.width / 2
                origin.y: flip.height / 2
                axis.x: 0
                axis.y: 1
                axis.z: 0
                angle: 0
            
}

            states:State
{
                PropertyChanges {
                    target
: rotation
                    angle: 180
                
}
                when:flip.flipped
            }

            transitions: Transition
{
                NumberAnimation{
                    target
:rotation
                    properties: "angle"
                    duration: 240
                
}
            }

            MouseArea 
{
                anchors.fill
: parent

                onClicked:  flip.flipped = !flip.flipped

            
}
        }
}


ccsdu2009 2019-09-19 17:33 ???????o
]]>
C++博客-Cpper http://www.598club.com/gaimor/archive/2019/09/19/216840.htmlccsdu2009ccsdu2009Thu, 19 Sep 2019 01:51:00 GMThttp://www.598club.com/gaimor/archive/2019/09/19/216840.htmlhttp://www.598club.com/gaimor/comments/216840.htmlhttp://www.598club.com/gaimor/archive/2019/09/19/216840.html#Feedback0http://www.598club.com/gaimor/comments/commentRss/216840.htmlhttp://www.598club.com/gaimor/services/trackbacks/216840.html    int result = av_seek_frame(ffmpeg->formatCtx, -1,
        (ffmpeg->formatCtx->start_time + time) * AV_TIME_BASE,
        AVSEEK_FLAG_BACKWARD);
time????????o??


ccsdu2009 2019-09-19 09:51 ???????o
]]>
C++博客-Cpper http://www.598club.com/gaimor/archive/2019/09/18/216837.htmlccsdu2009ccsdu2009Wed, 18 Sep 2019 03:49:00 GMThttp://www.598club.com/gaimor/archive/2019/09/18/216837.htmlhttp://www.598club.com/gaimor/comments/216837.htmlhttp://www.598club.com/gaimor/archive/2019/09/18/216837.html#Feedback0http://www.598club.com/gaimor/comments/commentRss/216837.htmlhttp://www.598club.com/gaimor/services/trackbacks/216837.htmlimport QtQuick 2.5
import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Rectangle 
{
    width
: 640
    height: 480
    color: "#333333"

    Button {
        id: button
        text: "Button"
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.top: parent.top
        anchors.topMargin: 6

        onClicked: {
            var count = layout.count
            if(layout.currentIndex == count - 1)
                layout.currentIndex = 0
            else
                layout.currentIndex ++
        
}
    }

    StackLayout 
{
        id
: layout
        anchors.top: button.bottom
        anchors.topMargin: 6
        anchors.horizontalCenter: parent.horizontalCenter
        width: 480
        height: 320
        currentIndex: 1
        Rectangle {
            color: 'teal'
            implicitWidth: 200
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'plum'
            implicitWidth: 300
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: '#c90909'
            implicitWidth: 300
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'green'
            implicitWidth: 300
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'grey'
            implicitWidth: 300
            implicitHeight: 200
        
}
    }
}


ccsdu2009 2019-09-18 11:49 ???????o
]]>
C++博客-Cpper http://www.598club.com/gaimor/archive/2019/09/18/216836.htmlccsdu2009ccsdu2009Wed, 18 Sep 2019 02:59:00 GMThttp://www.598club.com/gaimor/archive/2019/09/18/216836.htmlhttp://www.598club.com/gaimor/comments/216836.htmlhttp://www.598club.com/gaimor/archive/2019/09/18/216836.html#Feedback0http://www.598club.com/gaimor/comments/commentRss/216836.htmlhttp://www.598club.com/gaimor/services/trackbacks/216836.htmlimport 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
            
}
        }
    }
}


ccsdu2009 2019-09-18 10:59 ???????o
]]>
C++博客-Cpper http://www.598club.com/gaimor/archive/2019/09/17/216834.htmlccsdu2009ccsdu2009Tue, 17 Sep 2019 08:06:00 GMThttp://www.598club.com/gaimor/archive/2019/09/17/216834.htmlhttp://www.598club.com/gaimor/comments/216834.htmlhttp://www.598club.com/gaimor/archive/2019/09/17/216834.html#Feedback0http://www.598club.com/gaimor/comments/commentRss/216834.htmlhttp://www.598club.com/gaimor/services/trackbacks/216834.htmlimport QtQuick 2.11
import QtQuick.Controls 2.4

Rectangle
{
    width
:640
    height:480
    color:"#cfcfc0"

    anchors.margins: 6

    property bool load1: true

    Button
    {
        id:button
        text: "Button"
        anchors.horizontalCenter: parent.horizontalCenter
        onClicked:
        {
            if(area.visible)
                fadeOut.start()
            else
                fadeIn.start()
        
}
    }

    PropertyAnimation
    
{
        id
: fadeOut
        target: area
        duration: 300
        property: "opacity"
        from: 1.0
        to: 0.0

        onStopped: area.visible = false
    
}

    PropertyAnimation
    
{
        id
: fadeIn
        target: area
        duration: 300
        property: "opacity"
        from: 0.0
        to: 1.0

        onStarted: area.visible = true
    
}

    Rectangle
    
{
        id
: area
        width: parent.width - 12
        height: parent.height - button.height - 12
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.topMargin: 6
        anchors.top: button.bottom
        visible: false
        color: "#9900ff00"
    
}
}


ccsdu2009 2019-09-17 16:06 ???????o
]]>
C++博客-Cpper http://www.598club.com/gaimor/archive/2019/09/17/216831.htmlccsdu2009ccsdu2009Tue, 17 Sep 2019 03:18:00 GMThttp://www.598club.com/gaimor/archive/2019/09/17/216831.htmlhttp://www.598club.com/gaimor/comments/216831.htmlhttp://www.598club.com/gaimor/archive/2019/09/17/216831.html#Feedback0http://www.598club.com/gaimor/comments/commentRss/216831.htmlhttp://www.598club.com/gaimor/services/trackbacks/216831.html?????MouseArea??|?????????3???o????????|????
    MouseArea {
        anchors.fill
: parent
        acceptedButtons: Qt.LeftButton | Qt.RightButton
    
}


ccsdu2009 2019-09-17 11:18 ???????o
]]>
C++博客-Cpper http://www.598club.com/gaimor/archive/2019/09/17/216830.htmlccsdu2009ccsdu2009Tue, 17 Sep 2019 03:10:00 GMThttp://www.598club.com/gaimor/archive/2019/09/17/216830.htmlhttp://www.598club.com/gaimor/comments/216830.htmlhttp://www.598club.com/gaimor/archive/2019/09/17/216830.html#Feedback0http://www.598club.com/gaimor/comments/commentRss/216830.htmlhttp://www.598club.com/gaimor/services/trackbacks/216830.htmlimport QtQuick 2.11
import QtQuick.Controls 2.4

Rectangle
{
    width
:640
    height:480
    color:"#cfcfc0"

    anchors.margins: 6

    MouseArea {
        id: mouseRegion
        anchors.fill: parent
;
        acceptedButtons
: Qt.LeftButton | Qt.RightButton

        onClicked: {
            if(mouse.button == Qt.RightButton)
                contentMenu.popup()
        
}

        Menu 
{
            id
: contentMenu

            MenuItem {
                text: "Cut"
                onTriggered: {
}
            }

            MenuItem 
{
                text
: "Copy"
                onTriggered: {
}
            }

            MenuItem 
{
                text
: "Paste"
                onTriggered: {
}
            }

            MenuSeparator 
{ }

            Menu 
{
                title
: "More"
                MenuItem {
                    text: "Edit"
                
}
                MenuItem 
{
                    text
: "Select All"
                
}
            }
        }
    }
}


ccsdu2009 2019-09-17 11:10 ???????o
]]>
C++博客-Cpper http://www.598club.com/gaimor/archive/2019/09/17/216829.htmlccsdu2009ccsdu2009Tue, 17 Sep 2019 03:06:00 GMThttp://www.598club.com/gaimor/archive/2019/09/17/216829.htmlhttp://www.598club.com/gaimor/comments/216829.htmlhttp://www.598club.com/gaimor/archive/2019/09/17/216829.html#Feedback0http://www.598club.com/gaimor/comments/commentRss/216829.htmlhttp://www.598club.com/gaimor/services/trackbacks/216829.html 1     Button {
 2         anchors.left: button
 3         text: "?????"
 4         anchors.leftMargin: 12
 5         onClicked: popupMenu.popup()
 6      }
 7 
 8      Menu {
 9           id : popupMenu
10           title: "&File"
11 
12           MenuItem {
13               text: "&Open"
14               onTriggered:{}
15           }
16 
17           MenuItem {
18               text: "&Save"
19               onTriggered: {}
20           }
21 
22           MenuItem {
23               text: "&Close"
24               onTriggered: Qt.quit()
25           }
26     }

ccsdu2009 2019-09-17 11:06 ???????o
]]>
C++博客-Cpper http://www.598club.com/gaimor/archive/2019/09/16/216825.htmlccsdu2009ccsdu2009Mon, 16 Sep 2019 08:38:00 GMThttp://www.598club.com/gaimor/archive/2019/09/16/216825.htmlhttp://www.598club.com/gaimor/comments/216825.htmlhttp://www.598club.com/gaimor/archive/2019/09/16/216825.html#Feedback0http://www.598club.com/gaimor/comments/commentRss/216825.htmlhttp://www.598club.com/gaimor/services/trackbacks/216825.htmlimport 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: 0
    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

        onPrimaryColorChanged: requestPaint()
        onSecondaryColorChanged: requestPaint()
        onMinimumValueChanged: requestPaint()
        onMaximumValueChanged: requestPaint()
        onCurrentValueChanged: requestPaint()

        onPaint: {
            var ctx = getContext("2d")
;
            ctx.save();

            ctx.clearRect(0, 0, canvas.width, canvas.height);

            if(mouseArea.pressed) {
                ctx.beginPath();
                ctx.lineWidth = 10;
                ctx.fillStyle = Qt.lighter(canvas.secondaryColor,1.25);
                ctx.arc(canvas.centerWidth,
                        canvas.centerHeight,
                        canvas.radius,
                        0,
                        2*Math.PI);
                ctx.fill();

                timer.running = true;
            
}

            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();
        }

        Text 
{
            id
: progressText
            anchors.centerIn: parent

            font.pixelSize: 16
            text: canvas.text
            visible: circularProgressBar.textVisible
            color: canvas.secondaryColor
        
}

        MouseArea 
{
            id
: mouseArea
            anchors.fill: parent
            visible: circularProgressBar.canClick
            onClicked: canvas.clicked()
            onPressedChanged: canvas.requestPaint()
        
}

        Timer
{
            id
: timer
            interval: 100
;
            running
: true
            repeat: true
;
            onTriggered
: {

                if(circularProgressBar.currentValue === 100) {
                    circularProgressBar.currentValue = 0
;
                    progressText.text = "0"
                
}

                circularProgressBar.currentValue += 1;
                progressText.text = circularProgressBar.currentValue.toString()+"%";
            }

        }
    }
}


ccsdu2009 2019-09-16 16:38 ???????o
]]>