Tests
This commit is contained in:
parent
0dbd10b5e3
commit
16fc02837a
2 changed files with 842 additions and 3 deletions
|
|
@ -39,6 +39,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QMimeData>
|
||||
#include <QPixmap>
|
||||
#include <QPointer>
|
||||
#include <QPushButton>
|
||||
#include <QScrollArea>
|
||||
#include <QSplitter>
|
||||
|
|
@ -614,9 +615,19 @@ GraphEditorWidget::GraphEditorWidget(warppipe::Client *client,
|
|||
&GraphEditorWidget::onRefreshTimer);
|
||||
|
||||
if (m_client) {
|
||||
m_client->SetChangeCallback([this] {
|
||||
QMetaObject::invokeMethod(m_changeTimer,
|
||||
qOverload<>(&QTimer::start),
|
||||
QPointer<QTimer> changeTimer = m_changeTimer;
|
||||
m_client->SetChangeCallback([changeTimer] {
|
||||
auto *app = QCoreApplication::instance();
|
||||
if (!app) {
|
||||
return;
|
||||
}
|
||||
|
||||
QMetaObject::invokeMethod(app,
|
||||
[changeTimer]() {
|
||||
if (changeTimer) {
|
||||
changeTimer->start();
|
||||
}
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
});
|
||||
}
|
||||
|
|
@ -648,6 +659,13 @@ void GraphEditorWidget::scheduleSaveLayout() {
|
|||
}
|
||||
|
||||
GraphEditorWidget::~GraphEditorWidget() {
|
||||
if (m_scene) {
|
||||
disconnect(m_scene, nullptr, this, nullptr);
|
||||
}
|
||||
if (m_model) {
|
||||
disconnect(m_model, nullptr, this, nullptr);
|
||||
}
|
||||
|
||||
if (m_client) {
|
||||
m_client->SetChangeCallback(nullptr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue