Nominate our 2022 Qt Champions!

Qt changing the values of elements of UI

  • I am new in Qt, now I created a UI and everything is working fine
    In my UI, there are a lot of elements (Combobox, line edit, spin box .... etc) and I want a comfortable and convenient way that allows me to fill these elements by using a pre-saved configuration file, that is mean this configuration file should contain the elements' values of my UI. And at the end, if I change these values from UI, the corresponding values in the config file should also change. Is there any help?

  • Moderators

    There is no easy and automatic way to do it, I think. Start by looking into QSettings. You can use that class to load data on startup (probably in constructor of your UI class) and save when data in UI changes (add code to relevant slots).

  • @sierdzio thank you. I wish there was a direct and easy way. I will search in QSettings

Log in to reply