Results 1 to 5 of 5

Thread: diplaying image

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Mar 2008
    Location
    Morocco
    Posts
    47
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    7
    Thanked 1 Time in 1 Post

    Default Re: displaying image

    qDebug() << path << image.isNull() << QImageReader::supportedFormats();

    Error: supportedFormats() is not a memeber of QImageReader...

    well .. actualy I read Some Tuto About Graphics ...What I understand is That a QGraphicsScene sereves as a container for QgraphicsItem ..and The QGraphicsView Provides the View Widget that Visualize the contain of scene..
    So I tryed That Code :

    Qt Code:
    1. //connect (actionOpen,SIGNAL(triggered()),this,SLOT(Open()));
    2.  
    3. void myform::Open(){
    4.  
    5. path=QFileDialog::getOpenFileName(this,"Choose a file to oepn",QString::null,QString::null);
    6.  
    7. if(!path.isEmpty()){
    8. QPixmap image(path);
    9. QGraphicsPixmapItem mypixmap(image);
    10. scene->addItem(&mypixmap); //scene declared as QGraphicsScene
    11. graphicsView->setScene(scene); //graphicsView as QGraphicsView
    12. graphicsView->show();
    13. }
    14. }
    To copy to clipboard, switch view to plain text mode 
    but Nothing was displayed on the graphicsView ... (but a scrollbar was added to the View)
    Sould I refresh My graphicsView or did I miss some function for displayin;??

    Thanks for Help
    Last edited by jpn; 2nd April 2008 at 12:23. Reason: missing [code] tags

Similar Threads

  1. Finding marks on scanned image for alignment
    By caduel in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2007, 02:10
  2. Help needed handling image data
    By toratora in forum General Programming
    Replies: 2
    Last Post: 11th May 2007, 09:24
  3. how i can add image in my toolbar
    By jyoti in forum Qt Tools
    Replies: 7
    Last Post: 19th December 2006, 14:39
  4. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36
  5. Question about updating an image on screen
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2006, 19:01

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.