Results 1 to 7 of 7

Thread: Whats wrong with QList<QGraphicsItem>

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Oct 2009
    Location
    Mexico
    Posts
    81
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    6
    Thanked 10 Times in 10 Posts

    Default Re: Whats wrong with QList<QGraphicsItem>

    The QGraphicsItem is a abstrac class and can't be used directly, QGraphicsItem::paint ()is a pure virtual function, so you can't create a object of this class. QGraphics is used as a base class

    because of this..

    Qt Code:
    1. QList<QGraphicsItem> //don't compile. can't create a object of a abstract class
    2. QList<QGraphicsItem *> // works because is posible create a pointer of a abstract class, polymorphism
    3. QList<SubclassGraphicsItem> //works because the class is not abstract
    To copy to clipboard, switch view to plain text mode 
    Last edited by ecanela; 22nd January 2010 at 20:12. Reason: updated contents

Similar Threads

  1. Whats a manifest file for vc++
    By tgreaves in forum General Programming
    Replies: 4
    Last Post: 14th May 2012, 10:46
  2. Copying an QList into a new, sorted QList.
    By Thomas Wrobel in forum Newbie
    Replies: 3
    Last Post: 11th January 2010, 19:27
  3. Whats wrong with this script -- help needed
    By swamyonline in forum Qt Programming
    Replies: 5
    Last Post: 2nd July 2009, 14:17
  4. Whats This box too small
    By bruccutler in forum Qt Programming
    Replies: 5
    Last Post: 31st March 2007, 00:52
  5. Replies: 1
    Last Post: 18th March 2006, 17:37

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.