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. QGraphicsScene not output image after add QPixmap
Qt 6.11 is out! See what's new in the release blog

QGraphicsScene not output image after add QPixmap

Scheduled Pinned Locked Moved Unsolved General and Desktop
qgraphicssceneqpix
2 Posts 2 Posters 1.1k 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.
  • D Offline
    D Offline
    debian
    wrote on last edited by
    #1

    Hello!
    I use qt-5.5.1 x64 on linux.
    For output images I use qrpaphicsscene, follow simple code

    _scene->addPixmap(QPixmap::fromImage(image));
    

    Usually I work with images in QImage::Format_RGB888, but now I have images in QImage::Format_ARGB32 and I see only black screen.
    Ok, may be qgraphicsscene can't work with QImage::Format_ARGB32?
    I convert image to QImage::Format_RGB888

    QImage rgb = image.convertToFormat(QImage::Format_RGB888);
    _scene->addPixmap(QPixmap::fromImage(rgb));
    

    Unfortunately this not solve problem.
    How can I solve this problem?
    Thank you and excuse my bad english.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Might be a silly question but are you sure that the new image is valid and not null ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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