Results 1 to 9 of 9

Thread: Error accessing pointer to class member in main

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Oct 2011
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: Error accessing pointer to class member in main

    Quote Originally Posted by Zlatomir View Post
    Just

    And don't forget to take and pass a parent to the QMainWindow's constructor. //just to avoid future problems like memory leak/object slicing.
    How does that work? QMainWidget can take a QWidget as a parent, but QApplication is not derived from QWidget. Is it necessary to create an intermediate widget in main to pass as a parent?

    Also, there is still a problem. I'm getting:

    error: no matching function for call to ‘QObject::connect(QPushButton*&, const char [11], QApplication*, const char [8])

    The first argument, QPushButton*&, looks like a problem with mainWindow.quit.
    Last edited by starkid; 15th October 2011 at 17:37. Reason: tried coding suggestion

Similar Threads

  1. Pointer to non static member functions within the class
    By Lykurg in forum General Programming
    Replies: 3
    Last Post: 24th April 2011, 07:37
  2. accessing static member variables of one class in another class
    By jasonknight in forum General Programming
    Replies: 5
    Last Post: 6th September 2010, 14:53
  3. Replies: 2
    Last Post: 29th June 2009, 06:09
  4. Replies: 3
    Last Post: 19th February 2008, 13:10
  5. Accessing a class Object by pointer in another class
    By pdoria in forum Qt Programming
    Replies: 2
    Last Post: 14th January 2008, 15:59

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.