⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

Settings -> Save and Abort, Print Settings

  • Hello,
    I am designing a GUI for my 3D printer. At the home screen you can chose between starting a new print or changing the settings (feedrates, acceleration etc.). So unlinke as in the example, these settings are not properties of the GUI (like x postion, width etc.) but raw data that is entered through text fields and is insignificant to the GUI. The settings are saved at the end of the GUI in a .txt file which is later translated into a code for the printer.

    My first question is, how do i design a save- and abort-button? The user should be able to change the text fields but the changes should only be terminal when the save button is pressed.

    My second question is, should i ALWAYS read out the text fields? The settings usually shouldnt be changed, so is there a more efficient way? (read the text fields only when the save button was clicked, otherwise adopt the previous values?

    EDIT: I'm already using this library

  • I guess the second example kind of talks about saving changes but im not sure yet how to fill in the states. Here is what I tried

    Item {
         TextField {id: testField}
         Button {id: testButton; text: "Accept"; onClicked: settings.state = "inactive"}
         Settings {id:settings; property string state: "active"}
         state: settings.state
         states: [
              State {name: "active"}
              State {name:"inactive"; property alias test: testField.text}

    But that doesnt work. What do I need to write in the active state? Is the inactive state right?

  • Anyone who has an idea?

  • @MilloMille Which Control version (1 or 2) are you using?

  • This post is deleted!

  • @Eeli-K said in Settings -> Save and Abort, Print Settings:

    @MilloMille Which Control version (1 or 2) are you using?

    I'm using Qt Qucik Controls 1.2

  • Lifetime Qt Champion


    If you want a save/abort function then you should "load" the settings you're interested in in your widget before showing it and then only update the content of the settings from the widget when you click save.

Log in to reply