<?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 do I pass test &#x2F;any &quot;widget&quot; to QT dialog class ?]]></title><description><![CDATA[<p dir="auto">DeviceDiscoveryDialog  accepts as default null pointer and "shows"  default widget.<br />
How do I change such default ?<br />
( I know it is basic, but I (still) really do not get the QT ui syntax...  )</p>
<p dir="auto">MainWindow::MainWindow()<br />
: mdiArea(new QMdiArea)<br />
{<br />
DeviceDiscoveryDialog *DDD = new DeviceDiscoveryDialog(??????));<br />
DDD-&gt;show();</p>
]]></description><link>https://forum.qt.io/topic/132088/how-do-i-pass-test-any-widget-to-qt-dialog-class</link><generator>RSS for Node</generator><lastBuildDate>Sun, 02 Aug 2026 23:45:16 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/132088.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 Nov 2021 02:55:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How do I pass test &#x2F;any &quot;widget&quot; to QT dialog class ? on Thu, 18 Nov 2021 21:25:23 GMT]]></title><description><![CDATA[<p dir="auto">NEVER  MIND, I was looking at wrong parameter ....<br />
Standby  for solution...<br />
The actual widget is buried in last part of the code and that is what I need to change.</p>
]]></description><link>https://forum.qt.io/post/690752</link><guid isPermaLink="true">https://forum.qt.io/post/690752</guid><dc:creator><![CDATA[Anonymous_Banned275]]></dc:creator><pubDate>Thu, 18 Nov 2021 21:25:23 GMT</pubDate></item><item><title><![CDATA[Reply to How do I pass test &#x2F;any &quot;widget&quot; to QT dialog class ? on Thu, 18 Nov 2021 20:37:46 GMT]]></title><description><![CDATA[<p dir="auto">As usual - I did  not explain well what I need.</p>
<p dir="auto">Here is actual code</p>
<p dir="auto">DeviceDiscoveryDialog *DDD = new DeviceDiscoveryDialog(this);</p>
<p dir="auto">where "this" is a parent of MainWindow</p>
<p dir="auto">and the resulting WRONG test dialog is placed as top dialog</p>
<p dir="auto">However coded this way<br />
DeviceDiscoveryDialog *DDD = new DeviceDiscoveryDialog();</p>
<p dir="auto">I still get  the wrong dialog placed in center of main (parent) window.<br />
'<br />
I am trying to find out from WHERE  it comes from - irregardless who is the parent. .</p>
<p dir="auto">In other words  - what code goes into as DEFAULT parent , from where , and how can I add it as my own parent .</p>
<p dir="auto">There MUST be a real code somewhere - similar to "this" pointer.<br />
How do I code this "default" ?</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/6bbcd6e3-32a5-4dfe-a2a5-3ec4710b280b.png" alt="fcd4fbbd-63c3-41c6-90f9-a97f3a533ce1-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/e46a33e0-34e4-4d6b-858a-52cc385993e5.png" alt="704f6c46-4533-4029-ae09-43dbcdc4f1f6-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">In different  words - I need SAME object with DIFFERENT  parent and NOT same "default".  AND I CANNOT FIGURE OUT THE syntax passing "widget pointer "  if all I have is "form" pointer. .</p>
]]></description><link>https://forum.qt.io/post/690738</link><guid isPermaLink="true">https://forum.qt.io/post/690738</guid><dc:creator><![CDATA[Anonymous_Banned275]]></dc:creator><pubDate>Thu, 18 Nov 2021 20:37:46 GMT</pubDate></item><item><title><![CDATA[Reply to How do I pass test &#x2F;any &quot;widget&quot; to QT dialog class ? on Thu, 18 Nov 2021 09:26:40 GMT]]></title><description><![CDATA[<p dir="auto">@AnneRanch<br />
If your <code>DeviceDiscoveryDialog</code> is intended to be a standalone modeless dialog, <em>not</em> an MDI subwindow in your <code>QMdiArea</code>, then all you want is:</p>
<pre><code>DeviceDiscoveryDialog *DDD = new DeviceDiscoveryDialog(this);
</code></pre>
<p dir="auto">Here <code>this</code> is your <code>MainWindow</code>, so it will be a dialog "owned" by your main window.</p>
<blockquote>
<p dir="auto">and "shows" default widget.</p>
</blockquote>
<p dir="auto">Not sure what you mean by this.  <code>DeviceDiscoveryDialog</code> shows whatever widget(s) you have placed on it.  That might be whatever you put on it in <strong>Designer</strong> if you did it that way.  Or, if you did not use <strong>Designer</strong> for it and just created it in code it will be whatever widget(s) you added to it there.  If you did not put any widgets on it it will just be blank.  If you are asking how to <em>add</em> widgets now at <em>runtime</em>, for whatever reason, you would want something like</p>
<pre><code>QVBoxLayout *layout = new QVBoxLayout;
DDD-&gt;setLayout(layout);
layout-&gt;addWidget(new QLabel);
layout-&gt;addWidget(new QTextEdit);
...
</code></pre>
<p dir="auto">If you actually intend the <code>DeviceDiscoveryDialog</code> to be added as an MDI subwindow on your main window (I'm not sure whether this is the case) you would want something like</p>
<pre><code>QMdiSubWindow *mdiSubWindow = mdiArea-&gt;addSubWindow(DDD);
mdiSubWindow-&gt;show();
</code></pre>
]]></description><link>https://forum.qt.io/post/690624</link><guid isPermaLink="true">https://forum.qt.io/post/690624</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 18 Nov 2021 09:26:40 GMT</pubDate></item></channel></rss>