[Qt-qml] Shiny!

Jason H scorp1us at yahoo.com
Mon Jul 26 22:07:49 CEST 2010


Yeah, but you'll likely get bogged down if you do a lot of this.

For best results, put it in the artwork, and put your text on top, if text is to 
be there. It helps with readability.

But sometimes, you do want the shine to interfere. I'd be interested to know if 
Qt[ML] caches it by composting it so that int he future, as long as the contents 
don't change you don't end up doing 3 draw passes (background, foreground, and 
shine) every time rather tn just once.

I'd love to hear more about how QML objects are handled internally.




________________________________
From: "alan.westbrook at nokia.com" <alan.westbrook at nokia.com>
To: qt-qml at trolltech.com
Sent: Mon, July 26, 2010 2:28:03 PM
Subject: [Qt-qml] Shiny!

I was messing about with some controls I had written, and I wrote this to see if 
it might make something look shiny.

And it did!

So I'd like to share it with everyone.

It's pretty much a poor man's shine plastered on top of anything you stick it 
in.


---8<--- Shine.qml ---8<----------8<----------------------

import Qt 4.7
Rectangle {
    id: shine
    radius: parent.radius - 1
    smooth: true
    gradient: Gradient {
        GradientStop {
            position: 0
            color: "#aaffffff"
        }
        GradientStop {
            position: 1
            color: "#22ffffff"
        }
    }
    anchors.fill: parent
    anchors.bottomMargin: parent.height / 2
    anchors.topMargin: 1
    anchors.leftMargin: 1
    anchors.rightMargin: 1
}

---8<--------------------------8<-----------------------------

Just place a Shine  { } as the last item in an element, and Bam! lickable! =)

Alan

PS: Is there a site yet for sharing qml components?


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100726/8acf516b/attachment.html 


More information about the Qt-qml mailing list