Results 1 to 3 of 3

Thread: Qt4/Mac: funny problem with QGraphicsItems

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt4/Mac: funny problem with QGraphicsItems

    Qt Code:
    1. Obstacle *obstacles_A[]
    To copy to clipboard, switch view to plain text mode 
    This is incorrect - it doesn't carry the dimensions of the array and you probably trash your stack or something like that.

    You should definitely use a vector or a list:
    Qt Code:
    1. QList<Obstacle*> obstacles;
    2. obstacles << new Obstacle(...);
    3. //or
    4. obstacles.resize(10);
    5. obstacles[7] = new Obstacle(...);
    To copy to clipboard, switch view to plain text mode 

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

    fabietto (22nd November 2007)

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.