Note that there are some explanatory texts on larger screens.

plurals
  1. POConnecting QPixmaps with the data being drawn on them
    primarykey
    data
    text
    <p>I am looking for a way to connect the QPixmap and the data being written on it, so that in the end I can have an accurate record of what is currently on the screen.</p> <pre><code>void QPainter::drawRects(const QRectF *rects, int rectCount) </code></pre> <p>This is an example function from qpainter.cpp (found in ./src/gui/painting in the Qt SDK) What I am trying to get is the Pixmap that the rectangle is being written to (in the case when device()->devType() is a Pixmap). So I have this check:</p> <pre><code>if(this-&gt;device()-&gt;devType() == QInternal::Pixmap) { const QPixmap *Pixmap = dynamic_cast&lt;const QPixmap *&gt;(this-&gt;device()); qDebug() &lt;&lt; "rect2pixmap - address: "&lt;&lt;Pixmap&lt;&lt;" - key: "&lt;&lt;Pixmap.cacheKey(); } </code></pre> <p>I tried finding the memory address of the Qpixmap and checking it against the memory addresses of the QPixmaps being written to the screen.</p> <pre><code>void QPainter::drawPixmap(const QPointF &amp;p, const QPixmap &amp;pm) { const QWidget *widget = dynamic_cast&lt;const QWidget *&gt;(this-&gt;device()); qDebug() &lt;&lt; "pixmap - address: "&lt;&lt;&amp;pm &lt;&lt; " - key: "&lt;&lt;pm.cacheKey(); [...] </code></pre> <p>But the addresses are all different. I also tried using cachekeys, but I faced the same problem.</p> <p>Here's a sample console output:</p> <pre><code>rect2pixmap - address: 0x7fffac1dc9c0 - key: 72057594037927937 rect2pixmap - address: 0x7fffac1d9f80 - key: 72057598332895233 rect2pixmap - address: 0x7fffac1dcd60 - key: 72057602627862529 rect2pixmap - address: 0x7fffac1dcd60 - key: 72057606922829825 rect2pixmap - address: 0x7fffac1dd100 - key: 72057611217797121 rect2pixmap - address: 0x7fffac1df2e0 - key: 72057615512764417 pixmap - address: 0x7fffac1dffa0 - key: 197568495616 pixmap - address: 0x7fffac1e0170 - key: 214748364800 pixmap - address: 0x7fffac1e0340 - key: 231928233984 pixmap - address: 0x7fffac1e0510 - key: 249108103168 pixmap - address: 0x7fffac1e06e0 - key: 261993005056 rect2pixmap - address: 0x7fffac1dadb0 - key: 72057619807731713 </code></pre> <p>So what I am asking is there anyway to link between the pixmap that the rect is being written to and the pixmap that is being printed later on to the screen? And can I safely assume that the rects aren't being shown on the screen if no Pixmaps are ever called?</p> <p>If anything isn't clear abut the question, please tell me, and I'll try to clarify as best as I can.</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload