Results 1 to 3 of 3

Thread: Segmentation Fault?!

  1. #1
    Join Date
    Jul 2007
    Posts
    2

    Unhappy Segmentation Fault?!

    Hey there!

    I am in the process of learning Qt4... so i have a simple main window and a dialog... since i only want this dialog object to be created if it hasn't already been... i've coded it's calling slot like this:

    Qt Code:
    1. void MainWindowImpl::newLocalBackup(){
    2. if(!nLocalBackup){
    3. nLocalBackup = new NewLocalBackup;
    4. }
    5. nLocalBackup->show();
    6. }
    To copy to clipboard, switch view to plain text mode 

    however every time i click the button the program exits giving me a segmentation fault...

    what am i doing wrong? how can i debug this type of error? gosh i'm feeling like a noob =x

    thanks in advance for your help *
    Last edited by jpn; 11th April 2008 at 15:17. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: Segmentation Fault?!

    You probably forgot to initialize nLocalBackup to 0 in the constructor.

  3. #3
    Join Date
    Jul 2007
    Posts
    2

    Default Re: Segmentation Fault?!

    yup i did...
    i'm sutch a dumb
    thanks man!

    cheers!
    *

Similar Threads

  1. Replies: 3
    Last Post: 11th October 2007, 23:47
  2. Process aborted. Segmentation fault
    By Pragya in forum Qt Programming
    Replies: 3
    Last Post: 30th May 2007, 08:12
  3. Segmentation fault running any QT4 executables
    By jellis in forum Installation and Deployment
    Replies: 7
    Last Post: 19th May 2007, 16:35
  4. why does qt program meet segmentation fault?
    By wquanw in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 15th May 2006, 16:52
  5. Icons missing => segmentation fault
    By antonio.r.tome in forum Qt Programming
    Replies: 4
    Last Post: 8th March 2006, 16:30

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.