锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲AV无码久久精品色欲,综合人妻久久一区二区精品,国产午夜精品理论片久久http://www.shnenglu.com/gaimor/category/16239.htmlC/C++楂樼駭宸ョ▼甯? Android楂樼駭杞歡宸ョ▼甯? IT闆嗘垚宸ョ▼甯? 闊抽宸ョ▼甯? 鐔熸倝c,c++,java,c#,py,js,asp絳夊縐嶈璦 紼嬪簭鐚?/description>zh-cnThu, 19 Sep 2019 14:11:24 GMTThu, 19 Sep 2019 14:11:24 GMT60QML 鍗曞紶鍥劇墖鏄劇ず緲昏漿鏁堟灉http://www.shnenglu.com/gaimor/archive/2019/09/19/216846.htmlccsdu2009ccsdu2009Thu, 19 Sep 2019 10:22:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/19/216846.htmlhttp://www.shnenglu.com/gaimor/comments/216846.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/19/216846.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216846.htmlhttp://www.shnenglu.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 鍙戣〃璇勮
]]>
QML 鍥劇墖緲昏漿鍔ㄧ敾http://www.shnenglu.com/gaimor/archive/2019/09/19/216845.htmlccsdu2009ccsdu2009Thu, 19 Sep 2019 09:33:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/19/216845.htmlhttp://www.shnenglu.com/gaimor/comments/216845.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/19/216845.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216845.htmlhttp://www.shnenglu.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 鍙戣〃璇勮
]]>
QML StackLayouthttp://www.shnenglu.com/gaimor/archive/2019/09/18/216837.htmlccsdu2009ccsdu2009Wed, 18 Sep 2019 03:49:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/18/216837.htmlhttp://www.shnenglu.com/gaimor/comments/216837.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/18/216837.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216837.htmlhttp://www.shnenglu.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 鍙戣〃璇勮
]]>
QML Canvas鏃嬭漿鍜屽鉤縐?/title><link>http://www.shnenglu.com/gaimor/archive/2019/09/18/216836.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Wed, 18 Sep 2019 02:59:00 GMT</pubDate><guid>http://www.shnenglu.com/gaimor/archive/2019/09/18/216836.html</guid><wfw:comment>http://www.shnenglu.com/gaimor/comments/216836.html</wfw:comment><comments>http://www.shnenglu.com/gaimor/archive/2019/09/18/216836.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/gaimor/comments/commentRss/216836.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/gaimor/services/trackbacks/216836.html</trackback:ping><description><![CDATA[<div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #800000; ">import QtQuick 2.5<br />import QtQuick.Layouts 1.2<br />import QtQuick.Controls 1.4<br />import QtQuick.Controls.Styles 1.4<br /><br />Rectangle </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />    id</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> circularProgressBar<br />    width: 60<br />    height: 60<br /><br />    color: "#333333"<br />    property real currentValue: 86<br />    property bool textVisible: true<br />    property bool canClick: false<br /><br />    Canvas {<br />        id: canvas<br />        anchors.fill: parent<br />        antialiasing: true<br /><br />        property color primaryColor: "transparent"<br />        property color secondaryColor: "lightblue"<br /><br />        property real centerWidth: width / 2<br />        property real centerHeight: height / 2<br />        property real radius: Math.min(canvas.width-10, canvas.height-10) / 2<br /><br />        property real minimumValue: 0<br />        property real maximumValue: 100<br />        property alias currentValue : circularProgressBar.currentValue<br /><br />        property string text: "0"<br />        property real angle: (currentValue - minimumValue) / (maximumValue - minimumValue) * 2 * Math.PI<br />        property real angleOffset: -Math.PI / 2<br /><br />        property real rotate: 0.0<br /><br />        onPrimaryColorChanged: requestPaint()<br />        onSecondaryColorChanged: requestPaint()<br />        onMinimumValueChanged: requestPaint()<br />        onMaximumValueChanged: requestPaint()<br />        onCurrentValueChanged: requestPaint()<br />        onRotateChanged: requestPaint()<br /><br />        onPaint: {<br />            var ctx = getContext("2d")</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />            ctx.save();<br /><br />            ctx.clearRect(0, 0, canvas.width, canvas.height);<br /><br />            ctx.translate(width/2,height/2)<br />            ctx.rotate(rotate*Math.PI/180.0)<br />            ctx.translate(-width/2,-height/2)<br /><br />            ctx.beginPath();<br />            ctx.lineWidth = 10;<br />            ctx.strokeStyle = primaryColor;<br />            ctx.arc(canvas.centerWidth,<br />                    canvas.centerHeight,<br />                    canvas.radius,<br />                    angleOffset + canvas.angle,<br />                    angleOffset + 2*Math.PI);<br />            ctx.stroke();<br /><br />            ctx.beginPath();<br />            ctx.lineWidth = 3;<br />            ctx.strokeStyle = canvas.secondaryColor;<br />            ctx.arc(canvas.centerWidth,<br />                    canvas.centerHeight,<br />                    canvas.radius,<br />                    canvas.angleOffset,<br />                    canvas.angleOffset + canvas.angle);<br />            ctx.stroke();<br /><br />            ctx.restore();<br />        </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br /><br />        MouseArea </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />            id</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> mouseArea<br />            anchors.fill: parent<br />            visible: circularProgressBar.canClick<br />            onClicked: canvas.clicked()<br />            onPressedChanged: canvas.requestPaint()<br />        </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br /><br />        Timer</span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />            id</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> timer<br />            interval: 150</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />            running</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> true<br />            repeat: true</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />            onTriggered</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> {<br />                canvas.rotate += 5<br />            </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br />        }<br />    }<br />}</span></div><img src ="http://www.shnenglu.com/gaimor/aggbug/216836.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/gaimor/" target="_blank">ccsdu2009</a> 2019-09-18 10:59 <a href="http://www.shnenglu.com/gaimor/archive/2019/09/18/216836.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>QML閫忔槑搴﹀姩鐢?/title><link>http://www.shnenglu.com/gaimor/archive/2019/09/17/216834.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Tue, 17 Sep 2019 08:06:00 GMT</pubDate><guid>http://www.shnenglu.com/gaimor/archive/2019/09/17/216834.html</guid><wfw:comment>http://www.shnenglu.com/gaimor/comments/216834.html</wfw:comment><comments>http://www.shnenglu.com/gaimor/archive/2019/09/17/216834.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/gaimor/comments/commentRss/216834.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/gaimor/services/trackbacks/216834.html</trackback:ping><description><![CDATA[<div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #800000; ">import QtQuick 2.11<br />import QtQuick.Controls 2.4<br /><br />Rectangle<br /></span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />    width</span><span style="color: #000000; ">:</span><span style="color: #0000FF; ">640<br />    height:480<br />    color:"#cfcfc0"<br /><br />    anchors.margins: 6<br /><br />    property bool load1: true<br /><br />    Button<br />    {<br />        id:button<br />        text: "Button"<br />        anchors.horizontalCenter: parent.horizontalCenter<br />        onClicked:<br />        {<br />            if(area.visible)<br />                fadeOut.start()<br />            else<br />                fadeIn.start()<br />        </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br />    }<br /><br />    PropertyAnimation<br />    </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />        id</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> fadeOut<br />        target: area<br />        duration: 300<br />        property: "opacity"<br />        from: 1.0<br />        to: 0.0<br /><br />        onStopped: area.visible = false<br />    </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br /><br />    PropertyAnimation<br />    </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />        id</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> fadeIn<br />        target: area<br />        duration: 300<br />        property: "opacity"<br />        from: 0.0<br />        to: 1.0<br /><br />        onStarted: area.visible = true<br />    </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br /><br />    Rectangle<br />    </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />        id</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> area<br />        width: parent.width - 12<br />        height: parent.height - button.height - 12<br />        anchors.horizontalCenter: parent.horizontalCenter<br />        anchors.topMargin: 6<br />        anchors.top: button.bottom<br />        visible: false<br />        color: "#9900ff00"<br />    </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br />}<br /></span></div><img src ="http://www.shnenglu.com/gaimor/aggbug/216834.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/gaimor/" target="_blank">ccsdu2009</a> 2019-09-17 16:06 <a href="http://www.shnenglu.com/gaimor/archive/2019/09/17/216834.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>QML涓嶅搷搴斾笅灞傚彸閿彍鍗?/title><link>http://www.shnenglu.com/gaimor/archive/2019/09/17/216831.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Tue, 17 Sep 2019 03:18:00 GMT</pubDate><guid>http://www.shnenglu.com/gaimor/archive/2019/09/17/216831.html</guid><wfw:comment>http://www.shnenglu.com/gaimor/comments/216831.html</wfw:comment><comments>http://www.shnenglu.com/gaimor/archive/2019/09/17/216831.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/gaimor/comments/commentRss/216831.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/gaimor/services/trackbacks/216831.html</trackback:ping><description><![CDATA[<div>涓婂眰MouseArea闇瑕佹帴鍙楀彸閿簨浠訛紝濡備笅</div><div><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #800000; ">    MouseArea </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />        anchors.fill</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> parent<br />        acceptedButtons: Qt.LeftButton | Qt.RightButton<br />    </span><span style="color: #000000; ">}</span></div></div><img src ="http://www.shnenglu.com/gaimor/aggbug/216831.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/gaimor/" target="_blank">ccsdu2009</a> 2019-09-17 11:18 <a href="http://www.shnenglu.com/gaimor/archive/2019/09/17/216831.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>QML 鍙抽敭鑿滃崟http://www.shnenglu.com/gaimor/archive/2019/09/17/216830.htmlccsdu2009ccsdu2009Tue, 17 Sep 2019 03:10:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/17/216830.htmlhttp://www.shnenglu.com/gaimor/comments/216830.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/17/216830.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216830.htmlhttp://www.shnenglu.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 鍙戣〃璇勮
]]>
QML 鑿滃崟欏?/title><link>http://www.shnenglu.com/gaimor/archive/2019/09/17/216829.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Tue, 17 Sep 2019 03:06:00 GMT</pubDate><guid>http://www.shnenglu.com/gaimor/archive/2019/09/17/216829.html</guid><wfw:comment>http://www.shnenglu.com/gaimor/comments/216829.html</wfw:comment><comments>http://www.shnenglu.com/gaimor/archive/2019/09/17/216829.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/gaimor/comments/commentRss/216829.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/gaimor/services/trackbacks/216829.html</trackback:ping><description><![CDATA[<div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span> <span style="color: #800000; ">    Button </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br /></span><span style="color: #008080; "> 2</span> <span style="color: #FF0000; ">        anchors.left</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> button<br /></span><span style="color: #008080; "> 3</span> <span style="color: #0000FF; ">        text: "鑿滃崟"<br /></span><span style="color: #008080; "> 4</span> <span style="color: #0000FF; ">        anchors.leftMargin: 12<br /></span><span style="color: #008080; "> 5</span> <span style="color: #0000FF; ">        onClicked: popupMenu.popup()<br /></span><span style="color: #008080; "> 6</span> <span style="color: #0000FF; ">     </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br /></span><span style="color: #008080; "> 7</span> <span style="color: #800000; "><br /></span><span style="color: #008080; "> 8</span> <span style="color: #800000; ">     Menu </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br /></span><span style="color: #008080; "> 9</span> <span style="color: #FF0000; ">          id </span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> popupMenu<br /></span><span style="color: #008080; ">10</span> <span style="color: #0000FF; ">          title: "&File"<br /></span><span style="color: #008080; ">11</span> <span style="color: #0000FF; "><br /></span><span style="color: #008080; ">12</span> <span style="color: #0000FF; ">          MenuItem {<br /></span><span style="color: #008080; ">13</span> <span style="color: #0000FF; ">              text: "&Open"<br /></span><span style="color: #008080; ">14</span> <span style="color: #0000FF; ">              onTriggered:{</span><span style="color: #000000; ">}</span><span style="color: #800000; "><br /></span><span style="color: #008080; ">15</span> <span style="color: #800000; ">          }<br /></span><span style="color: #008080; ">16</span> <span style="color: #800000; "><br /></span><span style="color: #008080; ">17</span> <span style="color: #800000; ">          MenuItem </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br /></span><span style="color: #008080; ">18</span> <span style="color: #FF0000; ">              text</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> "&Save"<br /></span><span style="color: #008080; ">19</span> <span style="color: #0000FF; ">              onTriggered: {</span><span style="color: #000000; ">}</span><span style="color: #800000; "><br /></span><span style="color: #008080; ">20</span> <span style="color: #800000; ">          }<br /></span><span style="color: #008080; ">21</span> <span style="color: #800000; "><br /></span><span style="color: #008080; ">22</span> <span style="color: #800000; ">          MenuItem </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br /></span><span style="color: #008080; ">23</span> <span style="color: #FF0000; ">              text</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> "&Close"<br /></span><span style="color: #008080; ">24</span> <span style="color: #0000FF; ">              onTriggered: Qt.quit()<br /></span><span style="color: #008080; ">25</span> <span style="color: #0000FF; ">          </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br /></span><span style="color: #008080; ">26</span> <span style="color: #800000; ">    }</span></div><img src ="http://www.shnenglu.com/gaimor/aggbug/216829.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/gaimor/" target="_blank">ccsdu2009</a> 2019-09-17 11:06 <a href="http://www.shnenglu.com/gaimor/archive/2019/09/17/216829.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>QML 鐜艦榪涘害鏉?/title><link>http://www.shnenglu.com/gaimor/archive/2019/09/16/216825.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Mon, 16 Sep 2019 08:38:00 GMT</pubDate><guid>http://www.shnenglu.com/gaimor/archive/2019/09/16/216825.html</guid><wfw:comment>http://www.shnenglu.com/gaimor/comments/216825.html</wfw:comment><comments>http://www.shnenglu.com/gaimor/archive/2019/09/16/216825.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/gaimor/comments/commentRss/216825.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/gaimor/services/trackbacks/216825.html</trackback:ping><description><![CDATA[<div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #800000; ">import QtQuick 2.5<br />import QtQuick.Layouts 1.2<br />import QtQuick.Controls 1.4<br />import QtQuick.Controls.Styles 1.4<br /><br />Rectangle </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />    id</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> circularProgressBar<br />    width: 60<br />    height: 60<br /><br />    color: "#333333"<br />    property real currentValue: 0<br />    property bool textVisible: true<br />    property bool canClick: false<br /><br />    Canvas {<br />        id: canvas<br />        anchors.fill: parent<br />        antialiasing: true<br /><br />        property color primaryColor: "transparent"<br />        property color secondaryColor: "lightblue"<br /><br />        property real centerWidth: width / 2<br />        property real centerHeight: height / 2<br />        property real radius: Math.min(canvas.width-10, canvas.height-10) / 2<br /><br />        property real minimumValue: 0<br />        property real maximumValue: 100<br />        property alias currentValue : circularProgressBar.currentValue<br /><br />        property string text: "0"<br />        property real angle: (currentValue - minimumValue) / (maximumValue - minimumValue) * 2 * Math.PI<br />        property real angleOffset: -Math.PI / 2<br /><br />        onPrimaryColorChanged: requestPaint()<br />        onSecondaryColorChanged: requestPaint()<br />        onMinimumValueChanged: requestPaint()<br />        onMaximumValueChanged: requestPaint()<br />        onCurrentValueChanged: requestPaint()<br /><br />        onPaint: {<br />            var ctx = getContext("2d")</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />            ctx.save();<br /><br />            ctx.clearRect(0, 0, canvas.width, canvas.height);<br /><br />            if(mouseArea.pressed) {<br />                ctx.beginPath();<br />                ctx.lineWidth = 10;<br />                ctx.fillStyle = Qt.lighter(canvas.secondaryColor,1.25);<br />                ctx.arc(canvas.centerWidth,<br />                        canvas.centerHeight,<br />                        canvas.radius,<br />                        0,<br />                        2*Math.PI);<br />                ctx.fill();<br /><br />                timer.running = true;<br />            </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br /><br />            ctx.beginPath();<br />            ctx.lineWidth = 10;<br />            ctx.strokeStyle = primaryColor;<br />            ctx.arc(canvas.centerWidth,<br />                    canvas.centerHeight,<br />                    canvas.radius,<br />                    angleOffset + canvas.angle,<br />                    angleOffset + 2*Math.PI);<br />            ctx.stroke();<br /><br />            ctx.beginPath();<br />            ctx.lineWidth = 3;<br />            ctx.strokeStyle = canvas.secondaryColor;<br />            ctx.arc(canvas.centerWidth,<br />                    canvas.centerHeight,<br />                    canvas.radius,<br />                    canvas.angleOffset,<br />                    canvas.angleOffset + canvas.angle);<br />            ctx.stroke();<br /><br />            ctx.restore();<br />        }<br /><br />        Text </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />            id</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> progressText<br />            anchors.centerIn: parent<br /><br />            font.pixelSize: 16<br />            text: canvas.text<br />            visible: circularProgressBar.textVisible<br />            color: canvas.secondaryColor<br />        </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br /><br />        MouseArea </span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />            id</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> mouseArea<br />            anchors.fill: parent<br />            visible: circularProgressBar.canClick<br />            onClicked: canvas.clicked()<br />            onPressedChanged: canvas.requestPaint()<br />        </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br /><br />        Timer</span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />            id</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> timer<br />            interval: 100</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />            running</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> true<br />            repeat: true</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />            onTriggered</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> {<br /><br />                if(circularProgressBar.currentValue === 100) {<br />                    circularProgressBar.currentValue = 0</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />                    progressText.text = "0"<br />                </span><span style="color: #000000; ">}</span><span style="color: #800000; "><br /><br />                circularProgressBar.currentValue += 1;<br />                progressText.text = circularProgressBar.currentValue.toString()+"%";<br />            }<br /><br />        }<br />    }<br />}</span></div><img src ="http://www.shnenglu.com/gaimor/aggbug/216825.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/gaimor/" target="_blank">ccsdu2009</a> 2019-09-16 16:38 <a href="http://www.shnenglu.com/gaimor/archive/2019/09/16/216825.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>QML姘旀場http://www.shnenglu.com/gaimor/archive/2019/09/16/216823.htmlccsdu2009ccsdu2009Mon, 16 Sep 2019 02:45:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/16/216823.htmlhttp://www.shnenglu.com/gaimor/comments/216823.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/16/216823.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216823.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216823.htmlimport QtQuick 2.11
import QtQuick.Controls 2.4

Rectangle
{
    id
: base
    width:640
    height:480
    color: backgroundColor

    property string backgroundColor: "#191919"
    anchors.margins: 6

    Rectangle {
        id: seekTimeBubble
        width: currentSeekTime.width + 14
        height: currentSeekTime.height + 21
        anchors.centerIn: parent
        color: parent.color

        Canvas {
            id: canvasSeekTime
            anchors.fill: parent
            property real radius: 9

            onPaint: {
                var ctx = getContext('2d')
                ctx.reset()
                ctx.strokeStyle = base.color
                ctx.lineWidth = 1
                ctx.clearRect(0, 0, width, height)
                ctx.beginPath()

                ctx.moveTo(0, radius)
                ctx.arcTo(0, 0, radius, 0,radius)

                ctx.lineTo(parent.width - radius, 0)
                ctx.arcTo(parent.width, 0, parent.width, radius, radius)

                ctx.lineTo(parent.width, parent.height - radius * 2)
                ctx.arcTo(parent.width, parent.height - radius,parent.width - radius,parent.height - radius, radius)

                ctx.lineTo(parent.width / 2 + 1.5*radius,parent.height - radius)
                ctx.lineTo(parent.width / 2, parent.height)
                ctx.lineTo(parent.width / 2 - 1.5*radius,parent.height - radius)
                ctx.lineTo(radius, parent.height - radius)
                ctx.arcTo(0, parent.height - radius, 0, parent.height - radius * 2, radius)

                ctx.closePath()
                ctx.clip()
                ctx.stroke()
                ctx.fillStyle = "#333333"
                ctx.fillRect(0, 0, width, height)
            
}

            Text 
{
                id
: currentSeekTime
                anchors {
                    top: parent.top
                    topMargin: 3
                    horizontalCenter: parent.horizontalCenter
                
}
                color: "#ffffff"
                font.pointSize: 12
                text: "03:21"
                onWidthChanged: 
{
                    canvasSeekTime.requestPaint()
                
}
            }
        }
        Glow 
{
            anchors.fill
: canvasSeekTime
            samples: 17
            color: "transparent"
            source: canvasSeekTime
        
}
    }
}


ccsdu2009 2019-09-16 10:45 鍙戣〃璇勮
]]>
QML StackLayouthttp://www.shnenglu.com/gaimor/archive/2019/09/11/216813.htmlccsdu2009ccsdu2009Wed, 11 Sep 2019 06:02:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/11/216813.htmlhttp://www.shnenglu.com/gaimor/comments/216813.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/11/216813.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216813.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216813.htmlimport QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Layouts 1.3
import QtQuick.Controls.Styles 1.4
import QtQuick.Dialogs 1.2

Rectangle 
{
    id
: container
    width: 640
    height: 360

    StackLayout {
        id: layout
        width: parent.width - 120
        height: 300

        anchors.top: parent.top
        anchors.topMargin: 6
        anchors.horizontalCenter: parent.horizontalCenter

        currentIndex: count - 1
        Rectangle {
            color: 'teal'
            implicitWidth: 200
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'plum'
            implicitWidth: 300
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'red'
            implicitWidth: 300
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'blue'
            implicitWidth: 300
            implicitHeight: 200
        
}
        Rectangle 
{
            color
: 'green'
            implicitWidth: 300
            implicitHeight: 200
        
}
    }

    Button 
{
        anchors.horizontalCenter
: parent.horizontalCenter
        anchors.top: layout.bottom
        anchors.topMargin: 6
        text: "Prev"

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


ccsdu2009 2019-09-11 14:02 鍙戣〃璇勮
]]>
QML DoubleSliderhttp://www.shnenglu.com/gaimor/archive/2019/09/11/216811.htmlccsdu2009ccsdu2009Wed, 11 Sep 2019 01:47:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/11/216811.htmlhttp://www.shnenglu.com/gaimor/comments/216811.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/11/216811.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216811.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216811.htmlimport QtQuick 2.2
import QtQuick.Controls 1.2

Rectangle 
{
    id
: doubleSlider
    width: 360
    height: 72
    color: "#c3c3c3"

    property int minValue: 0
    property int maxValue: 100
    property int lowValue: 0
    property int highValue: 100
    property int thumbWidth: 12
    readonly property int range: width - thumbWidth
    property var thumbColor: "#c030bb"
    property int lastX: 0

    signal value(int low,int high)

    Rectangle {
        id: startSlider
        width: doubleSlider.thumbWidth
        height: parent.height

        x: 0
        anchors.verticalCenter: parent.verticalCenter

        color: doubleSlider.thumbColor
    
}

    Rectangle 
{
        id
: endSlider
        width: doubleSlider.thumbWidth
        height: parent.height

        x: parent.width - endSlider.width
        anchors.verticalCenter: parent.verticalCenter

        color: doubleSlider.thumbColor
    
}

    MouseArea 
{
        id
: sliderMouseArea
        anchors.fill: parent
        hoverEnabled: true

        property point clickPos
        property var currentSlider: undefined

        onPressed: {
            updateCurrentSlider(mouse)
            clickPos = Qt.point(mouse.x,mouse.y)
        
}

        onPositionChanged:
{
            if(pressed && currentSlider != undefined){
                var delta = Qt.point(mouse.x-clickPos.x,mouse.y-clickPos.y)
                doubleSlider.lastX = currentSlider.x
                currentSlider.x = mouse.x
                fixSliderPosition()
            
}
        }

        onWheel: 
{
            if(currentSlider === undefined)
                return

            var delta = wheel.angleDelta.y/120
            currentSlider.x += delta
            fixSliderPosition()
        
}

        function fixSliderPosition()
{
            if(currentSlider === undefined)
                return

            if(currentSlider === startSlider &&
                    startSlider.x+startSlider.width > endSlider.x)
                currentSlider.x = endSlider.x-startSlider.width

            if(currentSlider === endSlider &&
                    endSlider.x < startSlider.x + startSlider.width)
                currentSlider.x = startSlider.x + startSlider.width


            if(currentSlider.x < 0)
                currentSlider.x = 0
            if(currentSlider.x > doubleSlider.width - currentSlider.width)
                currentSlider.x = doubleSlider.width - currentSlider.width

            if(currentSlider === startSlider){
                var v0 = 100*startSlider.x/doubleSlider.range
                if(v0 != lowValue){
                    lowValue = v0
                    doubleSlider.value(lowValue,highValue)
                
}
            }
            else if(currentSlider === endSlider)
{
                var v1 = 100*endSlider.x/doubleSlider.range
                if(v1 != highValue){
                    highValue = v1
                    doubleSlider.value(lowValue,highValue)
                
}
            }
        }

        function containPoint(input,minValue,maxValue)
{
            if(input < minValue || input > maxValue)
                return false
            return true
        
}

        function updateCurrentSlider(mouse)
{
            if(containPoint(mouse.x,startSlider.x,startSlider.x+startSlider.width)){
                currentSlider = startSlider
                doubleSlider.lastX = startSlider.x
            
}
            else if(containPoint(mouse.x,endSlider.x,endSlider.x+endSlider.width))
{
                currentSlider = endSlider
                doubleSlider.lastX = endSlider.x
            
}
        }
    }
}


ccsdu2009 2019-09-11 09:47 鍙戣〃璇勮
]]>
QML ListView灞曠ず鏃ュ織http://www.shnenglu.com/gaimor/archive/2019/09/10/216808.htmlccsdu2009ccsdu2009Tue, 10 Sep 2019 07:19:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/10/216808.htmlhttp://www.shnenglu.com/gaimor/comments/216808.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/10/216808.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216808.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216808.htmlimport QtQuick 2.2
import QtQuick.Controls 2.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Window 2.11
import QtQuick.Layouts 1.1


Rectangle
{
    anchors.rightMargin
: 4
    anchors.bottomMargin: 4
    anchors.leftMargin: 4
    anchors.topMargin: 4
    anchors.fill: parent

    ColumnLayout
    {
        spacing: 2
        anchors.fill: parent

        Rectangle
        {
            Layout.fillWidth: true
            Layout.fillHeight: true
            RowLayout {
                anchors.fill: parent
                Rectangle
                {
                    Layout.fillWidth: true
                    Layout.fillHeight: true

                    ListView {
                        id:idLogListView
                        focus:true

                        anchors.fill: parent
                        highlight: Rectangle { color: "#A0CED1" 
}
                        model: idListModle
                        delegate: Component
                        
{

                        RowLayout {

                            id
:idlistElemnet
                            height: 20
                            width: parent.width
                            spacing: 20
                            Layout.fillWidth: true

                            Rectangle {height: 16
                                width: 16
                                radius: 5
                                color:getListEleHeadColor(type)
                                Text{ anchors.centerIn: parent
}
                            }

                            Text 
{ text: time; font.bold: true}
                            Text 
{ text:type }
                            Text 
{ text:descripe; color:"blue" ; Layout.fillWidth: true}

                            states: State 
{
                                name
: "Current"
                                when: idlistElemnet.ListView.isCurrentItem
                                PropertyChanges { target: idlistElemnet
; x: 20 }
                            }
                            transitions: Transition 
{
                                NumberAnimation { properties
: "x"; duration: 200 }
                            }
                            MouseArea 
{
                                anchors.fill
: parent
                                onClicked: idlistElemnet.ListView.view.currentIndex = index
                            
}
                        }
                    }

                    Component.onCompleted:
                    
{
                        for(var idx=0;idx<100;idx++)
                        {
                            var newType=parseInt((Math.random(Math.random())*100+1)%3);
                            idListModle.append( { "descripe"
: "緋葷粺鏃ュ織..","time": "2016-10-2","type":newType});
                        }
                    }
                }

                ListModel 
{

                    id
:idListModle
                    ListElement {
                        descripe: "緋葷粺鏃ュ織"
                        time: "2016-11-2"
                        type:1
                    
}
                }
            }

            Rectangle
            
{
                Layout.fillHeight
: true
                id: scrollbar
                width: 10
;
                height
: 380
                color: "#D9D9D9"
                radius: 10
                Rectangle {
                    id: button
                    x: 0
                    y: idLogListView.visibleArea.yPosition * scrollbar.height
                    width: 10
                    height: idLogListView.visibleArea.heightRatio * scrollbar.height
;
                    color
: "#979797"
                    radius: 10
                    MouseArea {
                        id: mouseArea
                        anchors.fill: button
                        drag.target: button
                        drag.axis: Drag.YAxis
                        drag.minimumY: 0
                        drag.maximumY: scrollbar.height - button.height
                        onMouseYChanged: {
                            idLogListView.contentY = button.y / scrollbar.height * idLogListView.contentHeight
                        
}
                    }
                }
            }
        }
    }

    Rectangle
    
{
        Layout.preferredHeight
: 40
        Layout.fillWidth: true
        Layout.minimumHeight:40
    
}
}

    function getListEleHeadColor(ntype)
    
{
        switch(ntype)
        {
        case 0
:
            return "lightblue"
        case 1:
            return "red"
;
        case 2
:
            return "yellow"
;
        case 3
:
            return "green"
;
        default
:
            return "black"
;
        
}
    }

}


ccsdu2009 2019-09-10 15:19 鍙戣〃璇勮
]]>
QML 紿楀彛鍔ㄧ敾http://www.shnenglu.com/gaimor/archive/2019/09/06/216787.htmlccsdu2009ccsdu2009Fri, 06 Sep 2019 09:47:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/06/216787.htmlhttp://www.shnenglu.com/gaimor/comments/216787.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/06/216787.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216787.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216787.htmlimport QtQuick 2.2

Rectangle
{
    id
: rootItem
    width: 360
    height: 360
    color: "#cfcfcf"

    property int targetWidth: 0

    Rectangle{
        id: rect1
        width:360
        height:rootItem.height
        color:"#808080"
    
}

    Rectangle
{
        id
: rect2
        width:rootItem.width-rect1.width
        height:parent.height
        x:rootItem.width
        color:"#c0c0c0"
    
}

    Button
{
        text
: "Button"
        anchors.centerIn: parent
        onClicked: {
            animation.start()
        
}
    }

    NumberAnimation
{
        id
: animation
        target: rect1
        properties:  "width"
        to: rootItem.targetWidth
        duration: 720

        onStopped: rootItem.targetWidth = rootItem.width - to
    
}
}


ccsdu2009 2019-09-06 17:47 鍙戣〃璇勮
]]>
QML TableView浣跨敤http://www.shnenglu.com/gaimor/archive/2019/09/06/216784.htmlccsdu2009ccsdu2009Fri, 06 Sep 2019 09:26:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/06/216784.htmlhttp://www.shnenglu.com/gaimor/comments/216784.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/06/216784.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216784.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216784.htmlimport QtQuick 2.6
import QtQuick.Controls 1.4

Rectangle
{
    id
: rect1
    width: 640
    height: 480

    ListModel{
        id:libraryModel
        ListElement{title: "aaa"
; author: "AAA"}
        ListElement
{title: "bbb"; author: "BBB"}
        ListElement
{title: "ccc"; author: "ccc"}
    }

    TableView
{
        anchors.fill
: parent
        model:libraryModel

        TableViewColumn{role:"title"
; title: "Title"; width: 100}
        TableViewColumn
{role:"author"; title: "Author"; width: 200}

        rowDelegate: Rectangle
{
            height
: 50
            color: styleData.selected?"#f0b0b0af":(styleData.alternate?"#c3c3c0":"#c0c0c3")
        
}

        itemDelegate: Rectangle 
{
            height
: 50
            color: "transparent"
            Text {
                //anchors.centerIn: parent
                anchors.left: parent.left
                anchors.leftMargin: 6
                anchors.verticalCenter: parent.verticalCenter
                color: styleData.textColor
                text: styleData.value
                verticalAlignment: Text.AlignVCenter
                font.pointSize: 13
            
}
         }
    }
}


ccsdu2009 2019-09-06 17:26 鍙戣〃璇勮
]]>
QML 鎺т歡鍔ㄧ敾http://www.shnenglu.com/gaimor/archive/2019/09/06/216777.htmlccsdu2009ccsdu2009Fri, 06 Sep 2019 01:35:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/06/216777.htmlhttp://www.shnenglu.com/gaimor/comments/216777.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/06/216777.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216777.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216777.htmlimport QtQuick 2.2

Rectangle
{
    id
: rootItem
    width: 360
    height: 360
    color: "#cfcfcf"

    Rectangle{
        id: rect
        width: 50
        height: 50
        x: 0
        y: 5
        color: "#c0c0ff"

        MouseArea{
            id: mouseArea
            anchors.fill: parent
            onClicked: {
                animation.newHeight = 60
                animation.start()
            
}
        }

        ParallelAnimation
{
            id
: animation
            property int newHeight: 240
            NumberAnimation{
                target: rootItem
                properties:  "height"
                to: animation.newHeight
                duration: 300
            
}
            NumberAnimation
{
                target
: rootItem
                properties:  "y"
                to: y + (height-animation.newHeight)*0.5
                duration: 300
            
}
        }
    }
}


ccsdu2009 2019-09-06 09:35 鍙戣〃璇勮
]]>
QML騫寵鍔ㄧ敾http://www.shnenglu.com/gaimor/archive/2019/09/05/216774.htmlccsdu2009ccsdu2009Thu, 05 Sep 2019 08:16:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/05/216774.htmlhttp://www.shnenglu.com/gaimor/comments/216774.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/05/216774.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216774.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216774.htmlimport QtQuick 2.2

Rectangle
{
    id
: rootItem
    width: 360
    height: 240
    color: "#cfcfcf"

    Rectangle{
        id: rect
        width: 50
        height: 50
        x: 0
        y: 5
        color: "#c0c0ff"

        MouseArea{
            id: mouseArea
            anchors.fill: parent
            onClicked: {
                animation.start()
            
}
        }

        ParallelAnimation
{
            id
: animation
            NumberAnimation{
                target: rect
                properties:  "x"
                to: 100
                duration: 300
            
}
            NumberAnimation
{
                target
: rect
                properties:  "y"
                to: 100
                duration: 300
            
}
        }
    }
}


ccsdu2009 2019-09-05 16:16 鍙戣〃璇勮
]]>
QML Connections鎺ユ敹涓嶅埌c++淇″彿鐨勯棶棰?/title><link>http://www.shnenglu.com/gaimor/archive/2019/09/03/216760.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Tue, 03 Sep 2019 07:02:00 GMT</pubDate><guid>http://www.shnenglu.com/gaimor/archive/2019/09/03/216760.html</guid><wfw:comment>http://www.shnenglu.com/gaimor/comments/216760.html</wfw:comment><comments>http://www.shnenglu.com/gaimor/archive/2019/09/03/216760.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/gaimor/comments/commentRss/216760.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/gaimor/services/trackbacks/216760.html</trackback:ping><description><![CDATA[<div> 鏈夋椂鍊欎俊鍙峰彂閫佽繃蹇紝娑堟伅榪樻病榪囨潵錛屼嬌鐢?span style=" color:#800080;">Connections</span></div><div><span style=" color:#800080;">鏃犳硶鏀跺埌淇℃伅</span></div><div><span style=" color:#800080;">鍙互浣跨敤 signal.connect鐩存帴榪炴帴妲藉嚱鏁板嵆鍙?br /></span></div><img src ="http://www.shnenglu.com/gaimor/aggbug/216760.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/gaimor/" target="_blank">ccsdu2009</a> 2019-09-03 15:02 <a href="http://www.shnenglu.com/gaimor/archive/2019/09/03/216760.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>QML璋冭壊http://www.shnenglu.com/gaimor/archive/2019/09/02/216758.htmlccsdu2009ccsdu2009Mon, 02 Sep 2019 03:06:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/09/02/216758.htmlhttp://www.shnenglu.com/gaimor/comments/216758.htmlhttp://www.shnenglu.com/gaimor/archive/2019/09/02/216758.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216758.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216758.htmlItem {
      Rectangle {
          id
: item1
          x: 0
; width: 80; height: 80
          color: "#0000FF"
      
}
      Rectangle 
{
          id
:item2
          x: 100
; width: 80; height: 80
          color: Qt.tint(item1.color, "#80FF0000")
      
}
  }


ccsdu2009 2019-09-02 11:06 鍙戣〃璇勮
]]>
QML ListView 鎷栨嫿縐誨姩錛屼唬鐞嗗拰妯″瀷http://www.shnenglu.com/gaimor/archive/2019/08/30/216748.htmlccsdu2009ccsdu2009Fri, 30 Aug 2019 07:59:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/08/30/216748.htmlhttp://www.shnenglu.com/gaimor/comments/216748.htmlhttp://www.shnenglu.com/gaimor/archive/2019/08/30/216748.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216748.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216748.htmlimport QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2

Rectangle
{
    width
: 640
    height: 450

    ListModel
    {
        id: objmodel
        ListElement
        {
            name: "寮犻"
        
}
        ListElement
        
{
            name
: "鍗庝綏"
        
}
        ListElement
        
{
            name
: "鏈辨不"
        
}
        ListElement
        
{
            name
: "鍏瓩搴?
        
}
        ListElement
        
{
            name
: "琚佹湰鍒?
        
}
        ListElement
        
{
            name
: "鏉ㄦ澗"
        
}
    }

    Component
    
{
        id
: delegateItem
        Item
        {
            id: wrapper
            width: parent.width
            height: 30

            Text
            {
                id: coll
                text: name
                font.pointSize: 13
                color: wrapper.ListView.isCurrentItem? "red":"black"
            
}

            MouseArea
            
{
                id
: mousearea
                anchors.fill: parent
                onClicked:listview.currentIndex = index
;

                onMouseXChanged
:
                {
                    var pore = listview.indexAt(mousearea.mouseX + wrapper.x, mousearea.mouseY + wrapper.y)
;
                    if(index !== pore )
                    {
                        objmodel.move(index,pore,1)
                    
}
                }

                onMouseYChanged:
                
{
                    var pore = listview.indexAt(mousearea.mouseX + wrapper.x, mousearea.mouseY + wrapper.y);
                    if(index !== pore)
                    {
                        objmodel.move(index,pore,1)
                    
}
                }
            }
        }
    }

    ListView
    
{
        id
: listview
        width:240
        height:180
        anchors.centerIn: parent
        delegate: delegateItem
        model:objmodel
        interactive: false
        focus: true

        move: Transition
        {
            NumberAnimation { properties: "x,y"
; duration: 2100 }
        }
    }
}


ccsdu2009 2019-08-30 15:59 鍙戣〃璇勮
]]>
QML Loader鍔犺澆QMLhttp://www.shnenglu.com/gaimor/archive/2019/08/30/216747.htmlccsdu2009ccsdu2009Fri, 30 Aug 2019 05:39:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/08/30/216747.htmlhttp://www.shnenglu.com/gaimor/comments/216747.htmlhttp://www.shnenglu.com/gaimor/archive/2019/08/30/216747.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216747.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216747.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:"鐐瑰嚮鍔犺澆Loader"
        anchors.horizontalCenter: parent.horizontalCenter
        onClicked:
        {
            if(parent.load1)
            {
                loader.source = "SubRect1.qml"
                parent.load1 = false
            
}
            else
            
{
                loader.source = "SubRect2.qml"
                parent.load1 = true
            
}
        }
    }

    Loader
    
{
        id
:loader
        width: parent.width - 12
        height: parent.height - button.height - 12
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.topMargin: 6
        anchors.top: button.bottom
    
}
}

SubRect1.qml
import QtQuick 2.11
import QtQuick.Controls 2.4

Rectangle
{
    width:480
    height:320
    color:"#0fefc0"

    Component.onCompleted:
    {
        console.log("SubRect1.qml loaded")
    }

    /*Component.onDestroyed:
    {
        console.log("SubRect1.qml onDestroyed")
    }*/

    Component.onDestruction:
    {
        console.log("SubRect1.qml onDestructed")
    }
}



ccsdu2009 2019-08-30 13:39 鍙戣〃璇勮
]]>
QML鏂囦歡鎷栨嫿http://www.shnenglu.com/gaimor/archive/2019/08/29/216745.htmlccsdu2009ccsdu2009Thu, 29 Aug 2019 09:22:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/08/29/216745.htmlhttp://www.shnenglu.com/gaimor/comments/216745.htmlhttp://www.shnenglu.com/gaimor/archive/2019/08/29/216745.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216745.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216745.htmlimport QtQuick 2.11
import QtQuick.Controls 2.4

Rectangle
{
    width
:640
    height:480
    color:"#cfcfc0"
    DropArea
    {
        id: droparea
        anchors.fill: parent

        property bool hasUrls: false
        enabled: true

        onDropped:
        {
            if(drop.hasUrls)
            {
                var files = drop.urls
                console.log("drop files:",files)
            
}
        }
        onEntered:
        
{
            console.log("extered.")
        
}
    }

}


ccsdu2009 2019-08-29 17:22 鍙戣〃璇勮
]]>
QML鏃嬭漿鍙樿壊瀛椾綋http://www.shnenglu.com/gaimor/archive/2019/08/26/216740.htmlccsdu2009ccsdu2009Mon, 26 Aug 2019 02:03:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/08/26/216740.htmlhttp://www.shnenglu.com/gaimor/comments/216740.htmlhttp://www.shnenglu.com/gaimor/archive/2019/08/26/216740.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216740.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216740.htmlimport QtQuick 2.7
import QtQuick.Controls 2.0
import QtGraphicalEffects 1.0

Rectangle
{
    visible
: true
    width: 400
    height: 300

    Text
    {
        id: textID
        height: 240
        width: 240
        anchors.centerIn: parent
        text:"鐐瑰嚮榧犳爣鍙棆杞枃瀛?
        verticalAlignment: Text.AlignVCenter
        horizontalAlignment: Text.AlignHCenter
        font.pointSize: 13

        MouseArea
        {
            anchors.fill: parent
            onClicked:
            {
                if(rotationAnimation.running === true)
                    return
;
                rotationAnimation.start();
            
}
        }

        LinearGradient
        
{
            source
: textID
            width: 240
            height: 240
            gradient: Gradient
            {
                GradientStop
                {
                    position: 0.0
                    color: "#22F222"
                
}
                GradientStop
                
{
                    position
: 0.9
                    color: "#F0280F"
                
}
            }
            start: Qt.point(0,0)
            end: Qt.point(240,240)
        }
    }

    RotationAnimation
    
{
        id
: rotationAnimation
        target: textID
        from: currentAngle
        to: currentAngle+diff
        duration: 100
        readonly property int diff: 5
        property int currentAngle: 0
        property bool isDown: true

        onStopped:
        {
            rotationAnimation.from = rotationAnimation.to
            rotationAnimation.to = rotationAnimation.to+diff
;
        
}
    }
}


ccsdu2009 2019-08-26 10:03 鍙戣〃璇勮
]]>
Qt鎻掍歡鏍蜂緥http://www.shnenglu.com/gaimor/archive/2019/08/23/216731.htmlccsdu2009ccsdu2009Fri, 23 Aug 2019 09:49:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/08/23/216731.htmlhttp://www.shnenglu.com/gaimor/comments/216731.htmlhttp://www.shnenglu.com/gaimor/archive/2019/08/23/216731.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216731.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216731.html#include <QString>
#include 
<QtPlugin>
#include 
<QObject>

struct AddonInfo
{
    QString name;
    QString description;
    QString version;
    QString author;
};

class AddonInterface : public QObject
{
    Q_OBJECT
public:
    
virtual ~AddonInterface() {}
    
virtual AddonInfo addonInfo()const { return AddonInfo(); }
};

Q_DECLARE_INTERFACE(AddonInterface,
"com.ppx.addon.interface/1.0")

class AddonInterfaceIMPL : public AddonInterface
{
    Q_OBJECT
public:
    AddonInfo addonInfo()
const;

#if QT_VERSION >= 0x050000
    Q_PLUGIN_METADATA(IID 
"com.ppx.addon.interface")
    Q_INTERFACES(AddonInterface);
#endif 
};

#include "addon.h"
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2(FilterInterface,plugin)
#endif // QT_VERSION < 0x050000

AddonInfo AddonInterfaceIMPL::addonInfo()const
{
    AddonInfo addon;
    addon.name = "MyAddOn";
    addon.author = "Coder";
    addon.description = "Description";
    addon.version = "1.0";
    return addon;
}

浣跨敤
#include <qplugin.h>
#include <qpluginloader.h>
#include <qdebug>
#include "addon.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QPluginLoader loader("addon.dll");
    qDebug()<<"load plugin :"<<loader.load();

    auto object = loader.instance();
    qDebug() << "object:" << object;
    if (object)
    {
        AddonInterface* face = qobject_cast<AddonInterface*>(object);
        qDebug() << "face ptr:"<<face;
        auto info = face->addonInfo();
        qDebug() << info.author << " " << info.description << " " << info.name << " " << info.version;
    }

    return a.exec();
}



ccsdu2009 2019-08-23 17:49 鍙戣〃璇勮
]]>
QML 鍙嫋鎷界緝鏀劇煩褰㈡http://www.shnenglu.com/gaimor/archive/2019/08/22/216726.htmlccsdu2009ccsdu2009Thu, 22 Aug 2019 07:00:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/08/22/216726.htmlhttp://www.shnenglu.com/gaimor/comments/216726.htmlhttp://www.shnenglu.com/gaimor/archive/2019/08/22/216726.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216726.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216726.htmlimport QtQuick 2.4

Rectangle
{
    id: dragBackground
    visible: 
true
    color: 
"#dad1db"
    width:
720
    height:
480

    DragRectangle
    {
        z: 
10
        id:dragRectangle
        width: 
480
        height:
240

        Component.onCompleted:
        {
             dragBackground.makeViewCenter(dragRectangle)
        }
    }

    
function makeViewCenter(view)
    {
        
var cx = (width-view.width)*0.5
        
var cy = (height-view.height)*0.5
        view.x 
= cx
        view.y 
= cy
    }
}

Rectangle
import QtQuick 2.0

Rectangle
{
    id:resizeRectangle
    property int enableSize: 12
    property bool isPressed: false
    property point customPoint
    color: "#00debff3"
    border.color: "#d37e49"
    readonly property int minWidth: 64
    readonly property int minHeight: 64

    MouseArea
    {
        id: mouseArea
        anchors.fill: resizeRectangle
        drag.target: parent

        onWheel:
        {
            var diff_w = 0.0
            var diff_h = 0.0

            if(wheel.angleDelta.y > 0)
            {
                diff_w = resizeRectangle.width * 0.02
                diff_h = resizeRectangle.height * 0.02
            }
            else if(wheel.angleDelta.y < 0)
            {
                diff_w = -resizeRectangle.width * 0.02
                diff_h = -resizeRectangle.height * 0.02
            }
            else
            {
                resizeRectangle.width = width
                resizeRectangle.height = height
            }

            fixedRetangle(diff_w,diff_h)

            drag.minimumX = 0
            drag.maximumX = dragBackground.width - resizeRectangle.width
            drag.minimumY = 0
            drag.maximumY = dragBackground.height - resizeRectangle.height
        }
    }

    Item
    {
        id: leftTop
        width: enableSize
        height: enableSize
        anchors.left: parent.left
        anchors.top: parent.top

        MouseArea
        {
            anchors.fill: parent
            hoverEnabled: true

            onPressed: press(mouse)
            onEntered: enter(1)
            onReleased: release()
            onPositionChanged: positionChange(mouse, -1, -1)
        }
    }

    Item
    {
        id: top
        height: enableSize
        anchors.left: leftTop.right
        anchors.right: rightTop.left
        anchors.top: parent.top

        MouseArea
        {
            anchors.fill: parent
            hoverEnabled: true

            onPressed: press(mouse)
            onEntered: enter(2)
            onReleased: release()
            onMouseYChanged: positionChange(Qt.point(customPoint.x, mouseY), 1, -1)
        }
    }

    Item
    {
        id: rightTop
        width: enableSize
        height: enableSize
        anchors.right: parent.right
        anchors.top: parent.top

        MouseArea
        {
            anchors.fill: parent
            hoverEnabled: true

            onPressed: press(mouse)
            onEntered: enter(3)
            onReleased: release()
            onPositionChanged: positionChange(mouse, 1, -1)
        }
    }

    Item
    {
        id: left
        width: enableSize
        anchors.left: parent.left
        anchors.top: leftTop.bottom
        anchors.bottom: leftBottom.top

        MouseArea
        {
            anchors.fill: parent
            hoverEnabled: true

            onPressed: press(mouse)
            onEntered: enter(4)
            onReleased: release()

            onMouseXChanged: positionChange(Qt.point(mouseX, customPoint.y), -1, 1)
        }
    }

    Item
    {
        id: center
        anchors.left: left.right
        anchors.right: right.left
        anchors.top: top.bottom
        anchors.bottom: bottom.top

        MouseArea
        {
            anchors.fill: parent
            property point clickPos

            onPressed: clickPos = Qt.point(mouse.x,mouse.y)
            onPositionChanged:
            {
                if(pressed)
                {
                    var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y)
                    resizeRectangle.x += delta.x
                    resizeRectangle.y += delta.y
                    fixedRetangle(0,0)
                }
            }
        }
    }

    Item
    {
        id: right
        width: enableSize
        anchors.right: parent.right
        anchors.top: rightTop.bottom
        anchors.bottom: rightBottom.top

        MouseArea
        {
            anchors.fill: parent
            hoverEnabled: true

            onPressed: press(mouse)
            onEntered: enter(6)
            onReleased: release()
            onMouseXChanged: positionChange(Qt.point(mouseX, customPoint.y), 1, 1)
        }
    }

    Item
    {
        id: leftBottom
        width: enableSize
        height: enableSize
        anchors.left: parent.left
        anchors.bottom: parent.bottom

        MouseArea
        {
            anchors.fill: parent
            hoverEnabled: true

            onPressed: press(mouse)
            onEntered: enter(7)
            onReleased: release()
            onPositionChanged: positionChange(mouse, -1, 1)
        }
    }

    Item
    {
        id: bottom
        height: enableSize
        anchors.left: leftBottom.right
        anchors.right: rightBottom.left
        anchors.bottom: parent.bottom

        MouseArea
        {
            anchors.fill: parent
            hoverEnabled: true

            onPressed: press(mouse)
            onEntered: enter(8)
            onReleased: release()
            onMouseYChanged: positionChange(Qt.point(customPoint.x, mouseY), 1, 1)
        }
    }

    Item
    {
        id:rightBottom
        width: enableSize
        height: enableSize
        anchors.right: parent.right
        anchors.bottom: parent.bottom

        MouseArea
        {
            anchors.fill: parent
            hoverEnabled: true

            onPressed: press(mouse)
            onEntered: enter(9)
            onReleased: release()

            onPositionChanged: positionChange(mouse,1,1)
        }
    }

    function fixedRetangle(dx,dy)
    {
        if(resizeRectangle.width <= minWidth && resizeRectangle.height <= minHeight && dx <=0 && dy <= 0)
            return

        resizeRectangle.x -= dx*0.5
        resizeRectangle.y -= dy*0.5
        resizeRectangle.width += dx
        resizeRectangle.height += dy

        if(resizeRectangle.width < minWidth)
            resizeRectangle.width = minWidth
        if(resizeRectangle.height < minHeight)
            resizeRectangle.height = minHeight

        if(resizeRectangle.width > dragBackground.width)
            resizeRectangle.width = dragBackground.width
        if(resizeRectangle.height > dragBackground.height)
            resizeRectangle.height = dragBackground.height

        if(resizeRectangle.width + resizeRectangle.x > dragBackground.width)
            resizeRectangle.x = dragBackground.width - resizeRectangle.width
        if(resizeRectangle.height + resizeRectangle.y > dragBackground.height)
            resizeRectangle.y = dragBackground.height - resizeRectangle.height

        if(resizeRectangle.y < 0)
            resizeRectangle.y = 0

        if(resizeRectangle.x < 0)
            resizeRectangle.x = 0
    }

    function enter(direct)
    {
    }

    function press(mouse)
    {
        isPressed = true
        customPoint = Qt.point(mouse.x, mouse.y)
    }

    function release()
    {
        isPressed = false
    }

    function positionChange(newPosition,directX, directY)
    {
        if(!isPressed)
            return

        var delta = Qt.point(newPosition.x-customPoint.x, newPosition.y-customPoint.y)
        var tmpW,tmpH

        if(directX >= 0)
            tmpW = resizeRectangle.width + delta.x
        else
            tmpW = resizeRectangle.width - delta.x

        if(directY >= 0)
            tmpH = resizeRectangle.height + delta.y
        else
            tmpH = resizeRectangle.height - delta.y

        if(tmpW < resizeRectangle.minimumWidth)
        {
            if(directX < 0)
                resizeRectangle.x += (resizeRectangle.width - resizeRectangle.minimumWidth)
            resizeRectangle.width = resizeRectangle.minimumWidth
        }
        else
        {
            resizeRectangle.width = tmpW
            if(directX < 0)
                resizeRectangle.x += delta.x
        }

        if(tmpH < resizeRectangle.minimumHeight)
        {
            if(directY < 0)
                resizeRectangle.y += (resizeRectangle.height - resizeRectangle.minimumHeight)
            resizeRectangle.height = resizeRectangle.minimumHeight
        }
        else
        {
            resizeRectangle.height = tmpH
            if(directY < 0)
                resizeRectangle.y += delta.y
        }

        fixedRetangle(0,0)
    }
}



ccsdu2009 2019-08-22 15:00 鍙戣〃璇勮
]]>
Qt璋冩暣鍥劇墖HSL淇℃伅http://www.shnenglu.com/gaimor/archive/2019/08/22/216725.htmlccsdu2009ccsdu2009Thu, 22 Aug 2019 03:49:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/08/22/216725.htmlhttp://www.shnenglu.com/gaimor/comments/216725.htmlhttp://www.shnenglu.com/gaimor/archive/2019/08/22/216725.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216725.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216725.htmlvoid adjustImageHSL(QImage& image,qreal hue,qreal saturation,qreal lightness)
{
    unsigned 
int* data = (unsigned int*)image.bits();
    
int size = image.width()*image.height();
    QColor color;

    
for(int i = 0; i < size; i++)
    {
        
int red = qRed(data[i]);
        
int green = qGreen(data[i]);
        
int blue = qBlue(data[i]);
        color.setRed(red);
        color.setGreen(green);
        color.setBlue(blue);
        qreal h 
= color.hueF() + hue;
        qreal s 
= color.saturationF() + saturation;
        qreal l 
= color.lightnessF() + lightness;
        h 
= qBound<qreal>(0,h,1);
        s 
= qBound<qreal>(0,s,1);
        l 
= qBound<qreal>(0,l,1);
        color.setHslF(h,s,l);
        color.setAlpha(qAlpha(data[i]));
        data[i] 
= qRgba(color.red(),color.green(),color.blue(),color.alpha());
    }

    
return;
}


ccsdu2009 2019-08-22 11:49 鍙戣〃璇勮
]]>
QML popup鎺т歡http://www.shnenglu.com/gaimor/archive/2019/08/21/216719.htmlccsdu2009ccsdu2009Wed, 21 Aug 2019 07:58:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/08/21/216719.htmlhttp://www.shnenglu.com/gaimor/comments/216719.htmlhttp://www.shnenglu.com/gaimor/archive/2019/08/21/216719.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216719.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216719.htmlimport QtQuick 2.4
import QtQuick.Controls 
2.4
import QtQuick.Layouts 
1.3
import QtQuick.Dialogs 
1.2

Popup
{
    width: 
360
    height: 
90
    modal: 
true
    focus: 
true
    opacity: 
0.96

    
function setWarningText(input)
    {
        warningText.text 
= input
    }

    Text
    {
        id:warningText
        anchors.centerIn: parent
        text: 
"WarningText"
    }
}


ccsdu2009 2019-08-21 15:58 鍙戣〃璇勮
]]>
QML鍥劇墖緙╂斁鍜屾嫋鎷?/title><link>http://www.shnenglu.com/gaimor/archive/2019/08/20/216716.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Tue, 20 Aug 2019 05:53:00 GMT</pubDate><guid>http://www.shnenglu.com/gaimor/archive/2019/08/20/216716.html</guid><wfw:comment>http://www.shnenglu.com/gaimor/comments/216716.html</wfw:comment><comments>http://www.shnenglu.com/gaimor/archive/2019/08/20/216716.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/gaimor/comments/commentRss/216716.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/gaimor/services/trackbacks/216716.html</trackback:ping><description><![CDATA[<div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">import QtQuick </span><span style="color: #000000; ">2.9</span><span style="color: #000000; "><br /><br />Item<br />{<br />    visible: </span><span style="color: #0000FF; ">true</span><span style="color: #000000; "><br />    width: </span><span style="color: #000000; ">1620</span><span style="color: #000000; "><br />    height: </span><span style="color: #000000; ">720</span><span style="color: #000000; "><br />    id:background<br /><br />    Image<br />    {<br />        source: </span><span style="color: #000000; ">"</span><span style="color: #000000; ">images/2560.png</span><span style="color: #000000; ">"</span><span style="color: #000000; "><br />        anchors.fill: parent<br />    }<br /><br />    Flickable<br />    {<br />        id: flick<br />        anchors.top: parent.top;<br />        anchors.left: parent.left<br />        anchors.right: parent.right<br />        anchors.bottom: parent.bottom<br />        anchors.margins: </span><span style="color: #000000; ">3</span><span style="color: #000000; "><br />        contentWidth: </span><span style="color: #000000; ">0</span><span style="color: #000000; "><br />        contentHeight: </span><span style="color: #000000; ">0</span><span style="color: #000000; "><br />        clip: </span><span style="color: #0000FF; ">true</span><span style="color: #000000; "><br /><br />        Image<br />        {<br />            id: image<br />            smooth: </span><span style="color: #0000FF; ">true</span><span style="color: #000000; "><br />            transformOrigin: Item.Center<br />            source:</span><span style="color: #000000; ">"</span><span style="color: #000000; ">mark.png</span><span style="color: #000000; ">"</span><span style="color: #000000; "><br /><br />            onStatusChanged:<br />            {<br />                </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(status </span><span style="color: #000000; ">===</span><span style="color: #000000; "> Image.Ready)<br />                {<br />                    image.width </span><span style="color: #000000; ">*=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0.5</span><span style="color: #000000; "><br />                    image.height </span><span style="color: #000000; ">*=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0.5</span><span style="color: #000000; "><br /><br />                    image.x </span><span style="color: #000000; ">=</span><span style="color: #000000; "> background.width</span><span style="color: #000000; ">*</span><span style="color: #000000; ">0.5</span><span style="color: #000000; ">-</span><span style="color: #000000; ">0.5</span><span style="color: #000000; ">*</span><span style="color: #000000; ">image.width<br />                    image.y </span><span style="color: #000000; ">=</span><span style="color: #000000; "> background.height</span><span style="color: #000000; ">*</span><span style="color: #000000; ">0.5</span><span style="color: #000000; ">-</span><span style="color: #000000; ">0.5</span><span style="color: #000000; ">*</span><span style="color: #000000; ">image.height<br /><br />                    </span><span style="color: #008000; ">/*</span><span style="color: #008000; ">mouseArea.drag.minimumX = 0<br />                    mouseArea.drag.maximumX = flick.width - image.width<br />                    mouseArea.drag.minimumY = 0<br />                    mouseArea.drag.maximumY = flick.height - image.height</span><span style="color: #008000; ">*/</span><span style="color: #000000; "><br />                }<br />            }<br />        }<br />    }<br /><br />    </span><span style="color: #0000FF; ">function</span><span style="color: #000000; "> makeImageCenter(imageWidth,imageHeight)<br />    {<br />        </span><span style="color: #0000FF; ">var</span><span style="color: #000000; "> cx </span><span style="color: #000000; ">=</span><span style="color: #000000; "> image.x </span><span style="color: #000000; ">+</span><span style="color: #000000; "> </span><span style="color: #000000; ">0.5</span><span style="color: #000000; ">*</span><span style="color: #000000; ">image.width<br />        </span><span style="color: #0000FF; ">var</span><span style="color: #000000; "> cy </span><span style="color: #000000; ">=</span><span style="color: #000000; "> image.y </span><span style="color: #000000; ">+</span><span style="color: #000000; "> </span><span style="color: #000000; ">0.5</span><span style="color: #000000; ">*</span><span style="color: #000000; ">image.height<br /><br />        image.width </span><span style="color: #000000; ">=</span><span style="color: #000000; "> imageWidth<br />        image.height </span><span style="color: #000000; ">=</span><span style="color: #000000; "> imageHeight<br /><br />        image.x </span><span style="color: #000000; ">=</span><span style="color: #000000; "> cx </span><span style="color: #000000; ">-</span><span style="color: #000000; "> image.width</span><span style="color: #000000; ">*</span><span style="color: #000000; ">0.5</span><span style="color: #000000; "><br />        image.y </span><span style="color: #000000; ">=</span><span style="color: #000000; "> cy </span><span style="color: #000000; ">-</span><span style="color: #000000; "> image.height</span><span style="color: #000000; ">*</span><span style="color: #000000; ">0.5</span><span style="color: #000000; "><br />    }<br /><br />    MouseArea<br />    {<br />        id: mouseArea<br />        anchors.fill: flick<br />        drag.target: image<br /><br />        onWheel:<br />        {<br />            </span><span style="color: #0000FF; ">var</span><span style="color: #000000; "> diff_w </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0.0</span><span style="color: #000000; "><br />            </span><span style="color: #0000FF; ">var</span><span style="color: #000000; "> diff_h </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0.0</span><span style="color: #000000; "><br /><br />            </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(wheel.angleDelta.y </span><span style="color: #000000; ">></span><span style="color: #000000; "> </span><span style="color: #000000; ">0</span><span style="color: #000000; ">)<br />            {<br />                diff_w </span><span style="color: #000000; ">=</span><span style="color: #000000; "> image.width </span><span style="color: #000000; ">*</span><span style="color: #000000; "> </span><span style="color: #000000; ">0.02</span><span style="color: #000000; "><br />                diff_h </span><span style="color: #000000; ">=</span><span style="color: #000000; "> image.height </span><span style="color: #000000; ">*</span><span style="color: #000000; "> </span><span style="color: #000000; ">0.02</span><span style="color: #000000; "><br />            }<br />            </span><span style="color: #0000FF; ">else</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(wheel.angleDelta.y </span><span style="color: #000000; "><</span><span style="color: #000000; "> </span><span style="color: #000000; ">0</span><span style="color: #000000; ">)<br />            {<br />                diff_w </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">-</span><span style="color: #000000; ">image.width </span><span style="color: #000000; ">*</span><span style="color: #000000; "> </span><span style="color: #000000; ">0.02</span><span style="color: #000000; "><br />                diff_h </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">-</span><span style="color: #000000; ">image.height </span><span style="color: #000000; ">*</span><span style="color: #000000; "> </span><span style="color: #000000; ">0.02</span><span style="color: #000000; "><br />            }<br />            </span><span style="color: #0000FF; ">else</span><span style="color: #000000; "><br />            {<br />                image.width </span><span style="color: #000000; ">=</span><span style="color: #000000; "> width<br />                image.height </span><span style="color: #000000; ">=</span><span style="color: #000000; "> height<br />            }<br /><br />            </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(wheel.angleDelta.y </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0</span><span style="color: #000000; ">)<br />                background.makeImageCenter(image.width</span><span style="color: #000000; ">+</span><span style="color: #000000; ">diff_w,image.height</span><span style="color: #000000; ">+</span><span style="color: #000000; ">diff_h)<br /><br />            drag.minimumX </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0</span><span style="color: #000000; "><br />            drag.maximumX </span><span style="color: #000000; ">=</span><span style="color: #000000; "> flick.width </span><span style="color: #000000; ">-</span><span style="color: #000000; "> image.width<br />            drag.minimumY </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0</span><span style="color: #000000; "><br />            drag.maximumY </span><span style="color: #000000; ">=</span><span style="color: #000000; "> flick.height </span><span style="color: #000000; ">-</span><span style="color: #000000; "> image.height<br />        }<br />    }<br />}<br /></span></div><img src ="http://www.shnenglu.com/gaimor/aggbug/216716.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/gaimor/" target="_blank">ccsdu2009</a> 2019-08-20 13:53 <a href="http://www.shnenglu.com/gaimor/archive/2019/08/20/216716.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>QTreeView灝忎緥http://www.shnenglu.com/gaimor/archive/2019/08/19/216710.htmlccsdu2009ccsdu2009Mon, 19 Aug 2019 05:42:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/08/19/216710.htmlhttp://www.shnenglu.com/gaimor/comments/216710.htmlhttp://www.shnenglu.com/gaimor/archive/2019/08/19/216710.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216710.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216710.htmlvoid buildTreeItem(QObjectList* list,QStandardItem* item)
{
    
foreach(auto object,*list)
    {
        auto current 
= new QStandardItem();
        current
->setText(object->objectName());
        item
->appendRow(current);
        auto chidren 
= object->children();
        
if(!chidren.isEmpty())
            buildTreeItem(
&chidren,current);
    }
}

void buildTree(QTreeView* view,const QList<QObject*>& list)
{
    view
->header()->hide();
    view
->setColumnHidden(0,true);
    QStandardItemModel
* model = new QStandardItemModel(view);
    
foreach(auto object,list)
    {
        auto item 
= new QStandardItem(object->objectName());
        auto list 
= object->children();
        buildTreeItem(
&list,item);
        model
->appendRow(item);
    }
    view
->setModel(model);
}

QObject
* buildObjectTree(QObject* parent,const QString& text)
{
    auto 
object = new QObject(parent);
    
object->setObjectName(text);
    
return object;
}



    QWidget widget;
    auto box 
= new QVBoxLayout();
    widget.setLayout(box);
    QTreeView
* tree = new QTreeView(&widget);
    box
->addWidget(tree);

    QList
<QObject*> list;
    auto 
object = buildObjectTree(nullptr,"1");

    list.append(
object);
    
    buildObjectTree(
object"2");
    buildObjectTree(
object"3");
    
object = buildObjectTree(object"4");
    buildObjectTree(
object"5");
    buildObjectTree(
object"6");
    
object = buildObjectTree(object"7");

    buildObjectTree(
object"8");
    buildObjectTree(
object"9");
    buildObjectTree(
object"10");
    buildObjectTree(
object"11");
    
    buildTree(tree,list);
    widget.show();


ccsdu2009 2019-08-19 13:42 鍙戣〃璇勮
]]>
QML 鍗曚緥c++瀵硅薄娉ㄥ唽http://www.shnenglu.com/gaimor/archive/2019/08/16/216697.htmlccsdu2009ccsdu2009Fri, 16 Aug 2019 04:14:00 GMThttp://www.shnenglu.com/gaimor/archive/2019/08/16/216697.htmlhttp://www.shnenglu.com/gaimor/comments/216697.htmlhttp://www.shnenglu.com/gaimor/archive/2019/08/16/216697.html#Feedback0http://www.shnenglu.com/gaimor/comments/commentRss/216697.htmlhttp://www.shnenglu.com/gaimor/services/trackbacks/216697.htmlstatic QObject* cpp_qobject_singletontype_provider(QQmlEngine* engine,QJSEngine* scriptEngine)
{
    Q_UNUSED(engine)
    Q_UNUSED(scriptEngine)
    return cppobject;
}

qmlRegisterSingletonType<CppObject>("cppobject", 1, 0, "CppObject",cppobject_qobject_singletontype_provider);


ccsdu2009 2019-08-16 12:14 鍙戣〃璇勮
]]>
亚洲国产成人久久综合一区77| 久久AV高清无码| 日韩十八禁一区二区久久| 伊人久久国产免费观看视频| 久久精品国产男包| 久久91亚洲人成电影网站| 亚洲精品久久久www| 久久99国产综合精品免费| 久久精品国产WWW456C0M| 中文字幕无码精品亚洲资源网久久 | 精品久久久久久无码人妻热| 大香伊人久久精品一区二区| 18岁日韩内射颜射午夜久久成人 | 久久不射电影网| 香港aa三级久久三级老师2021国产三级精品三级在 | 国产成人99久久亚洲综合精品| 久久天天躁狠狠躁夜夜2020一| 韩国三级大全久久网站| 精品熟女少妇AV免费久久| 久久久久国产日韩精品网站| 久久精品国产91久久综合麻豆自制| 久久人人爽人人爽人人片AV东京热| 国产成人综合久久精品尤物| 国产亚洲精久久久久久无码| 一本一道久久综合狠狠老| 久久天天躁夜夜躁狠狠| 久久久黄色大片| 亚洲国产成人精品无码久久久久久综合 | 午夜精品久久久久久久无码| 久久国产综合精品五月天| 久久精品www| 91精品国产综合久久香蕉| 九九99精品久久久久久| 1000部精品久久久久久久久| 日产精品久久久一区二区| 久久乐国产综合亚洲精品| 亚洲精品成人网久久久久久| 久久久久久久91精品免费观看| 伊人久久大香线蕉综合热线| 亚洲国产小视频精品久久久三级| 精品视频久久久久|