<?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[Accessing a variable from one file , to another file]]></title><description><![CDATA[<p dir="auto">Hi All,</p>
<p dir="auto">I'm stuck at a point.</p>
<p dir="auto">I've a project myProject in which there custom libraries such as A,B,C,D,E.</p>
<p dir="auto">So myProject contains  <strong><a href="http://myProject.pro" target="_blank" rel="noopener noreferrer nofollow ugc">myProject.pro</a></strong> , A,B,C,D,E<br />
then   the structure of A is <a href="http://A.pro" target="_blank" rel="noopener noreferrer nofollow ugc">A.pro</a> , A1,A2,A3  where A1 has files like <a href="http://A1.pro" target="_blank" rel="noopener noreferrer nofollow ugc">A1.pro</a>, <strong>Headers</strong>(A11.h,A12.h,A13.h),<strong>Sources</strong>(A11.cpp,A12.cpp,A13.cpp)</p>
<p dir="auto">Same structure follows for B,C,D,E ....</p>
<p dir="auto">a1 is a member variable[<strong>private</strong>] of class A11 [available in A11.h], how can I access it in file D12.cpp?</p>
]]></description><link>https://forum.qt.io/topic/134575/accessing-a-variable-from-one-file-to-another-file</link><generator>RSS for Node</generator><lastBuildDate>Sun, 13 Sep 2026 04:54:32 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/134575.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Feb 2022 10:04:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Accessing a variable from one file , to another file on Thu, 24 Feb 2022 08:07:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/swati777999">@<bdi>Swati777999</bdi></a> said in <a href="/post/704054">Accessing a variable from one file , to another file</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jksh">@<bdi>JKSH</bdi></a> Yes, I am acquainted with the member functions but how to apply the logic here?</p>
</blockquote>
<p dir="auto">Write member functions that allow other classes to access private member variables.</p>
<p dir="auto">How do you usually use your member functions?</p>
]]></description><link>https://forum.qt.io/post/704055</link><guid isPermaLink="true">https://forum.qt.io/post/704055</guid><dc:creator><![CDATA[JKSH]]></dc:creator><pubDate>Thu, 24 Feb 2022 08:07:12 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing a variable from one file , to another file on Thu, 24 Feb 2022 04:21:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jksh">@<bdi>JKSH</bdi></a> Yes, I am acquainted with the member functions but how to apply the logic here?</p>
]]></description><link>https://forum.qt.io/post/704054</link><guid isPermaLink="true">https://forum.qt.io/post/704054</guid><dc:creator><![CDATA[Swati777999]]></dc:creator><pubDate>Thu, 24 Feb 2022 04:21:22 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing a variable from one file , to another file on Thu, 24 Feb 2022 04:10:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/swati777999">@<bdi>Swati777999</bdi></a> said in <a href="/post/704045">Accessing a variable from one file , to another file</a>:</p>
<blockquote>
<p dir="auto">do you mean I've to follow inheritance?</p>
</blockquote>
<p dir="auto">No, <a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> said <strong>"Add proper accessors to your A11 class"</strong>. This means: add member functions to A11. It does not involve inheritance.</p>
<p dir="auto">Do you know what is a "member function" or a "class method"?</p>
]]></description><link>https://forum.qt.io/post/704052</link><guid isPermaLink="true">https://forum.qt.io/post/704052</guid><dc:creator><![CDATA[JKSH]]></dc:creator><pubDate>Thu, 24 Feb 2022 04:10:20 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing a variable from one file , to another file on Thu, 24 Feb 2022 01:25:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a><br />
and a1 is a private member of A11.<br />
do you mean I've to follow inheritance? Is there any way other than inheritance and friend function?</p>
]]></description><link>https://forum.qt.io/post/704045</link><guid isPermaLink="true">https://forum.qt.io/post/704045</guid><dc:creator><![CDATA[Swati777999]]></dc:creator><pubDate>Thu, 24 Feb 2022 01:25:06 GMT</pubDate></item><item><title><![CDATA[Reply to Accessing a variable from one file , to another file on Wed, 23 Feb 2022 21:10:38 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Add proper accessors to your A11 class</p>
]]></description><link>https://forum.qt.io/post/704029</link><guid isPermaLink="true">https://forum.qt.io/post/704029</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 23 Feb 2022 21:10:38 GMT</pubDate></item></channel></rss>