Important: Please read the Qt Code of Conduct -

Sms with Qt.Openurlexternally

  • hello i have a little problem with qt.openurlexternally function. I want to send via sms/email current position coordinates with qt.openurlexternally and positionsource. But i don't know how to do that. I have tried with this code but it doesn't works. can anyone help, please?

    @import QtQuick 1.1
    import 1.1
    import QtMobility.location 1.1
    PositionSource {
    id: positionSource
    updateInterval: 1000
    active: true

    Text {
    id: mytext
    x: 17
    y: 126
    text: "latitude: " + positionSource.position.coordinate.latitude
    anchors.verticalCenterOffset: -187
    anchors.horizontalCenterOffset: 0
    font.pixelSize: 12
    anchors.centerIn: parent

    Button {
    id: mail
    x: 80
    y: 192
    width: 200
    height: 56
    text: "Send via mail"
    iconSource: ""
    onClicked: Qt.openUrlExternally(" editor opened & body=mytext.text")

    Button {
    id: sms
    x: 80
    y: 266
    width: 200
    height: 56
    text: "Send via sms"
    onClicked: Qt.openUrlExternally("sms:?body=mytext.text")

    ToolBar {
    id: toolbar2
    x: 0
    y: 580

    ToolButton {
        id: toolbutton9
        x: 6
        y: 5
        width: 50
        iconSource: "toolbar-back"
        onClicked: Qt.quit()


  • What platform are you trying? I am not sure all will support something like this... I don't think any of them will send automatically anyway: they may open the default application that can handle "that type" but will require the user to confirm.

    Not sure what the best way is but on Maemo, Linux, Meego you can use telepathy to handle SMS.

  • I am trying symbian^3

  • I have not tried and am not even sure it is available on Symbian but you could try using the "messaging mobility module":

    According to "this post": it should/could be available.

    If you do please make sure to report back. I want to try myself when I get a chance

Log in to reply