title: using a class's variable in another class function
body: <p>i have classes like this</p>
  
  <pre><code>class A : public QDialog
  {
  A(QWidget *parent);
  static map&lt;int,QString&gt; dataa;
  };
  
  class B : public QThread
  {
  public void run();
  }
  
  class C : public QDialog
  {
  public void abc();
  }
  </code></pre>
  
  <p><strong>Defination of classes</strong></p>
  
  <pre><code>void B::run()
  {
  in this function,i am using __dataa__ as __dataa.insert__which is defined initially in A class as public.
  }
  
  void C::abc()
  {
  in this function also,i am using __dataa__ as __dataa.find__ and dataa.end__ which is defined initially in A class as public.
  }
  </code></pre>
  
  <p>Now please help me how can i use that variable dataa in the other two classes B and C.somewhere i seen we have to declare it as static and use it in the B and C class as A::data but its not working and giving error.</p>
  
  <p>these three classes are initialized as</p>
  
  <pre><code>int main()
  {
  A window;
  B datathread;
  datathread.start
  //B is Qthread inherited and A,C are QDialog inherited
  }
  </code></pre>
  
  <p>class C is initialized from class A by clicking a pushbutton on it and opening its dialog in a new window.
  i guess this time i wont be blamed for not clearly formulating my question.please on gods name help me as i am stuck over this from long time.a big thanks in advance for any kind of help.</p>