Qt program
#include <QApplication>
#include <QUrl>
#include <QWebView>
#include <QNetworkProxy>
int main(int argc, char *argv[]){
QApplication a(argc, argv);
QNetworkProxy proxy(QNetworkProxy::HttpProxy, "proxy.host", proxy.port);
QNetworkProxy::setApplicationProxy(proxy);
QUrl url("http://htmlfive.appspot.com/static/draw.html");
QWebView* webView = new QWebView();
webView->load(url);
webView->show();
return a.exec();
}
QtRuby program
require 'Qt4'
require 'qtwebkit'
Qt::Application.new(ARGV) do
proxy = Qt::NetworkProxy.new(Qt::NetworkProxy::HttpProxy, "proxy.host", proxy.port)
Qt::NetworkProxy.application_proxy = proxy
Qt::WebView.new do
self.load Qt::Url.new('http://htmlfive.appspot.com/static/gifter.html')
show
end
exec
end
proxy.host and proxy.port should replace ones of your proxy environment.
No comments:
Post a Comment