Results 1 to 3 of 3

Thread: QSpaceritem problem with crashing

  1. #1
    Join Date
    Aug 2006
    Posts
    83

    Default QSpaceritem problem with crashing

    Hello

    I have a problem with a qspaceritem object. The problem is that if I have a QSpacerItem *object inserted into a qgridlayout and I try to close the application it crashes .
    I put the qspaceritem inside the layout like this:

    Qt Code:
    1. QGridLayout *layout = new QGridLayout();
    2. QSpacerItem *spacer = new QSpacerItem(5,2);
    3. layout ->addItem(spacer,0,0);
    4. layout ->addWidget(widget,0,1,1,1);
    To copy to clipboard, switch view to plain text mode 

    this is the result
    I get a message informing of a first-chance exception.... and the parameter of the code that seems to be the problem:

    Qt Code:
    1. ~QGridBox() { delete item_; }
    To copy to clipboard, switch view to plain text mode 

    Do you have any idea how to fix this??

  2. #2
    Join Date
    Aug 2006
    Posts
    83

    Default Re: QSpaceritem problem with crashing

    I think I've found the answer. Instead of using qspaceritem I'm using dummy widgets and it works perfectly.

  3. #3
    Join Date
    Feb 2006
    Location
    Boulder, Colorado, USA
    Posts
    63
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSpaceritem problem with crashing

    What is item_ ? If it is derived from QObject then qt will delete it when its parent is deleted and that might be the source of your problem

Similar Threads

  1. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  2. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  3. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  4. Replies: 16
    Last Post: 7th March 2006, 15:57

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.