Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -411,6 +411,11 @@ int WindowScriptingInterface::getY() { · 410 unmodified lines | ||
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | void WindowScriptingInterface::copyToClipboard(const QString& text) { |
| 414 | + if (QThread::currentThread() != qApp->thread()) { | |
| 415 | + QMetaObject::invokeMethod(this, "copyToClipboard", Q_ARG(QString, text)); | |
| 416 | + return; | |
| 417 | + } | |
| 418 | + | |
| 414 | 419 | qDebug() << "Copying"; |
| 415 | 420 | QApplication::clipboard()->setText(text); |
| 416 | 421 | } |