Important: Please read the Qt Code of Conduct -

Tel: urls in Qt Webkit

  • Hi

    Is there any way to make the Tel: url in Qt Webkit actually start a phone call?


  • reimplement QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, QWebPage::NavigationType type) and check for (request.url().scheme() == "tel").

  • Hi Creep.

    I'm using Qt Webkit via a "QML WebView object": -- is there a moderately painless way of making my own QML WebView that uses a custom subclass of QWebPage? I have looked at the QDeclarativeWebView source and it defines its own QDeclarativeWebPage as a private class. Can I change that without copying the entire rest of the QDeclarativeWebView class?


  • hi,

    I don't work with the QML thing so i don't know exactly how to link between QDeclarativeWebView and QML WebView but i did take a look in QDeclarativeWebView[.cpp/_p.h] and here is what i suggest:

    1 - webView has more signal than what is documented in Nokia doc (all QDeclarativeWebView signals actually), can you take a quick check to verify if onUrlChanged:"Ok") show sth if you change your Url?
    2 - if 1 is true then you should reimplement QDeclarativeWebView by adding in QDeclarativeWebView_p.h
    void phoneNumber(const QString& message) as a signal
    then reimplement bool QDeclarativeWebPage::acceptNavigationRequest ( QWebFrame * frame, const QNetworkRequest & request, NavigationType type ) by adding sth like
    if (request.url().scheme() == “tel”)
    emit viewItem()->phoneNumber(xxx);
    3 - make phone call on onPhoneNumber(string) returns by WebView.

    Hope it would help.

  • Banned

    This post is deleted!

Log in to reply