Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Display image in QT

    General and Desktop
    4
    4
    2184
    Loading More Posts
    • 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
      thomas11live.com.sg last edited by

      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 Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

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

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • I
          issam last edited by

          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 Reply Quote 0
          • D
            dcbasso last edited by

            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 Reply Quote 0
            • First post
              Last post