Results 1 to 4 of 4

Thread: Loading image from subclass QGraphicsview

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 453 Times in 435 Posts
    Wiki edits
    15

    Default Re: Loading image from subclass QGraphicsview

    fromImage() is a static member function, you need to copy the converted pixmap into a variable (you might have ignored the compiler warning, or may be even disabled them). Anyways this will work
    Qt Code:
    1. QPixmap pixmap;
    2. pixmap = pixmap.fromImage(image1);
    To copy to clipboard, switch view to plain text mode 
    and even better is this
    Qt Code:
    1. QPixmap pixmap;
    2. pixmap = QPixmap::fromImage(image1);
    To copy to clipboard, switch view to plain text mode 
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

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

    2lights (26th August 2013)

Similar Threads

  1. Replies: 4
    Last Post: 15th February 2013, 11:55
  2. Loading Image
    By navi1084 in forum Qt Programming
    Replies: 2
    Last Post: 27th June 2011, 06:07
  3. Loading a raw image into QImage
    By Luc4 in forum Qt Programming
    Replies: 6
    Last Post: 16th May 2010, 16:20
  4. QGraphicsItem subclass access to QGraphicsView size
    By rubenvb in forum Qt Programming
    Replies: 4
    Last Post: 23rd January 2010, 22:36
  5. Image Loading
    By kavinsiva in forum Qt Programming
    Replies: 2
    Last Post: 11th August 2009, 09:00

Tags for this Thread

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.