View Single Post
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#29
I added this to lipstick-jolla-home-qt5/lockscreen/Clock.qml;

Code:
WindDirection {
                id: windDirection
                anchors {
                    top: weatherBanner.bottom
                    topMargin: Theme.paddingLarge*2
                    horizontalCenter: parent.horizontalCenter
                }
                text: windDirection.text
        }
Then create WindDirection.qml in the same folder as Clock.qml and enter the following contents;

Code:
    import QtQuick 2.2
        import Sailfish.Silica 1.0
        import Sailfish.Weather 1.0

        Label {
            id: windDirection
            text: {
                if      (model.windDirection==0)   'N'
                else if (model.windDirection==45)  'NE'
                else if (model.windDirection==90)  'E'
                else if (model.windDirection==135) 'SE'
                else if (model.windDirection==180) 'S'
                else if (model.windDirection==225) 'SW'
                else if (model.windDirection==270) 'W'
                else if (model.windDirection==315) 'NW'
            }
    }
I've tried various import statements for both files but none seems to help, the 'why' is what's bugging me!
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following 2 Users Say Thank You to Markkyboy For This Useful Post: