Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Settings -> Save and Abort, Print Settings
Qt 6.11 is out! See what's new in the release blog

Settings -> Save and Abort, Print Settings

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
7 Posts 3 Posters 2.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MilloMille
    wrote on last edited by MilloMille
    #1

    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

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MilloMille
      wrote on last edited by MilloMille
      #2

      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?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MilloMille
        wrote on last edited by
        #3

        Anyone who has an idea?

        E 1 Reply Last reply
        0
        • M MilloMille

          Anyone who has an idea?

          E Offline
          E Offline
          Eeli K
          wrote on last edited by
          #4

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

          M 1 Reply Last reply
          0
          • M Offline
            M Offline
            MilloMille
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • E Eeli K

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

              M Offline
              M Offline
              MilloMille
              wrote on last edited by
              #6

              @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

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Hi,

                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.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved