View Single Post
merlin1991's Avatar
Posts: 125 | Thanked: 1,142 times | Joined on Feb 2010 @ Austria
#2
It's been a while since I did this and there might be better ways nowadays, but here I go:

Since you didn't describe you actual situation (except it doesn't work) and atm I can't test the sample, have some pointers:

If you don't see your coveraction, CoverActionList has an enabled property (boolean).

onTriggered is called/executed when you touch the action, calling the resolved string of your qml file ofc won't do anything.

Instead call a function that does all the heavy lifting of changing application state, so basically:

Code:
import QtQuick 2.4
import Sailfish.Silica 1.0

CoverBackground {
    CoverPlaceholder {
        id: coverPlaceholder
        text: "National Rail"
        icon.source: "../images/harbour-nationalrail.png"
    }
    CoverActionList {
        CoverAction {
            iconSource: "image://theme/icon-cover-search"
            onTriggered: showSearch()
        }
    }

    function showSearch() {
        pageStack.push(Qt.resolvedUrl("Search.qml"))
        appWindow.activate()
    }
}
appWindow is the id of your ApplicationWindow, you can play with the parameters of pageStack.push to get the desired effect ie. no transition to the new page, see https://sailfishos.org/develop/docs/...l/#push-method
__________________
"Fog is neither water nor air, it's something between." Merlin
 

The Following 9 Users Say Thank You to merlin1991 For This Useful Post: