Results 1 to 5 of 5

Thread: Display Images in QGraphicsView

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: Display Images in QGraphicsView

    Yes, I just tested with:
    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication a(argc, argv);
    4. QGraphicsScene *scn = new QGraphicsScene( w );
    5. scn->setSceneRect( w->rect() );
    6. w->setScene( scn );
    7. w->setFixedSize( 400, 400 );
    8. QPixmap pix( "c:\\pix_jpg.jpg" );
    9. scn->addPixmap( pix );
    10. w->show();
    11. a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
    12. return a.exec();
    13. }
    To copy to clipboard, switch view to plain text mode 
    ( yes, this is a very poor example ).

    I loaded both your jpeg and some others, and also a png. All were OK.
    Maybe you have some problems with your jpeg plug-in. Try loading a png instead.

    Anyway, you should look at what pixmap.size() return after you load it.
    Regards
    Last edited by marcel; 15th May 2007 at 18:42.

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

    robertaandrews (16th May 2007)

Similar Threads

  1. Is there any way to synchronize the display of images
    By kiransu123 in forum General Programming
    Replies: 2
    Last Post: 17th March 2007, 20:50
  2. Display multiple Images in a widget
    By jeetu_happy in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2007, 11:24
  3. Display animated images
    By suresh in forum Qt Programming
    Replies: 1
    Last Post: 27th January 2007, 21:53
  4. How to display images in QTextBrowser ?
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2007, 08:58
  5. Widget to display images and text ?
    By probine in forum Qt Tools
    Replies: 4
    Last Post: 9th October 2006, 20:49

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.