[osg-users] osgQt::QWidgetImage and Key/Mouse events

Aitor Ardanza aitoraltube at terra.es
Fri Apr 1 01:09:00 PDT 2011


I put it again if the previous post goes unnoticed...

Why using osgQt::QWebViewImage and osgWidget::Browser not me run this method?

Code:
osg::ref_ptr<osgQt::QWebViewImage> image = new osgQt::QWebViewImage();
image->getQWebView()->setUrl(QString(url.c_str()));
image->getQWebView()->settings()->setAttribute(QWebSettings::JavascriptEnabled, true); 
image->getQWebView()->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
image->getQWebPage()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
		
float pos[] = {-8.2,4.0,1.60}; //pos
float widthVec[] = {1.0,0.0,0.17}; //wVec
float heightVec[] = {-0.12,0.0,1.0}; // hVec
float wSize = 3.4; //wRes 
float hSize = 1.85; //hRes 
osgWidget::GeometryHints hints(osg::Vec3(0.0f,0.0f,0.0f),//pos
osg::Vec3(widthVec[0]*wSize,widthVec[2]*wSize,widthVec[1]*wSize),//wVec
osg::Vec3(heightVec[1]*hSize,heightVec[0]*hSize,heightVec[2]*hSize),//hVec
osg::Vec4(1.0f,1.0f,1.0f,1.0f), //color
osgWidget::GeometryHints::IGNORE_DOCUMENT_ASPECT_RATIO);//AspectRatioPolicy

osgWidget::Browser* browser = new osgWidget::Browser();
browser->setName("MyBrowser");
browser->assign(image.get(), hints);

webBrowserTrans->addChild(browser);
BrowserHandler* handler = new BrowserHandler(image.get());//, texture, camera);
browser->setEventCallback(handler);
browser->setCullCallback(handler);



------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=38155#38155








More information about the osg-users mailing list