Advertisement
zKarp

CallFunctionInHigherClass

Apr 29th, 2012
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ...
  2. #import "class2.h"
  3. class Class1 {
  4.  
  5. public:
  6.     void read(){ //for each person...
  7.         Class2* person = new Class2(foo.item(i));
  8.             m_peopleList.push_back(person);}
  9.     static void increaseTotalPeople(){++m_totalppl;}
  10.     static int m_totalppl; //Cumm. total of the people
  11.    
  12. private:
  13.     vector<Class2*> m_peopleList;
  14.  
  15. -----------------------------------------------
  16. //Class 2 In a seperate file
  17. class Class2 {
  18.  
  19. public:
  20.     Class2(QTDomNode *node)
  21.     { ...
  22.        
  23.         Class1::increaseTotalPeople();
  24.     }
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement