0
votes

i have a QWebEngineView that load a page like http://google.com and i want to load my keyboard to input boxes so i should use QWebChannel and WebEngineScript. i do all the thing for webchannel :import QtWebChannel 1.0 ,QT += webchannel in .pro , #include in main.cpp and i use Exposing qml Object to Website/Javascript using QWebChannel but i got the error js: Uncaught ReferenceError: QWebChannel is not defined.... i am using Qt 5.9.1

window.channel = new QWebChannel(qt.webChannelTransport, function(channel)

this new don't work and i think it's because javascript file "qrc:///qtwebchannel/qwebchannel.js" do not exist , how can i fix it?

1

1 Answers

2
votes

for interested people:

as i thought the problem wasqwebchannel.js that it didn't exist(i don't know why) so i found it and copy it to my javascript file then the problem solved but i got the problem that qt is not defined and after a lot search i understood that qwebengine works with objects just . i hope it helps someone