Hello I made a HTML5 Application with QtCreator using QT5.
My main.cpp looks like the following:
#include <QApplication>
#include "html5applicationviewer.h"
#include "sqlfunctions.h"
int main(int argc, char *argv[])
{
sqlfunctions* obj = new sqlfunctions;
QApplication app(argc, argv);
Html5ApplicationViewer viewer;
viewer.setOrientation(Html5ApplicationViewer::ScreenOrientationAuto);
viewer.showExpanded();
viewer.loadFile(QLatin1String("src/index.html"));
viewer.setFixedSize(1200, 900);
return app.exec();
}
What i want to achieve is calling a C++ function to manipulate a SQL-Database, when for instance the user clicks on a button.
So basically i need something like the following (jQuery-shorthand):
$(document).ready(function(){
$("#button").click(function(){
mycppfunction();
});
};)
I already read in the documentation and this thread about the problem and the method addToJavascriptWindowObject()
. However since I do not have a QWebView
or QWebFrame
, how i can actually achieve the same functionality, or rebuild the app to work as described.