Results 1 to 14 of 14

Thread: QGraphics View

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #13
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QGraphics View

    Quote Originally Posted by Vivek1982 View Post
    Ya.. but If i try to just give QGraphicsItem *pix1= pix; pass the pointer. Im getting "error: cannot convert 'QPixmap' to 'QGraphicsItem*' in initialization"
    Well, if you look at the class declaration of QPixmap you will see that it does not inherit from QGraphicsItem.

    But the QGraphicsPixmapItem that you get from QGraphicsScene::addPixmap() does.

    Btw, your code snippet also creates an additional QGraphicsScene and then throws loses the pointer to it.

    Cheers,
    _

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

    Vivek1982 (20th December 2013)

Similar Threads

  1. Items in QGraphics View not starting from the top.
    By penny in forum Qt Programming
    Replies: 3
    Last Post: 1st April 2011, 13:10
  2. Creating Qgraphics View code
    By amagdy.ibrahim in forum Qt Programming
    Replies: 9
    Last Post: 15th June 2008, 15:43
  3. Qgraphics View
    By amagdy.ibrahim in forum Qt Programming
    Replies: 1
    Last Post: 15th June 2008, 10:10
  4. QGraphics view update : Help needed
    By kiranraj in forum Qt Programming
    Replies: 3
    Last Post: 3rd July 2007, 12:54
  5. QGraphics view problem
    By kiranraj in forum Qt Programming
    Replies: 5
    Last Post: 6th March 2007, 21:28

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.