<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Il giorno mar 23 lug 2019 alle ore 12:00 David Boddie <<a href="mailto:david@boddie.org.uk">david@boddie.org.uk</a>> ha scritto:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The documentation about drawing on the desktop is very old - from Qt 3, if<br>
not earlier. I remember trying to draw on the desktop with Qt 4 (and maybe<br>
even Qt 3) using similar techniques but didn't manage to make it work.<br>
I would be very surprised if any modern desktop would allow this to be done.<br></blockquote><div><br></div><div>I thought the same thing, but I decided to give it a try anyway.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Plus, the painting model changed in Qt 4 to disallow (or deprecate) painting<br>
on widgets from outside of paint event handlers, so some of the tricks used<br>
in the old Qt 3 example won't work now.<br></blockquote><div><br></div><div></div></div><div>Indeed. Also, QDesktopWidget is obsolete for Qt5.</div><div>I tried to send a QPaintEvent to QApplication, but got this:</div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><font face="courier new, monospace">StdErr: QWidget::paintEngine: Should no longer be called</font></div></div></div><div><div><div><font face="courier new, monospace">QPainter::begin: Paint device returned engine == 0, type: 1</font></div></div></div></blockquote><div dir="ltr"><div><br></div><div>The same happens if I try to send that event to a new QWidget with Qt.Desktop </div><div>set as windowFlag (which doesn't call the paintEvent itself anyway).<br>Creating a new QWidget with the QDesktopWidget as a parent doesn't work either.</div><div><br></div><div>I seem to remember that it was (is?) possible to do it using Gtk along with Cairo, </div><div>but that was more than 5 years ago.</div><div><br></div><div>Does anyone know if it's possible to draw on the root window on X11 via Qt or,</div><div>at least, Python?</div><div><br></div><div>Thanks,</div><div>Maurizio</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature">È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi<br><a href="http://www.jidesk.net" target="_blank">http://www.jidesk.net</a></div></div></div></div>