Efficient way of displaying a continuous stream of QImages

后端 未结 3 578
故里飘歌
故里飘歌 2020-12-16 06:47

I am currently using a QLabel to do this, but this seems to be rather slow:

void Widget::sl_updateLiveStreamLabel(spImageHolder_t _imageHolderShPtr) //slot         


        
3条回答
  •  死守一世寂寞
    2020-12-16 07:00

    I recommend not use QLabel but write own class. Every call of setPixmap causes layout system to recalculate sizes of items and this can propagate to topmost parent (QMainWindow) and this is quite big overhead.

    Conversion and scaling also is a bit costly.

    Finally best approach is to use profiler to detect where is the biggest problem.

提交回复
热议问题