mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 03:24:46 +02:00
Add WindowScriptingInterface::doCreateWebWindow
This commit is contained in:
parent
a1d771a0be
commit
3ec28f8e30
3 changed files with 13 additions and 2 deletions
|
@ -56,7 +56,7 @@ void WebWindowClass::setVisible(bool visible) {
|
|||
QScriptValue WebWindowClass::constructor(QScriptContext* context, QScriptEngine* engine) {
|
||||
WebWindowClass* retVal;
|
||||
QString file = context->argument(0).toString();
|
||||
QMetaObject::invokeMethod(WindowScriptingInterface::getInstance(), "doCreateWebWindowClass", Qt::BlockingQueuedConnection,
|
||||
QMetaObject::invokeMethod(WindowScriptingInterface::getInstance(), "doCreateWebWindow", Qt::BlockingQueuedConnection,
|
||||
Q_RETURN_ARG(WebWindowClass*, retVal),
|
||||
Q_ARG(const QString&, file),
|
||||
Q_ARG(int, context->argument(1).toInteger()),
|
||||
|
@ -64,5 +64,5 @@ QScriptValue WebWindowClass::constructor(QScriptContext* context, QScriptEngine*
|
|||
|
||||
connect(engine, &QScriptEngine::destroyed, retVal, &WebWindowClass::deleteLater);
|
||||
|
||||
return engine->newQObject(retVal);//, QScriptEngine::ScriptOwnership);
|
||||
return engine->newQObject(retVal);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,10 @@ WindowScriptingInterface::WindowScriptingInterface() :
|
|||
{
|
||||
}
|
||||
|
||||
WebWindowClass* WindowScriptingInterface::doCreateWebWindow(const QString& url, int width, int height) {
|
||||
return new WebWindowClass(url, width, height);
|
||||
}
|
||||
|
||||
QScriptValue WindowScriptingInterface::hasFocus() {
|
||||
return Application::getInstance()->getGLWidget()->hasFocus();
|
||||
}
|
||||
|
|
|
@ -15,6 +15,11 @@
|
|||
#include <QObject>
|
||||
#include <QScriptValue>
|
||||
#include <QString>
|
||||
#include <QFileDialog>
|
||||
#include <QComboBox>
|
||||
#include <QLineEdit>
|
||||
|
||||
#include "WebWindowClass.h"
|
||||
|
||||
class WindowScriptingInterface : public QObject {
|
||||
Q_OBJECT
|
||||
|
@ -72,6 +77,8 @@ private slots:
|
|||
|
||||
void nonBlockingFormAccepted() { _nonBlockingFormActive = false; _formResult = QDialog::Accepted; emit nonBlockingFormClosed(); }
|
||||
void nonBlockingFormRejected() { _nonBlockingFormActive = false; _formResult = QDialog::Rejected; emit nonBlockingFormClosed(); }
|
||||
|
||||
WebWindowClass* doCreateWebWindow(const QString& url, int width, int height);
|
||||
|
||||
private:
|
||||
WindowScriptingInterface();
|
||||
|
|
Loading…
Reference in a new issue