I try to put widgets onto object-textures to have dialogs in a 3D-Scene.
I managed render QWidget, QGraphicsScene or QGraphicsView into QImage via QPainter and copy the image into my texture. Everything works fine:
mQtDialog = new EmbeddedDialog;
mQtScene = new QGraphicsScene();
mQtView = new QGraphicsView(mQtScene);@
for each 3drender loop:
QImage image(tex->GetWidth(), tex->GetWidth(), QImage::Format_ARGB32);
const uchar *imgdata = image.bits();
memcpy(tex.data, imgdata, tex->GetWidth() * tex->GetHeight() * 4);
But I found no way to address event handling. I can't call the show() method, otherwise the real dialog will shown on my screen.
Any suggestions how, capture events, transform it into texture space, and finally pass it to the Widget, Scene or View?
Calculate the screencoordinates into texture 2D coordinates is not the issue ;-)