<?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[syntax guidance]]></title><description><![CDATA[<p dir="auto">in the past I declared multiple instances of SysManager inside each part of Qt 4 that called on_button_clicked()... I think that was wrong usage.  Please see example code:</p>
<pre><code>std::vector&lt;std::string&gt; comHubPorts;
size_t portCount = 0;
QString myStr;
QString myStr2;
QString myStr3;
sFnd::SysManager *myMgr;
sFnd::IPort *iPort;
sFnd::INode *theNode;

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Dialog w;
    w.show();
    
    myMgr = sFnd::SysManager::Instance();
    myMgr-&gt;sFnd::SysManager::FindComHubPorts(comHubPorts);
    myStr =  QString::number(comHubPorts.size());
    qInfo() &lt;&lt; "Found:" &lt;&lt; myStr;
    myStr2 = comHubPorts[0].c_str();
    qInfo() &lt;&lt; "Device: " &lt;&lt; myStr2;
    myMgr-&gt;ComHubPort(0, comHubPorts[0].c_str());
    myMgr-&gt;PortsOpen(0);
    iPort = &amp;myMgr-&gt;Ports(0);
    qDebug() &lt;&lt; "NetNumber: " &lt;&lt; QString::number(iPort-&gt;NetNumber());
    qDebug() &lt;&lt; "OpenState: " &lt;&lt; QString::number(iPort-&gt;OpenState());
    qDebug() &lt;&lt; "Node: " &lt;&lt; QString::number(iPort-&gt;NodeCount());

    //myMgr-&gt;PortsClose(); I want to do this in void Dialog::on_pushButton_clicked()

    return a.exec();
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/136646/syntax-guidance</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 15:41:47 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/136646.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 May 2022 19:00:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to syntax guidance on Thu, 19 May 2022 21:36:23 GMT]]></title><description><![CDATA[<p dir="auto">One way you can do it is to sub-class QMainWindow and have an instance of SysManager be a member of your MainWindow class. Then, create slots that call the various SysManager methods. Connect your buttons' clicked signals to these slots.</p>
]]></description><link>https://forum.qt.io/post/714783</link><guid isPermaLink="true">https://forum.qt.io/post/714783</guid><dc:creator><![CDATA[mchinand]]></dc:creator><pubDate>Thu, 19 May 2022 21:36:23 GMT</pubDate></item><item><title><![CDATA[Reply to syntax guidance on Thu, 19 May 2022 21:02:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> said in <a href="/post/714774">syntax guidance</a>:</p>
<blockquote>
<p dir="auto">application</p>
</blockquote>
<p dir="auto">I have only their examples to look at.  I googled encapsulation in c++ and it looks like it is done with Classes in c++ so I will work on understanding that.  There seems to be an Axis class.  I have only one motor = one Axis so maybe I can figure it out.</p>
<p dir="auto">Thanks,<br />
Charles</p>
]]></description><link>https://forum.qt.io/post/714782</link><guid isPermaLink="true">https://forum.qt.io/post/714782</guid><dc:creator><![CDATA[CharlesHuff]]></dc:creator><pubDate>Thu, 19 May 2022 21:02:42 GMT</pubDate></item><item><title><![CDATA[Reply to syntax guidance on Thu, 19 May 2022 19:37:06 GMT]]></title><description><![CDATA[<p dir="auto">Then if it is a C library, you should create a proper object to encapsulate its use through your application.</p>
]]></description><link>https://forum.qt.io/post/714774</link><guid isPermaLink="true">https://forum.qt.io/post/714774</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 19 May 2022 19:37:06 GMT</pubDate></item><item><title><![CDATA[Reply to syntax guidance on Thu, 19 May 2022 19:32:58 GMT]]></title><description><![CDATA[<p dir="auto">it is their hello world!  it opens a com port and assigns a node on the port to a servo motor. <a href="http://www.teknic.com" target="_blank" rel="noopener noreferrer nofollow ugc">www.teknic.com</a> is the address. you have to create an account to get all the manuals.  the code is working and outputting results that I can see in qDebug() comments.  I don't want to only use the code from main() function but also from buttons, ect....</p>
]]></description><link>https://forum.qt.io/post/714773</link><guid isPermaLink="true">https://forum.qt.io/post/714773</guid><dc:creator><![CDATA[CharlesHuff]]></dc:creator><pubDate>Thu, 19 May 2022 19:32:58 GMT</pubDate></item><item><title><![CDATA[Reply to syntax guidance on Thu, 19 May 2022 19:26:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/charleshuff">@<bdi>CharlesHuff</bdi></a> said in <a href="/post/714769">syntax guidance</a>:</p>
<blockquote>
<p dir="auto"><a href="http://sFoundation20.so" target="_blank" rel="noopener noreferrer nofollow ugc">sFoundation20.so</a></p>
</blockquote>
<p dir="auto">Where does that library come from ?</p>
<p dir="auto">From the looks of it, you need to take a step back and rethink your application design. What should it do ?</p>
]]></description><link>https://forum.qt.io/post/714772</link><guid isPermaLink="true">https://forum.qt.io/post/714772</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 19 May 2022 19:26:01 GMT</pubDate></item><item><title><![CDATA[Reply to syntax guidance on Thu, 19 May 2022 19:20:34 GMT]]></title><description><![CDATA[<p dir="auto">do you mean the code before main()? It's my ignorant attempt to make SysManager *myMgr variables "Public"  or at least usable outside of the main() function.  SysManager is from <a href="http://sFoundation20.so" target="_blank" rel="noopener noreferrer nofollow ugc">sFoundation20.so</a> library.  Their examples do not seem to be for c++ and I am struggling to discover how to use the library with Qt 6 creator...</p>
<p dir="auto">Thanks,</p>
]]></description><link>https://forum.qt.io/post/714769</link><guid isPermaLink="true">https://forum.qt.io/post/714769</guid><dc:creator><![CDATA[CharlesHuff]]></dc:creator><pubDate>Thu, 19 May 2022 19:20:34 GMT</pubDate></item><item><title><![CDATA[Reply to syntax guidance on Thu, 19 May 2022 19:12:30 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">You SysManager seem to be a singleton so why declare all these static variables ?</p>
]]></description><link>https://forum.qt.io/post/714765</link><guid isPermaLink="true">https://forum.qt.io/post/714765</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 19 May 2022 19:12:30 GMT</pubDate></item></channel></rss>