Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    QML and Qt Quick
    1
    1
    123
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Diracsbracket
      Diracsbracket last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post