<?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[Problem with QFileDialog and QFileDialog::DontUseNativeDialog]]></title><description><![CDATA[<p dir="auto">Error with the preview of image files, they are not shown. If I use it natively, the preview is shown. Any solution?<br />
Here is my code</p>
<pre><code>QFileDialog dialog(padre, "Load Icon", nombreFile, "Image files (*.png *.jpg *.bmp *.gif)");
dialog.setFileMode(QFileDialog::ExistingFile);
dialog.setViewMode(QFileDialog::List);
dialog.setOptions(QFileDialog::DontUseNativeDialog);
dialog.setGeometry(padre-&gt;geometry());
QString nombreFile1;
if (dialog.exec()==QDialog::Accepted)
	nombreFile1 = dialog.selectedFiles().first();
rect=dialog.geometry();
if (nombreFile1.isEmpty())
	nombreFile=dialog.directory().absolutePath();
else
{
	nombreFile=nombreFile1;
	QPixmap pixmap(nombreFile);
	if (pixmap.isNull())
		error(MainWindow::tr("File fault"));
	else
	{
		pixmap=pixmap.scaled(100, 100, Qt::KeepAspectRatio, Qt::SmoothTransformation);
		pixmap.save(sss);
		rt=true;
	}
}
</code></pre>
<p dir="auto">And this is how it looks with DontUseNativeDialog</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/4d530ccd-0919-4f20-a04a-3e6aaa2e94ed.png" alt="573cae99-261d-4a48-b48c-fa6ba2d79ed1-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">And now with native<br />
<img src="https://ddgobkiprc33d.cloudfront.net/0f24e2aa-544e-42a0-9d9b-467c4632d533.png" alt="8d1a1715-2ec2-4ab8-80b5-37a653cfb53c-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/141974/problem-with-qfiledialog-and-qfiledialog-dontusenativedialog</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 18:23:33 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/141974.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 05 Jan 2023 13:17:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem with QFileDialog and QFileDialog::DontUseNativeDialog on Tue, 10 Jan 2023 16:57:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonexelectronic">@<bdi>JonexElectronic</bdi></a><br />
If (a) the non-native (i.e. Qt) dialog does not offer preview and (b) the native one either also does not or for some reason you cannot use it, then you would have no choice but to write your own which did offer this "preview" facility.</p>
]]></description><link>https://forum.qt.io/post/743305</link><guid isPermaLink="true">https://forum.qt.io/post/743305</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 10 Jan 2023 16:57:29 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with QFileDialog and QFileDialog::DontUseNativeDialog on Tue, 10 Jan 2023 16:34:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> So, what should I use? Is there something I can use then that allows me to preview?</p>
]]></description><link>https://forum.qt.io/post/743297</link><guid isPermaLink="true">https://forum.qt.io/post/743297</guid><dc:creator><![CDATA[JonexElectronic]]></dc:creator><pubDate>Tue, 10 Jan 2023 16:34:16 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with QFileDialog and QFileDialog::DontUseNativeDialog on Thu, 05 Jan 2023 15:43:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonexelectronic">@<bdi>JonexElectronic</bdi></a> said in <a href="/post/742648">Problem with QFileDialog and QFileDialog::DontUseNativeDialog</a>:</p>
<blockquote>
<p dir="auto">Error with the preview of image files, they are not shown. If I use it natively, the preview is shown. Any solution?</p>
</blockquote>
<blockquote>
<p dir="auto">dialog.setViewMode(QFileDialog::List);</p>
</blockquote>
<p dir="auto">What do you expect when you set <a href="https://doc.qt.io/qt-6/qfiledialog.html#ViewMode-enum" target="_blank" rel="noopener noreferrer nofollow ugc">QFileDialog::List</a>? The Qt filedialog does not support previews.</p>
]]></description><link>https://forum.qt.io/post/742662</link><guid isPermaLink="true">https://forum.qt.io/post/742662</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Thu, 05 Jan 2023 15:43:00 GMT</pubDate></item></channel></rss>