Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Is there any proper way to save string without using file ?
Qt 6.11 is out! See what's new in the release blog

Is there any proper way to save string without using file ?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 375 Views
  • 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.
  • O Offline
    O Offline
    ozie
    wrote on last edited by
    #1

    Hi all,
    I want to save line edit value when it changes, and i want load from last value again when application start. I can achieve that creating a file. Is there another way to do this properly ?

    Thanks for any idea.

    Christian EhrlicherC JonBJ 2 Replies Last reply
    0
    • O ozie

      Hi all,
      I want to save line edit value when it changes, and i want load from last value again when application start. I can achieve that creating a file. Is there another way to do this properly ?

      Thanks for any idea.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #3

      @ozie
      Use QSettings for this as @Christian-Ehrlicher mentions. Depending on platform that will save in either a physical file or the Registry under Windows. Either way you don't have to worry about it, QSettings takes care of it for you.

      1 Reply Last reply
      1
      • O ozie

        Hi all,
        I want to save line edit value when it changes, and i want load from last value again when application start. I can achieve that creating a file. Is there another way to do this properly ?

        Thanks for any idea.

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @ozie said in Is there any proper way to save string without using file ?:

        . Is there another way to do this properly ?

        If you want to save it in a file, no.
        Maybe QSettings - but even then it's saved in a file on the disk (how should something made persistent otherwise?)

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        2
        • O ozie

          Hi all,
          I want to save line edit value when it changes, and i want load from last value again when application start. I can achieve that creating a file. Is there another way to do this properly ?

          Thanks for any idea.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #3

          @ozie
          Use QSettings for this as @Christian-Ehrlicher mentions. Depending on platform that will save in either a physical file or the Registry under Windows. Either way you don't have to worry about it, QSettings takes care of it for you.

          1 Reply Last reply
          1
          • O Offline
            O Offline
            ozie
            wrote on last edited by
            #4

            Thanks for replies

            1 Reply Last reply
            0
            • O Offline
              O Offline
              ozie
              wrote on last edited by
              #5

              I faced another problem , if i run application on qt there is no problem but if i create an exe using windeployqt it is not work, Should i add extra things ?

              JonBJ 1 Reply Last reply
              0
              • O ozie

                I faced another problem , if i run application on qt there is no problem but if i create an exe using windeployqt it is not work, Should i add extra things ?

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #6

                @ozie
                Yes, you must ensure you distribute/deploy all the right things with windeployqt, and you must have something wrong. Start with whatever the error message says.

                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