Results 1 to 7 of 7

Thread: changing values for one class and showing it ..!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Finland /Pakistan
    Posts
    216
    Thanks
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default changing values for one class and showing it ..!

    hi all,

    this is a pure c++ class , i am not good with pointers and it seems somehow pointers should be used,...pls see the problem below..

    i have three classes named super ,child1 and child2..

    Qt Code:
    1. #include "child1.h"
    2. #include "child2.h"
    3.  
    4. class super
    5. {
    6. private:
    7. int record_clicks;
    8. ..
    9. child1 *myChild1;
    10. child2 *myChild2;
    11. ..
    12. };
    13. class child1
    14. {
    15. ..
    16. private:
    17. int record_clicks;
    18. ..
    19. }
    20. class child2
    21. {
    22. ..
    23. private:
    24. int record_clicks;
    25. ..
    26. }
    To copy to clipboard, switch view to plain text mode 
    the problem i am facing is that that when i change the value in child1->recordClick i wanted to see the changed value in child2->recordClick, i make a function for that which passes the value of recordClick to TrainingUI which then passes this value to child2,but now if i wanted to change the value in child2->recordClick and show it on child1->recordClick ...how can i do that i mean how to change recordClicks value in both direction..i hope u undertsand
    Last edited by wysota; 14th August 2008 at 14:21. Reason: missing [code] tags

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.