Search code examples
c++qtqt4xlibqpixmap

How to draw rectangle using Qt to Xlib window


Let say that i have id of another Xlib window and i want to draw over this window rectangle. Is there way to to draw it using Qt? I found on solution but it doesn't work for me:

QPixmap pix = QPixmap::fromX11Pixmap(wId, QPixmap::ExplicitlyShared);
pix.fill(QColor::fromRgb(255,255,255));

I expect it'll fill window with white color, but it doesn't.


Solution

  • You could embed this window, place an invisible window on top and render into this invisible window. The effect would be the same : a rectangle over the window.