Important: Please read the Qt Code of Conduct -

Draw picture by using Qt and raw data

  • Hey all.
    I'm decoding video with libAVcodec, then i scale it with sws_scale() and draw it with QImage. This works correct at Linux. But when i cross compile my project and run it under qnx it doesn't work. I think that problem in QImage (i'm not sure). Is anyone knows what is the best way to draw picture with Qt 4.8.5 (only) resources from raw data at qnx? It's necessary to use qt4.8.5.

  • Lifetime Qt Champion


    It might help to explain exactly what doesn't work on qnx

  • Hello, SGaist.

    I try different ways to draw picture with QImage, use QApplication + QMainwindow classes in project.

    1. Simply load from file.

      @QImage* image = new QImage;


    It works fine at Linux, but at qnx - same project shows empty white window (QMainWindow i think) on green background.
    I launch project without photon (from text console) with command - "./ProgName -qws"

    1. Load from raw data.

       @myImage = new QImage(imageBuffer, width, height, QImage::Format_RGB32);@

    imageBuffer - buffer with raw data (uint8_t) that received after all needed libAV stuff done.
    Same think - at linux it works fine, but at qnx - empty white window (QMainWindow i think) on green background.

    No errors, no any other information.

  • Lifetime Qt Champion

    You don't check that your image is successfully loaded and I'd be surprised that you can access /tmp on qnx.

    Any reason to use a pointer to a QImage ? It's an implicitly shared class so you should save the trouble.

Log in to reply