Results 1 to 8 of 8

Thread: QLabel does not repaint QPixmap

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2017
    Posts
    5
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default QLabel does not repaint QPixmap

    Hello!

    I'm using QT5.7.
    I have 2 labels that's used for video frame representation. For each label i pass frames correctly and it works with code below.
    I just simply get new frames from my external source, than i convert them to Pixmap and call setPixmap(map);
    Code looks like this :

    QImage image = QImage(frame.data, frame.width, frame.height, QImage::Format_RGB888);
    image = image.scaledToWidth(320, Qt::SmoothTransformation);
    QPixmap map = QPixmap::fromImage(image);
    QLabel *label = (QLabel *)ui->streamPlayerTable->cellWidget(x,y)->findChild<QLabel*>();
    label->setPixmap(map);

    Both videos goes correctly for 1min, 5min, sometimes 30min. But sometimes one of those videos just stop. Seemingly with no reason!! I see that new pixmaps are created for both labels. Frames are coming, gdb does not show any suspicious thread exiting messages, memory usage is constant and cpu is not very high at the moment when some video stops, also no console messages.

    It seems that pixmap are stuck in some repaint request. But as i don't know a lot of QT framework internals, i please to help me to understand what might cause such behaviour.

    Is there any way to force label to repaint pixmap with no crashes ?

    If anyone had experienced in such behaviour on QT please share ideas to solve it.

    Thanks in advance!
    Last edited by __Emanuel; 4th February 2017 at 22:30.

Similar Threads

  1. Pan/Move QPixmap in QLabel
    By ashtray4241 in forum Qt Programming
    Replies: 5
    Last Post: 14th August 2014, 08:50
  2. QPixmap and QLabel performance
    By mass85 in forum Qt Programming
    Replies: 10
    Last Post: 13th December 2010, 10:19
  3. QLabel, QPixmap and ScaledContents
    By mhbeyle in forum Qt Programming
    Replies: 3
    Last Post: 28th November 2009, 09:11
  4. DrawLine over QPixmap within Qlabel
    By Qt Coder in forum Qt Programming
    Replies: 8
    Last Post: 26th March 2009, 12:21
  5. Rotate QPixmap set on QLabel
    By Qt Coder in forum Qt Programming
    Replies: 1
    Last Post: 18th March 2009, 12:08

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.