Results 1 to 4 of 4

Thread: how to access the Member Variable of MainWindow from another class?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Posts
    28
    Qt products
    Qt4
    Platforms
    Windows

    Question how to access the Member Variable of MainWindow from another class?

    Hi Friends,

    i am facing the following problem...

    how i can access the variable which is declared in the mainwindow class from some other class?


    code snippet:

    Qt Code:
    1. class MainWindow : public QMainWindow
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. MainWindow(QWidget *parent = 0);
    7. ~MainWindow();
    8. public:
    9. QList<int> cno_airfoilgeom;
    10. QList<int> sno_airfoilgeom;
    11.  
    12. };
    13.  
    14. class AirfoilGeomTab : public QWidget
    15. {
    16. Q_OBJECT
    17.  
    18. public:
    19. AirfoilGeomTab(QWidget *parent = 0);
    20.  
    21. };
    22.  
    23. i wanted to use the "cno_airfoilgeom" variable in the "AirfoilGeomTab" constructor...
    24.  
    25. AirfoilGeomTab::AirfoilGeomTab(QWidget *parent)
    26. : QWidget(parent)
    27. {
    28.  
    29. // i wanted to use the "cno_airfoilgeom" variable here
    30.  
    31. }
    To copy to clipboard, switch view to plain text mode 
    can anyone please help me...?

    Thanks in Advance,
    mammaiap
    Last edited by high_flyer; 12th April 2011 at 12:46. Reason: code tags

Similar Threads

  1. Replies: 4
    Last Post: 17th January 2011, 14:05
  2. Replies: 4
    Last Post: 29th May 2010, 12:56
  3. Replies: 22
    Last Post: 8th October 2008, 13:54
  4. Replies: 5
    Last Post: 14th July 2006, 22:42
  5. Std iterator as private member variable
    By Michiel in forum General Programming
    Replies: 5
    Last Post: 21st April 2006, 15:27

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.