Skip to content

Commit 230c53d

Browse files
committed
Force basic render loop
1 parent fd161f3 commit 230c53d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/targetpainter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ TargetPainter::~TargetPainter()
1919

2020
void TargetPainter::paint(QNanoPainter *painter)
2121
{
22+
if (QThread::currentThread() != qApp->thread()) {
23+
qFatal("Error: Rendering must happen in the GUI thread to work correctly. Please disable threaded render loop using qputenv(\"QSG_RENDER_LOOP\", \"basic\") before constructing your "
24+
"application object.");
25+
}
26+
2227
m_target->lockCostume();
2328
double width = m_target->width();
2429
double height = m_target->height();

0 commit comments

Comments
 (0)