View Single Post
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#1
How to call/open another page/application from within a QML file?

Using 'Qt.openUrlExternally works in some cases, like sending an email by using 'mailto:' but the same cannot be said for opening files, like say a 'jpg' or a page from an application.

This works, as an example for 'mailto';

Code:
    MouseArea {

        property string myText: "mailto: fred@bloggs.com"

        id: mouseArea
        anchors.fill: clockText
        onClicked: {
            Qt.openUrlExternally(myText)
        }

I am unable to open any .desktop file using Qt.openUrlExternally or pageStack.push methods - yet from shell, I can open jolla-clock a few ways, but not from within another file.

What am I missing here?

As an example, this works from within a QML file; (it opens the settings dialog for the given application)

Code:
    MouseArea {
        id: mouseArea
        anchors.fill: clockText
        onClicked: {
            pageStack.push(Qt.resolvedUrl("/usr/share/openrepos-clock-settings/clocksettings.qml"))
        }
But try doing this to open a .desktop file or even a file type like a jpg, despite changing pageStack.push for Qt.openUrl Externally(""), but it still doesn't function.

Any ideas of pointers for basically being able to open a page of one application from another.

I have trawled many pages and found conflicting/old/dead end information, barely any of which relates to SFOS.
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..

Last edited by Markkyboy; 2016-09-27 at 16:46. Reason: Qt.resolvedUrl or Qt.openUrlExternally
 

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