PDA

View Full Version : QtWebView call c++ functions on Android



yagabey
3rd August 2017, 11:24
Hi All,

I need to call some c++ functions from webview. Using QWebEngineView with QWebchannel was a great option until I realized that QWebEngineView is not supported on Android. So the only thing I have is QtWebView...

I googled for hours, but I couldn't find any answer.

Isn't there any way to call c++ procedures from QtWebView on "Android".

Thanks in advance

patrik08
4th August 2017, 09:03
Android Studio, the official IDE from Google, is not only java....
https://www.sitepoint.com/using-c-and-c-code-in-an-android-app-with-the-ndk/

or

https://github.com/search?l=C%2B%2B&o=desc&q=Android&s=stars&type=Repositories&utf8=%E2%9C%93

or QT QXmlQuery mixed...
this is so many way....




QDateTime timer1( QDateTime::currentDateTime() );
StreamBuf *buf = new StreamBuf();
QXmlQuery xquery(QXmlQuery::XSLT20);
xquery.setFocus(QUrl("http://www.qtcentre.org/external.php?type=RSS2&forumids=2"));
xquery.bindVariable("unixtime", QVariant(timer1.toTime_t()));
xquery.bindVariable("ddate", QVariant(timer1.toString()));
xquery.bindVariable("pathinfoapp", QVariant( qApp->applicationDirPath() ));
xquery.setQuery(QUrl("https://raw.githubusercontent.com/pehohlva/DocSpeacker/master/src/resource/browser_rss.xsl"));
xquery.evaluateTo(buf->device());
_doc->setHtml ( buf->data() );
///// from https://github.com/pehohlva/DocSpeacker/blob/master/3rdparty/oldtimer/DrawDocument/main.cpp


I find so many way on target android..
What do you want to do or reach?

yagabey
4th August 2017, 10:13
Thanks, i will have a look..

patrik08
4th August 2017, 12:15
you're welcome ....
in my mac box i have install two version from qt desktop + mobile device... and i switsh
from qt version qt5.9 to qt5.5(latest wo webkit is inside...
in my long .bash_profile file i set so many aliases to work.




# latest qt 5.1 + webkit in latest having !
# export PATH="/usr/local/opt/qt@5.5/bin:$PATH"
# export PATH="/usr/local/opt/qt5/bin:$PATH"

# latest qt 5.9.2
# export PATH="/Users/dev/Applications/qt5.9.1/bin:$PATH"
# export PATH="/Users/dev/Applications/qt5.9.1/bin:$PATH"
#
# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
# active qt QTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQT QTQTQTQTQT
# export PATH="/Users/dev/Applications/qt5.9.1/bin:$PATH"
export PATH="/usr/local/opt/qt@5.5/bin:$PATH"
# active qt QTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQTQT QTQTQTQTQT
# swap or edit this file!
# MYSQL
export PATH="/usr/local/mysql/bin:$PATH"
alias swap='cd && ls && atom .bash_profile'
alias viswap='cd && vi .bash_profile'
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH

alias go='cd /Users/dev/sandbox' # go to git dir qt C C++ &&
alias w1='cd /Users/dev/Sites/' # go to nix server & php
alias load='source ~/.bash_profile' # reload the file here
alias pip3='python3.6'
alias python='python3.6'
alias dfind='analizedir'



have a look by https://gist.github.com/natelandau/10654137

to make live simply ..

nice day...