Unsolved QML Configuration Values
-
Hi my task is simple i need to get some values from confuguration file in qml application, I will give you a demo of my application as :
//File.qml
Rectangle
{
id:rectangle1
width: default_width // Width of Rectangle 1
height: default _height / Height of Rectangle 1
}Rectangle
{
id:rectangle2
width: default_width // Width of Rectangle 2
height: default _height / Height of Rectangle 2
}config.ini
[Rectangle1]
width=100
height=100[Rectangle2]
width=50
height=50tell me how to configure my config file too. i know one solution to use config.ini in Qsetting but i dont want to use it using Qt c++ file , i want a direct solution which i can use to load values fron configuration file and set width and height of rectangle in qml application. and if width and height is updated then save updated values in configuration file.
-
-
@J-Hilk :
Thanks for your support, As i am new to qt can you please give me a few lines of code implement this i have seen this post but have some confusion to implement it.
-
@Lodhi-bhkr please read the documentation in the link I gave you, the very first section details has a working example on how to save the window state (x, y, width and height) and it loads the last state automatically during the next start of the program
-
This post is deleted!