Qt Code:
  1. #include "apple.h"
  2. class Basket
  3. {
  4. ...
  5. int number_of_apples;
  6. Apple instantiatedApple;
  7. }
To copy to clipboard, switch view to plain text mode 

Sorry about asking this general object-oriented question, but I could not find relevant pages with google.

The question is simple, but I cannot figure out the answer...

How to send information between two classes where one class is instantiated inside the other?

Example:

Qt Code:
  1. class Apple
  2. {
  3. void Apple::methodinsideapple()
  4. {
  5. (how would you get current number_of_apples in basket???????)
  6. }
  7. }
To copy to clipboard, switch view to plain text mode 

I have lots of QDomDocuments combined, and want to build a chart of them. I use a QWizard to ask for details for a specific chart from the user. QWizard is in a separate class as it can only be created like that. How can I pass the dynamic info based on user interaction back and forth between mainwindow class and QWizard class.

The only workaround that comes to my mind is to pass all the documents to the wizard class right at the beginning in its constructor, but then all the methods to filter info from the documents should be copied inside this class, too...

Pls, help! Thx!