<?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[[SOLVED] Using &quot;open&quot; methods in QPrintDialog and QFileDialog]]></title><description><![CDATA[<p dir="auto">I'm confused about the syntax here.  The documentation implies that the call to open makes the connection between the accepted() signal and the arguments to open.  So I have</p>
<p dir="auto">@void SeismicCanvasWindow::showPrintDialog(){<br />
QPrintDialog printDialog(thePrinter, this);<br />
printDialog.setWindowModality(Qt::WindowModal);<br />
printDialog.open(seismicCanvas, SLOT(printCanvas(QPrinter*)));<br />
}<br />
@</p>
<p dir="auto">With the corresponding slot:</p>
<p dir="auto">@<br />
void SeismicCanvas::printCanvas(QPrinter *printer){<br />
int resolution, i;<br />
QList&lt;int&gt; resolutions;</p>
<pre><code>resolution = printer-&gt;resolution();
resolutions = printer-&gt;supportedResolutions();
for(i=0; i&lt; resolutions.size(); i++)
    if(resolutions[i] &gt; resolution) resolution = resolutions[i];

printer-&gt;setResolution(resolution);

cerr &lt;&lt;"Printer resolution is set to:" &lt;&lt; resolution &lt;&lt;"dpi\n";
</code></pre>
<p dir="auto">}<br />
@</p>
<p dir="auto">This crashes every time the print dialog is closed, with either ok or cancel buttons. Clearly I am doing something wrong, but I get no error that the signal and slot aren't connected.</p>
<p dir="auto">Any suggestions for my error?</p>
<p dir="auto">Thanks Glenn</p>
]]></description><link>https://forum.qt.io/topic/21029/solved-using-open-methods-in-qprintdialog-and-qfiledialog</link><generator>RSS for Node</generator><lastBuildDate>Mon, 17 Aug 2026 19:40:17 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/21029.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Nov 2012 01:59:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED] Using &quot;open&quot; methods in QPrintDialog and QFileDialog on Fri, 30 Nov 2012 15:19:43 GMT]]></title><description><![CDATA[<p dir="auto">Qt 4.8.4 has fixed the bug that was causing this problem.</p>
]]></description><link>https://forum.qt.io/post/158370</link><guid isPermaLink="true">https://forum.qt.io/post/158370</guid><dc:creator><![CDATA[gkroeger]]></dc:creator><pubDate>Fri, 30 Nov 2012 15:19:43 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Using &quot;open&quot; methods in QPrintDialog and QFileDialog on Fri, 09 Nov 2012 07:13:13 GMT]]></title><description><![CDATA[<p dir="auto">Bump... anyone?</p>
]]></description><link>https://forum.qt.io/post/156432</link><guid isPermaLink="true">https://forum.qt.io/post/156432</guid><dc:creator><![CDATA[gkroeger]]></dc:creator><pubDate>Fri, 09 Nov 2012 07:13:13 GMT</pubDate></item></channel></rss>