January 19, 2011

10110111 10110111
Lab Rat
3 posts

QPainter over Xlib window

 

Suppose i have an XID of a window. How can i wrap QPainter to draw on this window? I need something like cairo_xlib_surface_create(), but Qt-based.

3 replies

January 19, 2011

peppe peppe
Ant Farmer
1029 posts

Not sure about X Windows, but you can paint on X Pixmaps using QPixmap::fromX11Pixmap(id, QPixmap::ExplicitlyShared) and painting on it.

 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

January 19, 2011

10110111 10110111
Lab Rat
3 posts

> Not sure about X Windows, but you can paint on X Pixmaps using QPixmap::fromX11Pixmap(id,
> QPixmap::ExplicitlyShared) and painting on it.
Will drawing on it update pixmap on X server side, or will this be a new QPixmap (a copy) when i draw on it?

January 20, 2011

10110111 10110111
Lab Rat
3 posts

Ah, understood. Didn’t notice QPixmap::ExplicitlyShared first. Thanks and sorry for previous message :).

 
  ‹‹ One Point of the Qt LGPL license      Highlighting partial text inside QTableView ››

You must log in to post a reply. Not a member yet? Register here!