简体   繁体   English

如何使用Qt到Xlib窗口绘制矩形

[英]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. 假设我有另一个Xlib窗口的ID,我想在此窗口矩形上绘制。 Is there way to to draw it using Qt? 有没有办法使用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. 我希望它将用白色填充窗口,但不会。

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. 效果将是相同的:窗口上方的矩形。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM