Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Calling QWidget::render() inside QQuickPaintedItem::paint() works on Debian PC but not on Raspbian?



  • Hi,
    I have the same problem as described in this forum post, where I use a QQuickPaintedItem to render a QWidget for use inside a QML app.

    The render() command below triggers the exception shown further below:

      void paint(QPainter *painter) { //QQuickPaintedItem::paint
          //qDebug() << this->thread() << current_analyzer_->thread();
    
          if (current_analyzer_) //current_analyzer_ is a QWidget-derived class instance 
              current_analyzer_->render(painter, QPoint(), QRegion());
      }
    

    Exception:

    __logging_message__16:46:41.679 ERROR unknown                          ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread 0x0x261ffc0. Receiver '' (of type 'Analyzer') was created in thread 0x0x23a2bf8", file /home/buster/raspi/qt-everywhere-src-5.15.0/qtbase/src/corelib/kernel/qcoreapplication.cpp, line 558
    11:46:41: Remote process crashed.
    

    The link above explains the problem, but does not really explain why the exception is triggered on Raspbian (Pi3B+) but not on Debian (PC), both using Buster and Qt5.15.

    The same construction used to work on both platforms with Debian/Raspbian Stretch and a few Qt releases ago. So why would rendering a QWidget inside a QQuickPaintedItem work on one platform but not on the other?


Log in to reply