mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #164] Pass window size to Main.qml programmatically #104
Labels
No labels
bug
enhancement
help wanted
help wanted
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/qmlnet#104
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @WingedToaster on GitHub (Sep 16, 2019).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/164
Is there a way to pass in the size of the window to Main.qml from the .Net Core json config file instead of hardcoding into the Main.qml?
@pauldotknopf commented on GitHub (Sep 17, 2019):
You can set a property on the QQmlApplicationEngine. I believe the method to set the value is "SetContextProperty". Any value set there will "just be available" in qml as a named variable.
@WingedToaster commented on GitHub (Sep 17, 2019):
Yes, works like a champ, thanks!
config.json
Main.qml
Program