PDA

View Full Version : Problem with MyGraphicsView->winId()



carfaper
23rd February 2017, 07:49
Hi,
I have a gui program with a QGraphicsView and other widgets, and with a timer (1 second) that updates the graphical interface.

I need to use old libraries to draw some graphics in my QGraphicsView so I need to obtain the Display and Window Handle to pass to xlib libraries. So I do the following:

Display *d = QX11Info::display();
WId w = ui->graphicsView->winId();

The problem is that when I call the function winId, my QGraphicsView stops repainting (but not updating because I see changes when I minimize and maximize again my application). If I comment this line (the second one) my Graphical interface works as expected.

I'm not new in programming but I don't understand this behavior.

Thanks for your help.

anda_skoa
23rd February 2017, 10:10
Can you try getting the winId of the view's "viewport" widget?

Cheers,
_