Results 1 to 18 of 18

Thread: segmentation fault on classes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: segmentation fault on classes

    Try it with additional parentheses:

    Qt Code:
    1. stemp = qobject_cast<ScreenHead*>(slidingStacked->currentWidget());
    2. if (stemp)
    3. {
    4. mtemp = qobject_cast<menu_screen*>(stemp->pSliding->currentWidget());
    5. if (!mtemp) qDebug() << "mtemp casting failed";
    6. } else qDebug() << "stemp casting failed";
    To copy to clipboard, switch view to plain text mode 

    Aah: Too slow :->

    Joh

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

    liran ritkop (6th April 2011)

Similar Threads

  1. Segmentation Fault
    By Ryan Riffle in forum Qt Programming
    Replies: 4
    Last Post: 16th January 2011, 20:52
  2. QWT - Segmentation Fault
    By Wojtek.wk in forum Newbie
    Replies: 0
    Last Post: 17th April 2010, 14:29
  3. segmentation fault
    By navid in forum Qt Programming
    Replies: 3
    Last Post: 20th December 2009, 11:40
  4. segmentation fault
    By mattia in forum Newbie
    Replies: 22
    Last Post: 7th November 2007, 10:37
  5. segmentation fault
    By shamik in forum Qt Programming
    Replies: 3
    Last Post: 24th November 2006, 07:33

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.