How would you convert the following simple QT example in C using the QWebView widget to Java (QtJambi):
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWebView view;
view.load(QUrl("http://www.trolltech.com/"));
view.show();
return app.exec();
}
(Located at: http://doc.qt.nokia.com/qq/qq26-webplugin.html#qtwebkitbasics)
I could be mistaken but I think I recall such an example being present in the Qt-Jambi javadoc last year, but I can’t find it any more, when I go to http://qt-jambi.org/documentation it says “Apidoc of newest built (sic) is not still working”
The API in Qt Jambi is very similar to the original Qt API so the samples can be translated almost directly.
So the C++ version
Is translated to the following in Java
The rest of the application (creating the main window, running the app) can be found in the hello world tutorial.
I don’t have a working environment on my home mac, but this sample should work: