<?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] Recommended Approach for Inline Modal]]></title><description><![CDATA[<p dir="auto">I'd like to make an inline modal dialog (flat interface style) on top of my centralWidget of my main application window. However, if I do this, I then can't see and work with my other widgets on the page unless I move that thing out of the way all the time in the designer. This dialog needs to show an opaque, dark dimmer, and then show a dialog on top of that with widgets particular my need. In fact, I may have 4-5 of these, each with unusable, separate purposes.</p>
<p dir="auto">I'd rather not draw that entire form in code -- I'd rather do it in the designer.</p>
<p dir="auto">Is there a way that I can draw a separate Qt form, and then programmatically apply that form on top my existing centralWidget of my main application window? I don't mean as a window with its own titlebar and all that -- I mean a window that's inline (sort of like a web page).</p>
<p dir="auto">I was thinking that I could use ui-&gt;centralWidget-&gt;setParent(w) and that w would be the widgets from the other form. I just don't know how to hook that up, or if its even possible.</p>
]]></description><link>https://forum.qt.io/topic/59373/solved-recommended-approach-for-inline-modal</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 08:00:22 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/59373.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 03 Oct 2015 02:44:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Mon, 05 Oct 2015 06:57:43 GMT]]></title><description><![CDATA[<p dir="auto">That is a nice step by step guide.<br />
Thank you for updating post.</p>
]]></description><link>https://forum.qt.io/post/292412</link><guid isPermaLink="true">https://forum.qt.io/post/292412</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Mon, 05 Oct 2015 06:57:43 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Mon, 05 Oct 2015 05:20:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> I tidied this up here:</p>
<p dir="auto"><a href="http://stackoverflow.com/a/32940561/105539" target="_blank" rel="noopener noreferrer nofollow ugc">http://stackoverflow.com/a/32940561/105539</a></p>
]]></description><link>https://forum.qt.io/post/292408</link><guid isPermaLink="true">https://forum.qt.io/post/292408</guid><dc:creator><![CDATA[maximo]]></dc:creator><pubDate>Mon, 05 Oct 2015 05:20:57 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Mon, 05 Oct 2015 02:05:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a>  It doesn't look like there's a programmatic way to do that unless I want to do something messy like intercept the Paint event:</p>
<p dir="auto"><a href="http://stackoverflow.com/questions/32584320/programmatically-promote-qwidget" target="_blank" rel="noopener noreferrer nofollow ugc">http://stackoverflow.com/questions/32584320/programmatically-promote-qwidget</a></p>
<p dir="auto">So, what I'll do is use a QStackedWidget control and put my content inside that. That way, I can put several dialogs there that I can flip in the designer, and then switch that index via code.</p>
]]></description><link>https://forum.qt.io/post/292402</link><guid isPermaLink="true">https://forum.qt.io/post/292402</guid><dc:creator><![CDATA[maximo]]></dc:creator><pubDate>Mon, 05 Oct 2015 02:05:45 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Mon, 05 Oct 2015 01:55:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> It is, exactly. I guess the only thing I want to know now is how to promote via code. That way, I can stick one widget on the Main Window's centralWidget and then just switch the promotions via code.</p>
]]></description><link>https://forum.qt.io/post/292401</link><guid isPermaLink="true">https://forum.qt.io/post/292401</guid><dc:creator><![CDATA[maximo]]></dc:creator><pubDate>Mon, 05 Oct 2015 01:55:43 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Sun, 04 Oct 2015 22:16:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/maximo">@<bdi>maximo</bdi></a><br />
Super :) sorry for the confusion.<br />
I hope its what you wanted.</p>
]]></description><link>https://forum.qt.io/post/292395</link><guid isPermaLink="true">https://forum.qt.io/post/292395</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sun, 04 Oct 2015 22:16:49 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Sun, 04 Oct 2015 22:15:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> Worked! Awesome!</p>
]]></description><link>https://forum.qt.io/post/292394</link><guid isPermaLink="true">https://forum.qt.io/post/292394</guid><dc:creator><![CDATA[maximo]]></dc:creator><pubDate>Sun, 04 Oct 2015 22:15:19 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Sun, 04 Oct 2015 22:10:39 GMT]]></title><description><![CDATA[<p dir="auto">Ok. sorry. I remembered wrong.<br />
Select Type "Widget" in step 1.<br />
Not Dialog.</p>
<p dir="auto">Default name will be Form<br />
so put<br />
Form<br />
and<br />
form.h<br />
in promote dialog,<br />
and "add" and "promote"<br />
Just made small test here to be sure.<br />
<a href="https://www.dropbox.com/s/p69tpbmi9v059b4/maxtest.zip?dl=0" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.dropbox.com/s/p69tpbmi9v059b4/maxtest.zip?dl=0</a></p>
]]></description><link>https://forum.qt.io/post/292391</link><guid isPermaLink="true">https://forum.qt.io/post/292391</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sun, 04 Oct 2015 22:10:39 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Sun, 04 Oct 2015 21:54:13 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
And you have promoted a widget or frame ?<br />
After you added it. You must press Promote.<br />
So you must right click the widget (placeholder) and promote it to Dialog.<br />
Did you do that besides adding it ?</p>
<p dir="auto">And you did add something to the ui file (for Dialog)  ?<br />
(so there is something to show up ?)</p>
<p dir="auto">Update:<br />
Ok it looks like you did it right.</p>
<p dir="auto">So how do you mainscreen look like before you run it ?</p>
]]></description><link>https://forum.qt.io/post/292390</link><guid isPermaLink="true">https://forum.qt.io/post/292390</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sun, 04 Oct 2015 21:54:13 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Sun, 04 Oct 2015 21:49:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> Okay, I added it (called it "Dialog") and this is what that form looks like:</p>
<p dir="auto"><a href="http://screencast.com/t/KVtqWZfCHE" target="_blank" rel="noopener noreferrer nofollow ugc">http://screencast.com/t/KVtqWZfCHE</a></p>
<p dir="auto">However, when I do Build &gt; Run from the menus, I don't see the QWidget with that UI inside it. I don't see the QWidget at all.</p>
<p dir="auto">What do I do next?</p>
]]></description><link>https://forum.qt.io/post/292389</link><guid isPermaLink="true">https://forum.qt.io/post/292389</guid><dc:creator><![CDATA[maximo]]></dc:creator><pubDate>Sun, 04 Oct 2015 21:49:01 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Sun, 04 Oct 2015 21:18:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/maximo">@<bdi>maximo</bdi></a></p>
<ol>
<li>
<p dir="auto">Sorry . didn't write all steps.<br />
Yes its Designer Form Class, then choose Dialog in center.</p>
</li>
<li>
<p dir="auto">The edit controls or what you want to be displayed in the mainform in your inline dialog. buttons and such.</p>
</li>
<li>
<p dir="auto">The mainwindow centralWidget. yes. I assumed you wanted it there.<br />
Yes, "Add widget" is that widget type from the list.<br />
It is just a place holder.  Could also use Frame.</p>
</li>
<li></li>
</ol>
<p dir="auto">in</p>
<h3>Promoted class name,</h3>
<p dir="auto">we must type the name of the dialog class.<br />
Like<br />
MyDialog<br />
or whatever you call it in (1).<br />
Note big/small letters.<br />
Then in</p>
<h3>Headerfile</h3>
<p dir="auto">you must type name of header file.<br />
like<br />
mydialog.h<br />
(this is most likely small letters)</p>
<p dir="auto">Then Press Add button<br />
and now you can press the Promote button.</p>
<p dir="auto">Hope this is better to follow.</p>
]]></description><link>https://forum.qt.io/post/292382</link><guid isPermaLink="true">https://forum.qt.io/post/292382</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sun, 04 Oct 2015 21:18:05 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Sun, 04 Oct 2015 21:06:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a></p>
<ol>
<li>
<p dir="auto">New &gt; QT Designer &gt; Dialog. Doesn't exist. Did you mean Designer Form or Designer Form Class?</p>
</li>
<li>
<p dir="auto">Add stuff to the new dialog.</p>
</li>
<li>
<p dir="auto">Add a widget to the centralWidget. Which centralWidget? The one in the main application window (I assume) ? Also, you say "add a widget". Did you mean just the widget in the toolbox that says "Widget"?</p>
</li>
<li>
<p dir="auto">Rightclick the centralWidget and choose Promote. I did this in the main window. I see a dialog that looks like this:</p>
</li>
</ol>
<p dir="auto"><a href="http://screencast.com/t/9xLRr59xgTzM" target="_blank" rel="noopener noreferrer nofollow ugc">http://screencast.com/t/9xLRr59xgTzM</a></p>
<p dir="auto">I have no clue what to put in those fields.</p>
]]></description><link>https://forum.qt.io/post/292380</link><guid isPermaLink="true">https://forum.qt.io/post/292380</guid><dc:creator><![CDATA[maximo]]></dc:creator><pubDate>Sun, 04 Oct 2015 21:06:19 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Sun, 04 Oct 2015 20:46:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/maximo">@<bdi>maximo</bdi></a><br />
what did not line up?<br />
The dialogs?<br />
Did you inline it or use frameless dialogs?</p>
]]></description><link>https://forum.qt.io/post/292373</link><guid isPermaLink="true">https://forum.qt.io/post/292373</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sun, 04 Oct 2015 20:46:59 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Sun, 04 Oct 2015 20:31:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> I tried to follow your instructions in Qt5.5 Creator but they didn't line up.</p>
]]></description><link>https://forum.qt.io/post/292372</link><guid isPermaLink="true">https://forum.qt.io/post/292372</guid><dc:creator><![CDATA[maximo]]></dc:creator><pubDate>Sun, 04 Oct 2015 20:31:02 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Recommended Approach for Inline Modal on Sat, 03 Oct 2015 07:22:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/maximo">@<bdi>maximo</bdi></a><br />
Hi<br />
Im not 100% sure the exact effect you want<br />
so I will  just suggest some stuff. bare with me :)<br />
the<br />
setWindowFlags (  Qt::FramelessWindowHint );<br />
(in dialogs constructor)<br />
can be used to make the dialog completely without decorations<br />
as borders/caption etc. At run time you can then<br />
just exec() it and it can pop up over central widget.</p>
<p dir="auto">If you really want it truly inline<br />
you could use the promote feature<br />
but it would  not really be a dialog anymore.</p>
<p dir="auto">If you add a new dialog via New-&gt;Qt-&gt;Designer-&gt;Dialog<br />
and add stuff to its UI file in Creator.<br />
Lets call it mydialog</p>
<p dir="auto">Then if you add a widget to the centralWidget. Right click<br />
and select promote and then tell<br />
mydialog.h and press add + promote.<br />
(check spelling as it does not)</p>
<p dir="auto">When you then start the program, the content from mydialog UI would then be in that widget.<br />
But that would be Inside centralWidget, not over it.</p>
]]></description><link>https://forum.qt.io/post/292267</link><guid isPermaLink="true">https://forum.qt.io/post/292267</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sat, 03 Oct 2015 07:22:18 GMT</pubDate></item></channel></rss>