Results 1 to 3 of 3

Thread: problem with QList

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question problem with QList

    I have a list of QGraphicsScene*:

    QList<QGraphicsScene*>scenes;

    Each element of the list would be a pointer of type QGraphicsScene*....
    So scenes[i] return a QgraphicsScene* element????
    From the documentation:
    "On non-const lists, operator[]() returns a reference to the item".....so in my case, it will return a QGraphicsScene** element??

    I want to pass this list of scenes, to an other myclass object:
    Qt Code:
    1. myclass::myclass(QList<QGraphicsScene*> s){}
    To copy to clipboard, switch view to plain text mode 

    ...but the compiler gives me error if a write
    myclass(scenes)........
    Last edited by dreamer; 9th May 2008 at 19:03. Reason: updated contents

Similar Threads

  1. Sorting using qSort(), - if QList contains POINTERS
    By joseph in forum Qt Programming
    Replies: 13
    Last Post: 18th August 2013, 18:55
  2. QList index out of range problem
    By MarkoSan in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2008, 08:40
  3. Replies: 3
    Last Post: 15th April 2007, 19:16
  4. Accessing QList Objects
    By magikalpnoi in forum Qt Programming
    Replies: 7
    Last Post: 21st September 2006, 20:43
  5. QList problem
    By acix in forum General Programming
    Replies: 6
    Last Post: 29th April 2006, 13:08

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.