Results 1 to 5 of 5

Thread: Display a jpg file in a widget.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Oct 2007
    Posts
    9
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Unhappy Problem in display image

    Hello Everyone,
    I m displaying a .jpg file in a widget through QLabel and QScrollerArea Class .
    But it does not display the .jpg files
    My coding is as following ..........
    Qt Code:
    1. QLabel *imageLabel;
    2. imageLabel = new QLabel;
    3. imageLabel->setBackgroundRole(QPalette::Base);
    4. imageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
    5. imageLabel->setScaledContents(TRUE);
    6.  
    7. QImage image(mediaPath[currentIndex]);
    8. imageLabel->setPixmap(QPixmap::fromImage(image));
    9. imageLabel->resize(imageLabel->pixmap()->size());
    10. scrollArea->setBackgroundRole(QPalette::Dark);
    11. scrollArea->setWidget(imageLabel);
    12. scrollArea->setWidgetResizable(TRUE);
    To copy to clipboard, switch view to plain text mode 

    If anyone has any idea please reply it.
    Thanks in advance......................
    Last edited by wysota; 26th October 2007 at 14:41. Reason: missing [code] tags

Similar Threads

  1. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  2. Replies: 4
    Last Post: 10th March 2007, 18:01
  3. QWidget display on 2 stack widget page
    By spawnwj in forum Qt Programming
    Replies: 3
    Last Post: 4th September 2006, 12:07
  4. Replies: 3
    Last Post: 12th April 2006, 08:20

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.