<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Using QImage pointer from a QPainter method]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I have to code a method just to display an image. No big deal at all, except that for some reason out of my control, I have to receive the image as a pointer.</p>
<pre><code>void MyClass::paintImage(const QPoint &amp;point, QImage *image) 
{    
    QPainter painter;
    painter.drawImage(point, ______________ );
}
</code></pre>
<p dir="auto">Understanding that the <strong>QPainter::drawImage()</strong> method requires a non-pointer variable by definition:</p>
<pre><code>void QPainter::drawImage(const QPointF &amp;point, const QImage &amp;image)
</code></pre>
<p dir="auto">How can I make a reference of the image pointer from this method?  Is it possible?<br />
Thanks.</p>
]]></description><link>https://forum.qt.io/topic/66732/using-qimage-pointer-from-a-qpainter-method</link><generator>RSS for Node</generator><lastBuildDate>Thu, 07 May 2026 10:06:42 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/66732.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 04 May 2016 17:33:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Using QImage pointer from a QPainter method on Wed, 04 May 2016 18:33:44 GMT]]></title><description><![CDATA[<p dir="auto">Just dereference it after checking for null</p>
<pre><code>void MyClass::paintImage(const QPoint &amp;point, QImage *image) 
{    
if(image){
    QPainter painter;
    painter.drawImage(point, *image);
}
}
</code></pre>
]]></description><link>https://forum.qt.io/post/325650</link><guid isPermaLink="true">https://forum.qt.io/post/325650</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Wed, 04 May 2016 18:33:44 GMT</pubDate></item></channel></rss>