Results 1 to 4 of 4

Thread: Function call from a NULL this object ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2010
    Posts
    63
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    26
    Thanked 1 Time in 1 Post

    Default Re: Function call from a NULL this object ?

    Quote Originally Posted by SixDegrees View Post
    Since the problem is in a Qt metacall, I'd guess your project isn't being built correctly. Make sure your headers and source files are listed in your project file, that you don't have any implementation in your headers, and that you've done a 'make clean' and a complete rebuild on your project.
    Thank you for the reply.

    Actually, I cut the complete function call chain for the screenshot to match the watch list size. It doesn't start where it seems to in the screenshot.

    I did a make clean, but I still get the problem.

    There are both headers and source files in the project for all classes that have both. Only one class has implementations in the header file because it is a template class and I had problems keeping the implemenations in the source file and I believe someone in this forum told me I had to keep them directly in the header, so I did that and it worked.

    Quote Originally Posted by Zlatomir View Post
    But if you do this "trick" it is a sign that some member function should be declared static or not member at all.
    Thank you very much for the info. But I don't understand what you mean by this statement.

    Quote Originally Posted by Zlatomir View Post
    And for your actual problem see what data your function access and how is your function called with null pointer the problem is most likely at that end.
    Okay, so I guess it's a "regular" problem after all.
    Actually I have a strong suspicion now where the error may be. I made some minor changes to that part since it last worked correctly and haven't adjusted everything. Except that now I don't understand why it worked previously. :-D
    Anyway, that's a much more sympathetic problem. :-)

    Thanks again !

    EDIT: When I wrote the response to SixDegrees I didn't have an idea yet where the problem might be, so the response reads as if the problem was still completely unclear and I listed all the things I could rule out as causes.
    Last edited by Computer Hater; 24th September 2011 at 16:18.
    Hint: Think carefully before picking a user name.

Similar Threads

  1. cannot call member function without object
    By been_1990 in forum Qt Programming
    Replies: 11
    Last Post: 23rd October 2010, 17:12
  2. Check if a object is null and destroy objects
    By ruben.rodrigues in forum Newbie
    Replies: 3
    Last Post: 2nd July 2010, 10:25
  3. Replies: 2
    Last Post: 7th July 2009, 17:44
  4. Cannot call function without object
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 11th June 2007, 14:55
  5. Replies: 3
    Last Post: 16th May 2007, 11:07

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.