Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: Segfault when retrieving info from QSettings

  1. #21
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Talking

    Thanks for your help with the singleton approach, I will keep that in mind if I have to use it later, but I have located my problem.

    I was referring to my custom settings class which used a pointer to a QSettings object. I fixed this by just explicately defining it in my header file. The reason for the error was that when I was experimenting before I commented the #include settings.h line and that caused the problem.

    Thanks a lot for your help though, sorry for having you go through all that trouble

    Also, one final question - if I define an object in a header file, what is it's parent?
    Last edited by wysota; 21st March 2008 at 08:39. Reason: Posts merged

  2. #22
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Segfault when retrieving info from QSettings

    Quote Originally Posted by codeslicer View Post
    I was referring to my custom settings class which used a pointer to a QSettings object. I fixed this by just explicately defining it in my header file. The reason for the error was that when I was experimenting before I commented the #include settings.h line and that caused the problem.
    If you used a debugger like I told you, you would find it right away.

    Anyway, maybe it's better to change the pattern of embedding the settings object from "hasA" to "isA" (subclass QSettings instead of carrying a pointer to it inside the class)?

    Also, one final question - if I define an object in a header file, what is it's parent?
    The default - 0.

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.