Results 1 to 3 of 3

Thread: To Share a variable among classes

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default To Share a variable among classes

    Qt Code:
    1. //A.h
    2. class A
    3. {
    4. public:
    5. int quantity[8];
    6. int m;
    7.  
    8. }
    9.  
    10. //B.h
    11. class B
    12. {
    13. public:
    14. void getquantity ();
    15.  
    16.  
    17. }
    18.  
    19. //B.cpp
    20.  
    21. void B::getquantity()
    22. {
    23. //how can I get access to quantity or any variables from A? when I try A::m- I get errors
    24. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by high_flyer; 12th May 2011 at 11:09. Reason: code tags

Similar Threads

  1. Log in to a network share
    By Thomas_Lerman in forum Qt Programming
    Replies: 0
    Last Post: 28th April 2011, 15:47
  2. how to share variables
    By sksingh73 in forum Newbie
    Replies: 4
    Last Post: 2nd July 2010, 04:54
  3. Share a variable between forms
    By sepehr in forum Qt Programming
    Replies: 4
    Last Post: 29th January 2009, 07:05
  4. cannot share the database connection!!!!
    By cbarmpar in forum Qt Programming
    Replies: 13
    Last Post: 23rd September 2008, 14:42

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.