How to use Qt.openUrlExternally in QML
This article demonstrates how to use the QML method Qt.openUrlExternally to make phone calls, send emails and open web links etc.
Article Metadata
Tested with
SDK: Nokia Qt SDK 1.1.3
Devices(s): N9,N950
Dependencies: QtQuick1.0
Article
Created: vineet.jain
(16 Dec 2011)
Last edited: hamishwillee
(11 Oct 2012)
Contents |
Making a phone call
Qt.openUrlExternally("tel:012345xxxxx")
Opening a web link on the device browser
Qt.openUrlExternally("http://m.youtube.com/")
Opening the Email editor with subject & body of email
Qt.openUrlExternally("mailto:someusername@servicename.com?subject=email editor opened & body=sometext")
Opening the native map application with desired co-ordinates
MeeGo
Qt.openUrlExternally("geo:61.446943,23.86449")
Symbian
Qt.openUrlExternally("http://m.ovi.me/?c=61.446943,23.86449")
Opening a file from device's folder
Qt.openUrlExternally("file:///home/user/MyDocs/Pictures/sample.jpg")


Contents
Vineet.jain - sms sending functionality
Though the above method also provides a way to send the sms, but that does NOT seems to be correctly work on MeeGo Harmattan right now, as i have tested on N9 only.The method is:
Qt.openUrlExternally("sms:01234567444" + "?body=" + "bodytext")
I cannot say if the sms sending will work correctly on other platforms like symbian or not as i have not tested on them.
I will also attach a working example project soon for the MeeGo Harmattan target.
Thanks
Vineetvineet.jain 09:38, 16 December 2011 (EET)
Vdharankar - Code Example
Dear Vineet,
It will be nice to club such small article with some other similar kind of code/explanation or a code example demoing the same thing
VishalVishal Dharankar 21:34, 20 December 2011 (EET)
Hamishwillee - Hi Vishal, what do you mean?
This looks like a nice set of three examples on how to use the code. Can you be more specific on what else you'd like it to do?hamishwillee 08:15, 21 December 2011 (EET)
Vineet.jain - Regarding Article
Hi Vishal,Well i could not found any article depicting the usability of the above method in any sort.Also i used all these methods in my code which i have to search first separately to use them.Thereby i thought it would be good to have all these usability methods at one place. Also though these are very short lines of code, but much usable i suppose.
Thanks
Vineetvineet.jain 12:52, 21 December 2011 (EET)
Chanderk - Anything else possible with this function ?
Well, I acknowledge the point raised by Vineet. I wonder is it possible to implement any other functionalists with OpenUrlExternally ? or are these the only possibilities ( SMS, Browser, Phonecall, email )?
I can think of one more Qt.openUrlExternally("geo:55.6124,12.9996") to open maps with the given coordinates.
Cheers !chanderk 19:58, 17 February 2012 (EET)
Vineet.jain - Chanderk - Thanks
hello Chanderk, i have verified the the method you mentioned at my end & added it to the article. Along with that i have also added another method which opens a file located in the device.
Also in future if you feel that you can add/correct any useful info to the article(whether any code, any correction in existing code etc) then feel free to do it.
Thanks
Vineetvineet.jain 10:08, 20 February 2012 (EET)
Parancibia - Open Nokia Maps with Symbian
On Symbian Qt.openUrlExternally("geo:61.446943,23.86449") don't works, insteed you can use Qt.openUrlExternally("http://m.ovi.me/?c=-34.603611,-58.381667")parancibia 16:57, 14 May 2012 (EEST)
Hamishwillee - @Parancibia - thanks for updating the article
Nice to see someone using the wiki as intended!hamishwillee 05:55, 21 May 2012 (EEST)