mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 02:03:11 +02:00
trunked to a lambda for simplicity
This commit is contained in:
parent
087b19d64d
commit
de0b038ee1
2 changed files with 5 additions and 11 deletions
|
@ -136,8 +136,10 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap
|
||||||
if (properties.contains(PRESENTATION_MODE_PROPERTY)) {
|
if (properties.contains(PRESENTATION_MODE_PROPERTY)) {
|
||||||
presentationMode = (InteractiveWindowPresentationMode) properties[PRESENTATION_MODE_PROPERTY].toInt();
|
presentationMode = (InteractiveWindowPresentationMode) properties[PRESENTATION_MODE_PROPERTY].toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
_interactiveWindowProxy = std::unique_ptr<InteractiveWindowProxy, InteractiveWindowProxyDeleter>(new InteractiveWindowProxy());
|
_interactiveWindowProxy= std::unique_ptr<InteractiveWindowProxy, std::function<void(InteractiveWindowProxy*)>>(new InteractiveWindowProxy, [](InteractiveWindowProxy *p) {
|
||||||
|
p->deleteLater();
|
||||||
|
});
|
||||||
|
|
||||||
QObject::connect(_interactiveWindowProxy.get(), &InteractiveWindowProxy::webEventReceived, this, &InteractiveWindow::emitWebEvent, Qt::QueuedConnection);
|
QObject::connect(_interactiveWindowProxy.get(), &InteractiveWindowProxy::webEventReceived, this, &InteractiveWindow::emitWebEvent, Qt::QueuedConnection);
|
||||||
QObject::connect(this, &InteractiveWindow::scriptEventReceived, _interactiveWindowProxy.get(), &InteractiveWindowProxy::emitScriptEvent, Qt::QueuedConnection);
|
QObject::connect(this, &InteractiveWindow::scriptEventReceived, _interactiveWindowProxy.get(), &InteractiveWindowProxy::emitScriptEvent, Qt::QueuedConnection);
|
||||||
|
|
|
@ -37,7 +37,6 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class InteractiveWindowProxy : public QObject {
|
class InteractiveWindowProxy : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -54,13 +53,6 @@ signals:
|
||||||
void webEventReceived(const QVariant& message);
|
void webEventReceived(const QVariant& message);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct InteractiveWindowProxyDeleter {
|
|
||||||
void operator()(InteractiveWindowProxy * p) {
|
|
||||||
p->deleteLater();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
namespace InteractiveWindowEnums {
|
namespace InteractiveWindowEnums {
|
||||||
Q_NAMESPACE
|
Q_NAMESPACE
|
||||||
|
|
||||||
|
@ -332,7 +324,7 @@ protected slots:
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<QmlWindowProxy> _qmlWindowProxy;
|
std::shared_ptr<QmlWindowProxy> _qmlWindowProxy;
|
||||||
std::shared_ptr<DockWidget> _dockWidget { nullptr };
|
std::shared_ptr<DockWidget> _dockWidget { nullptr };
|
||||||
std::unique_ptr<InteractiveWindowProxy, InteractiveWindowProxyDeleter> _interactiveWindowProxy;
|
std::unique_ptr<InteractiveWindowProxy, std::function<void(InteractiveWindowProxy*)>> _interactiveWindowProxy;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef InteractiveWindow* InteractiveWindowPointer;
|
typedef InteractiveWindow* InteractiveWindowPointer;
|
||||||
|
|
Loading…
Reference in a new issue