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. What is class for saving prefernces in Qt apart fromQSettings
Forum Update on Monday, May 27th 2025

What is class for saving prefernces in Qt apart fromQSettings

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 5 Posters 1.2k 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by
    #1

    What is class for saving preferences in Qt apart from QSettings.i.e I could not find any class called Qpref

    joeQJ aha_1980A J.HilkJ 3 Replies Last reply
    0
    • Q Qt Enthusiast

      What is class for saving preferences in Qt apart from QSettings.i.e I could not find any class called Qpref

      joeQJ Offline
      joeQJ Offline
      joeQ
      wrote on last edited by
      #2

      @Qt-Enthusiast Hi, friend. Welcome.

      Just use QSettings is Ok. if you want to store these value of setting from QSetting in member. you could create one class or data struct. It is Ok.

      Just do it!

      1 Reply Last reply
      2
      • Q Qt Enthusiast

        What is class for saving preferences in Qt apart from QSettings.i.e I could not find any class called Qpref

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Qt-Enthusiast What exactly is missing from QSettings for you?

        Qt has to stay free or it will die.

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          Qt Enthusiast
          wrote on last edited by
          #4

          I am looking for a class in Qt where I can save and restore the preferences of GUI like window sizes and windows layout once I exit the tool and restart the tool

          dream_captainD 1 Reply Last reply
          0
          • Q Qt Enthusiast

            What is class for saving preferences in Qt apart from QSettings.i.e I could not find any class called Qpref

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #5

            @Qt-Enthusiast do you try to use QSettings with IOS or Android? QSettings is designed for Lunix, MacOS and Windows.
            For Mobile devices you'll have to do some manual, As in set it to save as file, and specify a path that you app is allowed to use.

            Other than that, it should work fine.


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            1 Reply Last reply
            1
            • Q Offline
              Q Offline
              Qt Enthusiast
              wrote on last edited by
              #6

              is there any class called QPreferences or Qpref

              1 Reply Last reply
              0
              • Q Qt Enthusiast

                I am looking for a class in Qt where I can save and restore the preferences of GUI like window sizes and windows layout once I exit the tool and restart the tool

                dream_captainD Offline
                dream_captainD Offline
                dream_captain
                wrote on last edited by dream_captain
                #7

                @Qt-Enthusiast
                It's perfectly fine to use QSettings to save window geometry.
                Look at QWidget::saveGeometry() and QMainWindow::saveState()

                 void MyWidget::closeEvent(QCloseEvent *event)
                  {
                      QSettings settings("MyCompany", "MyApp");
                      settings.setValue("geometry", saveGeometry());
                      QWidget::closeEvent(event);
                  }
                
                1 Reply Last reply
                4

                • Login

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