Search code examples
qtqlistwidgetqpixmap

How can I add multiple QPixMap item to a widget?


I have video analysis c++ code and porting to the QT Creator for gui requirements.

We are detecting certain shapes and items from the video stream and adjust their size ie 100x100 and want to display on the screen. We can display through Label but only one QpixMap item.

What is the best way to show detected images automatically on a widget such as last 20 one that autosized?

Is there any a small code sample to start with it to show us the direction?

Thanks.


Solution

  • You could subclass QWidget and reimplement paintEvent to paint whatever you need using QPainter.

    See Basic Drawing Example for details:

    http://doc.qt.io/qt-5/qtwidgets-painting-basicdrawing-example.html