+ Reply to Thread
Results 1 to 4 of 4

Thread: QWidget::update crash in another thread

  1. #1
    Join Date
    Mar 2012
    Location
    china
    Posts
    52
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QWidget::update crash in another thread

    0 QRegion::isEmpty() const /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtGui.so.4 0 0x7ffff4d3cc25
    1 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtGui.so.4 0 0x7ffff4dc8420
    2 QWidget::update(QRect const&) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtGui.so.4 0 0x7ffff4bd6f82
    3 QWidget::update qwidget.h 1000 0x459809
    4 WndMain::SlaveCallback WndMain.cpp 3375 0x4497be
    5 DirectFeedback::OnVideoPreviewFrame DirectOperator.cpp 25 0x7fffe29c7750
    6 CameraAgent::OnReceivePreviewVideo CameraAgent.cpp 159 0x7fffe294f124
    7 VideoConsumer::Receive CameraAgent.h 70 0x7fffe294f71f
    8 Multiplexer:eliver Multiplexer.cpp 506 0x7fffe29ae456
    9 Deliverer:perator() Multiplexer.cpp 673 0x7fffe29af793
    10 GrThread::GrThread<Deliverer>(Deliverer&, void*)::A::Run() grthread.hpp 294 0x7fffe29b7d16
    11 GrThread::GrThread<Deliverer>(Deliverer&, void*)::A:roc(void*) grthread.hpp 298 0x7fffe29b5a7d
    12 start_thread /lib64/libpthread.so.0 0 0x7ffff3f66f05
    13 clone /lib64/libc.so.6 0 0x7ffff353253d

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    2,821
    Thanks
    15
    Thanked 625 Times in 594 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QWidget::update crash in another thread

    Looks like you are calling a QWidget method from a thread that is not the thread running QApplication::exec() (also often referred to as the main thread).

    Fixing that should make then problem go away as well.

    Cheers,
    _

  3. #3
    Join Date
    Mar 2012
    Location
    china
    Posts
    52
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QWidget::update crash in another thread

    but I find QWidget::udpate just like
    QApplication:ostEvent(frame, new UpdateVideoEvent(QRect(0,0,10,10)));

    UpdateVideoEvent is QEvent(UpdateLater)

    it just crash in QRegion::isEmpty(),

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    2,821
    Thanks
    15
    Thanked 625 Times in 594 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QWidget::update crash in another thread

    Hmm. What if you invoke the update method like this
    Qt Code:
    1. QMetaObject::invokeMethod(frame, "update", Qt::QueuedConnection);
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

+ Reply to Thread

Similar Threads

  1. Using QWidget::update() from non-GUI thread
    By some_birdie in forum Qt Programming
    Replies: 3
    Last Post: 21st June 2011, 10:11
  2. setPixmap crash (in a thread)
    By truegladiator in forum Newbie
    Replies: 1
    Last Post: 21st February 2011, 17:01
  3. Update GUI in a thread
    By olivier1978 in forum Qt Programming
    Replies: 3
    Last Post: 8th January 2011, 22:33
  4. thread GUI access crash
    By liqxpil in forum Qt Programming
    Replies: 3
    Last Post: 14th December 2010, 16:47
  5. Qt x11 GUI crash if multi-thread
    By wesley in forum Qt Programming
    Replies: 2
    Last Post: 21st January 2010, 10:11

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