mirror of
https://github.com/overte-org/overte.git
synced 2025-04-17 01:56:39 +02:00
Allow scripts to receive a visibility changed signal from their windows
This commit is contained in:
parent
49e5f668c1
commit
1f451269cd
2 changed files with 3 additions and 2 deletions
|
@ -123,6 +123,7 @@ void QmlWindowClass::initQml(QVariantMap properties) {
|
|||
|
||||
// Forward messages received from QML on to the script
|
||||
connect(_qmlWindow, SIGNAL(sendToScript(QVariant)), this, SLOT(qmlToScript(const QVariant&)), Qt::QueuedConnection);
|
||||
connect(_qmlWindow, SIGNAL(visibleChanged()), this, SIGNAL(visibleChanged()), Qt::QueuedConnection);
|
||||
});
|
||||
}
|
||||
Q_ASSERT(_qmlWindow);
|
||||
|
|
|
@ -24,7 +24,7 @@ class QmlWindowClass : public QObject {
|
|||
Q_OBJECT
|
||||
Q_PROPERTY(glm::vec2 position READ getPosition WRITE setPosition NOTIFY positionChanged)
|
||||
Q_PROPERTY(glm::vec2 size READ getSize WRITE setSize NOTIFY sizeChanged)
|
||||
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged)
|
||||
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
|
||||
|
||||
public:
|
||||
static QScriptValue constructor(QScriptContext* context, QScriptEngine* engine);
|
||||
|
@ -52,7 +52,7 @@ public slots:
|
|||
void sendToQml(const QVariant& message);
|
||||
|
||||
signals:
|
||||
void visibilityChanged(bool visible); // Tool window
|
||||
void visibleChanged();
|
||||
void positionChanged();
|
||||
void sizeChanged();
|
||||
void moved(glm::vec2 position);
|
||||
|
|
Loading…
Reference in a new issue