Results 1 to 2 of 2

Thread: Dereferencing a NULL Pointer for staticMetaObject?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Dereferencing a NULL Pointer for staticMetaObject?

    Well... not exactly, staticMetaObject is a static member, so you don't have to dereference anything to access it --- you just have to know the correct type. Before static methods were introduced into C++, that was a way to simulate them and in fact it's an equivalent of:
    Qt Code:
    1. T::staticMetaObject
    To copy to clipboard, switch view to plain text mode 
    I'm not sure why it was written that way, but it might have something to do with some limitations of one of the compilers Qt supports or maybe it allows compiler to do some optimizations.

  2. The following user says thank you to jacek for this useful post:

    jpn (15th December 2006)

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.