HI

I'm trying to creat an Object that will contains some data and that will be avaliable to multiple Widgets. Also, if one Widget changes some data in the Object, next time some other Widget reads the data from Object, it will have the new chaged data.

For example.

Lets say we have
Qt Code:
  1. QWidget widgetA
  2. QWidget widgetB
  3. // more QWidgets are in my program, but for example purpose, we will use two widgets
  4. // Both widgets are sepereate dialogs, widgets, mainWindows and have theier own classes and *.h and *.cpp files
  5.  
  6. // And some QObject that also has its own class and and *.h and *.cpp file
  7. QObject sharedData
  8. // And in the sharedData, lets say we have some public items (declared in the header file):
  9. QString string
  10. QString stringTwo
  11. int number
To copy to clipboard, switch view to plain text mode 

What I wnat to do, is when widgetA changes some part of the sharedData Object,
Qt Code:
  1. // in the widgetA, some sharedData items are chaged like
  2. sharedData->string = "apple";
  3. sharedData->num = 10;
To copy to clipboard, switch view to plain text mode 

I need to be able that widgetB would read the changes made by widgetA
Qt Code:
  1. // lets say
  2. qDebug()<<sharedData->string;
  3. //will return "apple" and not an emtpy string
To copy to clipboard, switch view to plain text mode 


My question is how do i set up my object and how do I implament this object withing widgets. I know, I have to use pointers, but I have problem in initial setup.

Thanks to all. Hope to here from some one.