<?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[How to make QInputDialog box modal less?]]></title><description><![CDATA[<p dir="auto">i am using multiple QInput Dialog boxes in my UI, using the syntax like</p>
<pre><code>QString s = QInputDialog::getText(this,"Sleep Command ","Enter the number of seconds" );

</code></pre>
<p dir="auto">but when ever these Input dialog boxes pops up, the mainwindow becomes unresponsive, so how do i make all the QInputDialog boxes "modal less " and the mainwindow always stays responsive ??</p>
]]></description><link>https://forum.qt.io/topic/115833/how-to-make-qinputdialog-box-modal-less</link><generator>RSS for Node</generator><lastBuildDate>Mon, 10 Aug 2026 04:18:28 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/115833.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 13 Jun 2020 05:19:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to make QInputDialog box modal less? on Sat, 13 Jun 2020 07:05:44 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
When you call QInputDialog::<br />
you are calling a static function that shows the dialog for you.</p>
<p dir="auto">If you want to use them non modal, then you must create and show the dialog your self and handle reading the data.</p>
<p dir="auto"><a href="https://forum.qt.io/topic/14761/non-blocking-dialogbox-nonmodal-required-for-statusmessages">https://forum.qt.io/topic/14761/non-blocking-dialogbox-nonmodal-required-for-statusmessages</a></p>
<p dir="auto">Hmm that was quite old link :)</p>
<p dir="auto">In a newer world, lambdas make this more compact.</p>
<pre><code>QInputDialog *d = new QInputDialog;

    connect( d, &amp;QDialog::accepted, this, [d]() {
        auto text = d-&gt;textValue();  // get text        
        d-&gt;deleteLater();// clean up
    });

    d-&gt;show(); 

note: we are only handling accepted so if cancel or esc is used then we leak!
You might be able to use d-&gt;setAttribute(Qt::WA_DeleteOnClose);
Or simply keep one instance around for full life time of app and simply hide or show as needed.

</code></pre>
<p dir="auto">But you change your app's logic a bit as you won't get the text now in place as it no longer blocks the main thread and<br />
will continue to execute while showing the dialog.<br />
So the text from dialog will come at later point in time than your current code.<br />
Just so you are aware of it.</p>
]]></description><link>https://forum.qt.io/post/600530</link><guid isPermaLink="true">https://forum.qt.io/post/600530</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sat, 13 Jun 2020 07:05:44 GMT</pubDate></item></channel></rss>