Results 1 to 4 of 4

Thread: How can I use QGraphicsRectItem?

  1. #1
    Join Date
    Sep 2008
    Posts
    93
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default How can I use QGraphicsRectItem?

    Hello,

    I will use convert QImage to QGraphicsRectItem. I have to implement paint() fromQGraphicsItem. But there is no virtual destructor in QGraphicsItem. how can I work out this?

    Thanks!

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How can I use QGraphicsRectItem?

    Quote Originally Posted by learning_qt View Post
    I will use convert QImage to QGraphicsRectItem. I have to implement paint() fromQGraphicsItem.
    Why not QGraphicsPixmapItem?

    But there is no virtual destructor in QGraphicsItem. how can I work out this?
    Of course it's virtual as indicated by the docs.
    J-P Nurmi

  3. #3
    Join Date
    Sep 2008
    Posts
    93
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default Re: How can I use QGraphicsRectItem?

    Sorry, I made a mistake.

    There is no virtual destructor in QGraphicsRectItem. So I can not inherit it. Could you please give some hints to solve this?

    I will not use QGraphicsPixmapItem because QImage is used in my application.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How can I use QGraphicsRectItem?

    It's declared as virtual by QGraphicsItem so it remains virtual in all subclasses.
    J-P Nurmi

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.