First, access to the HTML5 demo: Canvas | Drawing Board by Qt program.
#include <QApplication>
#include <QUrl>
#include <QWebView>
int main(int argc, char *argv[]){
QApplication a(argc, argv);
QUrl url("http://htmlfive.appspot.com/static/draw.html");
QWebView* webView = new QWebView();
webView->load(url);
webView->show();
return a.exec();
}
This runs successfully:
and can draw lines in canvas by mouse successfully, too.
Second, access to the HTML5 demo: Canvas | 1st-Person Gifter by QtRuby program.
require 'Qt4'
require 'qtwebkit'
Qt::Application.new(ARGV) do
Qt::WebView.new do
self.load Qt::Url.new('http://htmlfive.appspot.com/static/gifter.html')
show
end
exec
end
Of course. this runs successfully too and move in maze with arrow keys:
Note that canvas tag is rendered easily, but that video tag depends on environment like video format and codec in client. At least, in my environment (on openSUSE 11.1), video tag isn't rendered not only with QtWebkit but also with HTML5 support browsers(Firefox, Opera, Konqueror).
No comments:
Post a Comment