Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Display image in QT
Forum Updated to NodeBB v4.3 + New Features

Display image in QT

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thomas11live.com.sg
    wrote on last edited by
    #1

    Dear All,
    I am new in QT programming and working of the project related to camera and images.
    I want to display the camera captured images in QT main window.
    So I use QGraphicsView. My queries are
    (1) Is that right approach using QGraphicsView to display images?
    (2) What is the best approach to display images in QGraphicsView in terms of processing time?I need to display real time images.
    Thanks

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Depends on the use case, but in many cases it is sufficient to use QLabel.

      (Z(:^

      1 Reply Last reply
      0
      • I Offline
        I Offline
        issam
        wrote on last edited by
        #3

        Hi, it's Qt :)
        QGraphicsView + QGraphicsScene is the best choice.
        You will use the QGraphicsScene::addPixmap() function to add the image to the scene and to display it.
        For the best performance you have to set some flags and properties (bspTreeDepth, QGraphicsView::OptimizationFlag, QGraphicsItem::GraphicsItemFlags).

        good luck !

        http://www.iissam.com/

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dcbasso
          wrote on last edited by
          #4

          Here a simple example code:

          @
          QGraphicsScene scene;
          QLabel *gif_anim = ui->lbIcone;
          QMovie *movie = new QMovie(":/imagens/32/loading_2.gif");
          gif_anim->setMovie(movie);
          movie->start();
          @

          It's works fine to me, and show some animated GIFs!

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved