<?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[QFileDialog::getOpenFileContent opens no window]]></title><description><![CDATA[<p dir="auto">As per <a href="https://doc.qt.io/qt-6/qfiledialog.html#getOpenFileContent" target="_blank" rel="noopener noreferrer nofollow ugc">documentation</a>, I was trying to allow users to select a file with <code>QFileDialog::getOpenFileContent</code> from the browser.<br />
Nothing shows when I do, be it on FireFox or Chrome, but I do get the dialog when I compile for Desktop.</p>
<p dir="auto">To make sure I wasn't the cause of that issue, I tried again on a fresh QML project created from QtCreator (full code at the bottom).<br />
I am having the problem for single and multi-threaded WASM builds.</p>
<p dir="auto">I have found <a href="https://qt-project.atlassian.net/browse/QTBUG-115087" target="_blank" rel="noopener noreferrer nofollow ugc">this corrected bug</a> possibly related to my issue, however:</p>
<ul>
<li>I am on Qt 6.11.1 (emsdk 4.0.7); I have also tried on Qt6.7.3 (emsdk 3.1.50) with the same result.<br />
Both versions are supposed to be free of that bug.</li>
<li>The working snippet provided by the reporter (setting <code>nameFilter</code> to <code>"*"</code>) does not work.</li>
</ul>
<p dir="auto">Is anyone reproducing this issue / able to get the dialog with the code below?<br />
Or would you know what I am doing wrong perhaps?</p>
<pre><code>#include &lt;QtWidgets/QApplication&gt;
#include &lt;QQmlApplicationEngine&gt;

#include &lt;QtWidgets/QFileDialog&gt;

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    auto fileContentReady = [](const QString &amp;fileName, const QByteArray &amp;fileContent) {
        if (fileName.isEmpty()) {
            // No file was selected
            qDebug() &lt;&lt; fileName;
        } else {
            // Use fileName and fileContent
            qDebug() &lt;&lt; fileName;
        }
        QFileInfo fi(fileName);
        qDebug() &lt;&lt; "path: " &lt;&lt; fi.path();

    };
    QFileDialog::getOpenFileContent("*",  fileContentReady);

    QQmlApplicationEngine engine;
    QObject::connect(
        &amp;engine,
        &amp;QQmlApplicationEngine::objectCreationFailed,
        &amp;app,
        []() { QCoreApplication::exit(-1); },
        Qt::QueuedConnection);
    engine.loadFromModule("wasm", "Main");

    return QCoreApplication::exec();
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/165006/qfiledialog-getopenfilecontent-opens-no-window</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 02:27:21 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/165006.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Aug 2026 11:54:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QFileDialog::getOpenFileContent opens no window on Thu, 13 Aug 2026 20:47:03 GMT]]></title><description><![CDATA[<p dir="auto">What you say is true, it's an oversight.<br />
That does not solve the issue I am having though: the dialog opens when compiled to desktop, not when compiled to WASM.</p>
]]></description><link>https://forum.qt.io/post/839706</link><guid isPermaLink="true">https://forum.qt.io/post/839706</guid><dc:creator><![CDATA[FX David]]></dc:creator><pubDate>Thu, 13 Aug 2026 20:47:03 GMT</pubDate></item><item><title><![CDATA[Reply to QFileDialog::getOpenFileContent opens no window on Thu, 13 Aug 2026 19:15:48 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Why are you calling <code>return QCoreApplication::exec()</code> rather than <code>return app.exec();</code> ?<br />
While the method is static, it's from two different classes and they don't do exactly the same thing.</p>
]]></description><link>https://forum.qt.io/post/839703</link><guid isPermaLink="true">https://forum.qt.io/post/839703</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 13 Aug 2026 19:15:48 GMT</pubDate></item></channel></rss>