mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-09 16:52:12 +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);
|
||||
|
||||
|
||||
//add any whitelisted callbacks
|
||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||
offscreenUi->widgetContextForUrl(sourceUrl, quickView->rootContext());
|
||||
OffscreenUi::applyWhiteList(sourceUrl, quickView->rootContext());
|
||||
|
||||
/**jsdoc
|
||||
* Configures how a <code>NATIVE</code> window is displayed.
|
||||
|
|
|
@ -307,15 +307,10 @@ void OffscreenQmlSurface::onRootContextCreated(QQmlContext* qmlContext) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void OffscreenQmlSurface::widgetContextForUrl(const QUrl& url, QQmlContext* context) {
|
||||
|
||||
// Get any whitelist functionality
|
||||
void OffscreenQmlSurface::applyWhiteList(const QUrl& url, QQmlContext* context) {
|
||||
QList<QmlContextCallback> callbacks = getQmlWhitelist()->getCallbacksForUrl(url);
|
||||
// If we have whitelisted content, we must load a new context
|
||||
if(!callbacks.empty()){
|
||||
for(const auto& callback : callbacks){
|
||||
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 QUrl& url, const QmlContextCallback& callback) { addWhitelistContextHandler({ { url } }, callback); };
|
||||
|
||||
static void applyWhiteList(const QUrl& url,QQmlContext* context);
|
||||
|
||||
bool isFocusText() const { return _focusText; }
|
||||
bool getCleaned() { return _isCleaned; }
|
||||
|
||||
|
@ -36,7 +37,7 @@ public:
|
|||
Q_INVOKABLE void lowerKeyboard();
|
||||
PointerEvent::EventType choosePointerEventType(QEvent::Type type);
|
||||
Q_INVOKABLE unsigned int deviceIdByTouchPoint(qreal x, qreal y);
|
||||
void widgetContextForUrl(const QUrl& url,QQmlContext* context);
|
||||
|
||||
|
||||
signals:
|
||||
void focusObjectChanged(QObject* newFocus);
|
||||
|
|
Loading…
Reference in a new issue