mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 11:29:25 +02:00
requested changes
This commit is contained in:
parent
7c024b4e8a
commit
c4a0b39068
2 changed files with 43 additions and 10 deletions
|
@ -51,6 +51,26 @@ static const QStringList KNOWN_SCHEMES = QStringList() << "http" << "https" << "
|
||||||
|
|
||||||
static const int DEFAULT_HEIGHT = 60;
|
static const int DEFAULT_HEIGHT = 60;
|
||||||
|
|
||||||
|
QmlWindowProxy::QmlWindowProxy(QObject* qmlObject, QObject* parent) : QmlWrapper(qmlObject, parent) {
|
||||||
|
_qmlWindow = qmlObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QmlWindowProxy::updateInteractiveWindowPositionForMode() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void QmlWindowProxy::setPosition(const glm::vec2& position) {
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::vec2 QmlWindowProxy::getPosition() const {
|
||||||
|
}
|
||||||
|
|
||||||
|
void QmlWindowProxy::setSize(const glm::vec2& size) {
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::vec2 QmlWindowProxy::getSize() const {
|
||||||
|
}
|
||||||
|
|
||||||
|
void QmlWindowProxy::setTitle(const QString& title
|
||||||
static void dockWidgetDeleter(DockWidget* dockWidget) {
|
static void dockWidgetDeleter(DockWidget* dockWidget) {
|
||||||
dockWidget->deleteLater();
|
dockWidget->deleteLater();
|
||||||
}
|
}
|
||||||
|
@ -296,11 +316,6 @@ void InteractiveWindow::qmlToScript(const QVariant& message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void InteractiveWindow::setVisible(bool visible) {
|
void InteractiveWindow::setVisible(bool visible) {
|
||||||
if (QThread::currentThread() != thread()) {
|
|
||||||
QMetaObject::invokeMethod(this, "setVisible", Q_ARG(bool, visible));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_qmlWindow.isNull()) {
|
if (!_qmlWindow.isNull()) {
|
||||||
QMetaObject::invokeMethod(_qmlWindow, "setProperty", Q_ARG(const char*, INTERACTIVE_WINDOW_VISIBLE_PROPERTY),
|
QMetaObject::invokeMethod(_qmlWindow, "setProperty", Q_ARG(const char*, INTERACTIVE_WINDOW_VISIBLE_PROPERTY),
|
||||||
Q_ARG(bool, visible));
|
Q_ARG(bool, visible));
|
||||||
|
@ -324,11 +339,6 @@ glm::vec2 InteractiveWindow::getPosition() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void InteractiveWindow::setPosition(const glm::vec2& position) {
|
void InteractiveWindow::setPosition(const glm::vec2& position) {
|
||||||
if (QThread::currentThread() != thread()) {
|
|
||||||
QMetaObject::invokeMethod(this, "setPosition", Q_ARG(const glm::vec2&, position));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_qmlWindow.isNull()) {
|
if (!_qmlWindow.isNull()) {
|
||||||
QMetaObject::invokeMethod(_qmlWindow, "setProperty", Q_ARG(const char*, INTERACTIVE_WINDOW_POSITION_PROPERTY),
|
QMetaObject::invokeMethod(_qmlWindow, "setProperty", Q_ARG(const char*, INTERACTIVE_WINDOW_POSITION_PROPERTY),
|
||||||
Q_ARG(QPointF, QPointF(position.x, position.y)));
|
Q_ARG(QPointF, QPointF(position.x, position.y)));
|
||||||
|
|
|
@ -18,10 +18,33 @@
|
||||||
#include <QtCore/QPointer>
|
#include <QtCore/QPointer>
|
||||||
#include <QtScript/QScriptValue>
|
#include <QtScript/QScriptValue>
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
|
#include <ui/QmlWrapper.h>
|
||||||
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <GLMHelpers.h>
|
#include <GLMHelpers.h>
|
||||||
|
|
||||||
|
class QmlWindowProxy : QmlWrapper {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QmlWindowProxy(QObject* qmlObject, QObject* parent = nullptr);
|
||||||
|
|
||||||
|
Q_INVOKABLE void updateInteractiveWindowPositionForMode();
|
||||||
|
|
||||||
|
Q_INVOKABLE void setPosition(const glm::vec2& position);
|
||||||
|
glm::vec2 getPositiion() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE void setSize(const glm::vec2& size);
|
||||||
|
glm::vec2 getSize() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE void setTitle(const QString& title);
|
||||||
|
QString getTitle() const;
|
||||||
|
private:
|
||||||
|
QObject* _qmlWindow;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
namespace InteractiveWindowEnums {
|
namespace InteractiveWindowEnums {
|
||||||
Q_NAMESPACE
|
Q_NAMESPACE
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue