mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-13 01:18:03 +02:00
adressing pr comments
This commit is contained in:
parent
6f04e039fe
commit
5a3585ea5b
3 changed files with 7 additions and 13 deletions
|
@ -112,10 +112,8 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap
|
||||||
|
|
||||||
Application::setupQmlSurface(quickView->rootContext() , true);
|
Application::setupQmlSurface(quickView->rootContext() , true);
|
||||||
|
|
||||||
|
|
||||||
//add any whitelisted callbacks
|
//add any whitelisted callbacks
|
||||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
OffscreenUi::applyWhiteList(sourceUrl, quickView->rootContext());
|
||||||
offscreenUi->widgetContextForUrl(sourceUrl, quickView->rootContext());
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Configures how a <code>NATIVE</code> window is displayed.
|
* Configures how a <code>NATIVE</code> window is displayed.
|
||||||
|
|
|
@ -307,15 +307,10 @@ void OffscreenQmlSurface::onRootContextCreated(QQmlContext* qmlContext) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void OffscreenQmlSurface::widgetContextForUrl(const QUrl& url, QQmlContext* context) {
|
void OffscreenQmlSurface::applyWhiteList(const QUrl& url, QQmlContext* context) {
|
||||||
|
|
||||||
// Get any whitelist functionality
|
|
||||||
QList<QmlContextCallback> callbacks = getQmlWhitelist()->getCallbacksForUrl(url);
|
QList<QmlContextCallback> callbacks = getQmlWhitelist()->getCallbacksForUrl(url);
|
||||||
// If we have whitelisted content, we must load a new context
|
for(const auto& callback : callbacks){
|
||||||
if(!callbacks.empty()){
|
callback(context);
|
||||||
for(const auto& callback : callbacks){
|
|
||||||
callback(context);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,8 @@ public:
|
||||||
|
|
||||||
static void addWhitelistContextHandler(const std::initializer_list<QUrl>& urls, const QmlContextCallback& callback);
|
static void addWhitelistContextHandler(const std::initializer_list<QUrl>& urls, const QmlContextCallback& callback);
|
||||||
static void addWhitelistContextHandler(const QUrl& url, const QmlContextCallback& callback) { addWhitelistContextHandler({ { url } }, callback); };
|
static void addWhitelistContextHandler(const QUrl& url, const QmlContextCallback& callback) { addWhitelistContextHandler({ { url } }, callback); };
|
||||||
|
static void applyWhiteList(const QUrl& url,QQmlContext* context);
|
||||||
|
|
||||||
bool isFocusText() const { return _focusText; }
|
bool isFocusText() const { return _focusText; }
|
||||||
bool getCleaned() { return _isCleaned; }
|
bool getCleaned() { return _isCleaned; }
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ public:
|
||||||
Q_INVOKABLE void lowerKeyboard();
|
Q_INVOKABLE void lowerKeyboard();
|
||||||
PointerEvent::EventType choosePointerEventType(QEvent::Type type);
|
PointerEvent::EventType choosePointerEventType(QEvent::Type type);
|
||||||
Q_INVOKABLE unsigned int deviceIdByTouchPoint(qreal x, qreal y);
|
Q_INVOKABLE unsigned int deviceIdByTouchPoint(qreal x, qreal y);
|
||||||
void widgetContextForUrl(const QUrl& url,QQmlContext* context);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void focusObjectChanged(QObject* newFocus);
|
void focusObjectChanged(QObject* newFocus);
|
||||||
|
|
Loading…
Reference in a new issue