Reputation: 1
What is the proper way to open a url from a Ubuntu-scope in c++? (this is Ubuntu touch specific)
This is what I've tried (This function is called from the ActivationResponse.):
static void open_url(std::string const& uri) {
// url_dispatch_send(uri.c_str(), NULL, NULL);
/*
* I found this in the libertine-scope, but I wasn't able to import
* the right libraries
*/
// Qt.openUrlExternally(uri.c_str());
/*
* I found this at https://developer.ubuntu.com/en/phone/platform/guides/url-dispatcher-guide/
* and https://developer.ubuntu.com/en/phone/apps/qml/tutorials/register-your-app-url-dispatcher/
* but it is actually meant to be used in QML, so it isn't recognized.
* I hoped it would work by using QtQuick or QtQml
*/
// QDesktopServices::openUrl(QUrl(QString(uri), QUrl::TolerantMode));
// QDesktopServices::openUrl(QUrl("http://www.google.com", QUrl::TolerantMode));
/*
* I found this at https://developer.ubuntu.com/en/phone/platform/guides/url-dispatcher-guide/
* and http://doc.qt.io/qt-5/qdesktopservices.html#openUrl
* this compiles, but the scope crashes on execution.
*
*/
}
Upvotes: 0
Views: 100