Hi!

Attaching file with example.

But, anyway, if you are trying to create markdown editor it is much easier
and appropriate to use native api (not webkit/webengine):
https://github.com/pbek/qmarkdowntextedit/blob/develop/markdownhighlighter.h

2018-03-26 12:31 GMT+03:00 Michael Fuchs <mic...@gmx.at>:

> Hi sailors,
>
> is there a way to communicate with a WebView?
>
> I would like to make something like this:
> https://doc.qt.io/qt-5.6/qtwebengine-webenginewidgets-markdo
> wneditor-example.html
>
> ...but WebChannels don't seem to be available.
>
> Also WebView.runJavaScript() isn't there.
>
> Thanks a lot,
>
> Michael.
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe@lists.sailfi
> shos.org
import QtQuick 2.2
import Sailfish.Silica 1.0
import QtWebKit 3.0
;import QtWebKit.experimental 1.0

WebView {
    id: webView

    signal messageReceived(var message)

    function runJavaScript(script, callback) {
        return webView.experimental.evaluateJavaScript(script, callback);
    }

    property Item _webPage: webView.experimental.page
    experimental.preferredMinimumContentsWidth: _webPage.width
    experimental.deviceWidth: Screen.width
    experimental.deviceHeight: Screen.height
    experimental.enableInputFieldAnimation: false

    experimental.preferences.navigatorQtObjectEnabled: true
    experimental.onMessageReceived: webView.messageReceived(message)
}
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to