mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-11-05 03:46:32 +00:00
fix: fix scopes of created QQmlComponents
Using the scope of the component itself makes sure things availible in its scope are usable, instead of the parent scope.
This commit is contained in:
3 files changed
+4
-3
No files matched your search
@@ -95,7 +95,7 @@ void Variants::updateVariants() {
|
||||
|
||||
auto* instance = this->mComponent->createWithInitialProperties(
|
||||
variant,
|
||||
QQmlEngine::contextForObject(this)
|
||||
QQmlEngine::contextForObject(this->mComponent)
|
||||
);
|
||||
|
||||
if (instance == nullptr) {
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ void SocketServer::disableServer() {
|
||||
|
||||
void SocketServer::onNewConnection() {
|
||||
if (auto* connection = this->server->nextPendingConnection()) {
|
||||
auto* instanceObj = this->mHandler->create(QQmlEngine::contextForObject(this));
|
||||
auto* instanceObj = this->mHandler->create(QQmlEngine::contextForObject(this->mHandler));
|
||||
auto* instance = qobject_cast<Socket*>(instanceObj);
|
||||
|
||||
if (instance == nullptr) {
|
||||
|
||||
@@ -73,7 +73,8 @@ void SessionLock::updateSurfaces(SessionLock* old) {
|
||||
|
||||
for (auto* screen: screens) {
|
||||
if (!this->surfaces.contains(screen)) {
|
||||
auto* instanceObj = this->mSurfaceComponent->create(QQmlEngine::contextForObject(this));
|
||||
auto* instanceObj =
|
||||
this->mSurfaceComponent->create(QQmlEngine::contextForObject(this->mSurfaceComponent));
|
||||
auto* instance = qobject_cast<SessionLockSurface*>(instanceObj);
|
||||
|
||||
if (instance == nullptr) {
|
||||
|
||||
Reference in new issue
Block a user