-
-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Plugins] Asynchronous drawing #1690
Labels
feature request
A request for new functionality or behavior
Comments
The easiest could be adding an interface to accept a smart pointer of doc, void LC_myPlugin::execComm(std::unique_ptr<Document_Interface> doc, QWidget *parent, QString cmd) {
// move the ownership to the current LC_myPlugin instance
this->m_doc = std::move(doc);
....
connect(timer, &QTimer::timeout, this, [this]() {
qDebug() << "timer expired!";
QPointF start(0,0);
QPointF end(100, 200);
m_doc->addLine(&start, &end);
});
....
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Is it possible, or could it be possible in the future to allow plugins to draw asynchronously ?
Consider this code as a minimal example:
It crashes with a segfault because the
doc
pointer is a local variable in the calling method: https://github.com/LibreCAD/LibreCAD/blob/master/librecad/src/main/qc_applicationwindow.cpp#L724-L737I would like to be able to access to all drawing methods from within the Qt event loop.
This minimal example demonstrate it with a timer, but the drawing could be triggered by any Qt signal.
The text was updated successfully, but these errors were encountered: