Results 1 to 5 of 5

Thread: Icons missing => segmentation fault

  1. #1
    Join Date
    Feb 2006
    Location
    Portugal
    Posts
    24
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Icons missing => segmentation fault

    Hi,

    after figthing almost a day with a piece of code I made that have already runned fine, but was now giving segmentation fault, I find out that some icons I used were erased (I erased them in a cleanup process). The missing icons (for example in the pushup buttons) lead to a segmentation fault.

    Anyone knows how to prevent a segmentation fault when the icons are missing?

    I'm using QT4.1 in Open suse

    my best regards

    António Tomé

  2. #2
    Join Date
    Mar 2006
    Posts
    22
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: Icons missing => segmentation fault

    Check all your pointers for NULL.

  3. #3
    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: Icons missing => segmentation fault

    Maybe you have encountered this bug: http://www.trolltech.com/developer/t...ntry&id=100119 ?

  4. #4
    Join Date
    Feb 2006
    Location
    Portugal
    Posts
    24
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Icons missing => segmentation fault

    Quote Originally Posted by jacek
    Maybe you have encountered this bug: http://www.trolltech.com/developer/t...ntry&id=100119 ?
    I really don't know! but every mention to a icon that does not exists makes the proagram crash.
    For example the line

    quit_confirm_ok->setIcon(QIcon(QString::fromUtf8("tasto_7_architet to_franc_01.png")));

    created directly with designer makes a segmentation fault if I erase tasto_7_architetto_franc_01.png

    A good behavior would be the program ignoring the icon and using only the the text label when the former is not there.


    Is it possible to "scramble" the icon inside the Qt code? to avoid this error?


    António Tomé
    Last edited by antonio.r.tome; 8th March 2006 at 17:18.

  5. #5
    Join Date
    Jan 2006
    Location
    N.B. Canada
    Posts
    47
    Thanked 8 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Icons missing => segmentation fault

    I am not sure what do you mean by "scramble" the icon into Qt Code, but there is The Qt Resource System, which may be of some use.

    Bojan
    The march of progress:
    C:
    printf("%10.2f", x);
    C++:
    cout << setw(10) << setprecision(2) << showpoint << x;
    Java:
    java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
    formatter.setMinimumFractionDigits(2);
    formatter.setMaximumFractionDigits(2);
    String s = formatter.format(x);
    for (int i = s.length(); i < 10; i++) System.out.print(' ');
    System.out.print(s);

Similar Threads

  1. Segmentation fault running any QT4 executables
    By jellis in forum Installation and Deployment
    Replies: 7
    Last Post: 19th May 2007, 17:35

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.