Results 1 to 5 of 5

Thread: Checking if bad pointer?

  1. #1
    Join Date
    May 2007
    Posts
    301
    Thanks
    46
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Checking if bad pointer?

    Hi,

    Is it possible to check for a bad ptr, I don't just mean checking if it is NULL?

    Regards,
    Steve

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Checking if bad pointer?

    Of course there isn't.
    If there be such a way, it would make things easier for everybody, right?

    You could read a bit about QPointer.

    Regards

  3. #3
    Join Date
    May 2007
    Posts
    301
    Thanks
    46
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Checking if bad pointer?

    So nothing like if AfxIsValid or AfxIsValidAddress then?

    Reason I am asking is for some reason, my dropMimeData function in my model is getting called when I double click on the table view that is using the model.

    Regards,
    Steve

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Checking if bad pointer?

    Then why don't you use AfxIsValidAddress?
    There is also a solution for Mac: http://lists.apple.com/archives/Darw.../msg00326.html.
    Not sure on Linux, but there has to be.

    Anyway, you could split this code in three platform dependent parts ( Win, Linux, Mac ). But this is only if you need your app running on other platforms.

    Regards

  5. #5
    Join Date
    May 2007
    Posts
    301
    Thanks
    46
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Checking if bad pointer?

    Thanks for the link
    Regards,
    Steve

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.