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. QSetting does not work in Windows.
Qt 6.11 is out! See what's new in the release blog

QSetting does not work in Windows.

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

    In Linux Qt 5.4, QSetting works fine if splitter_5 saveGeometry & saveStor is terminated or restarted.

    However, in Windows 8.1 Qt 5.4 it is the same source, but it does not work.

    This is true even if Regedit is deleted from the Window. Is there a workaround? Thank you.

    0_1551929859750_1.png

    beeckscheB cfdevC 2 Replies Last reply
    0
    • P Pada_

      In Linux Qt 5.4, QSetting works fine if splitter_5 saveGeometry & saveStor is terminated or restarted.

      However, in Windows 8.1 Qt 5.4 it is the same source, but it does not work.

      This is true even if Regedit is deleted from the Window. Is there a workaround? Thank you.

      0_1551929859750_1.png

      beeckscheB Offline
      beeckscheB Offline
      beecksche
      wrote on last edited by
      #2

      @Pada_

      How is the relation between QSplitter and QSettings in your case? If you need help, you need to provide the relevant code snippet. Or give us some more information.

      But in general:
      Depending on the OS and the set Format QSettingswill store the setting differently. Read the docs for QSettings and I think your problems should be solved.

      jsulmJ 1 Reply Last reply
      2
      • beeckscheB beecksche

        @Pada_

        How is the relation between QSplitter and QSettings in your case? If you need help, you need to provide the relevant code snippet. Or give us some more information.

        But in general:
        Depending on the OS and the set Format QSettingswill store the setting differently. Read the docs for QSettings and I think your problems should be solved.

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @beecksche I think what he means is that he stores the geometry of the widgets using saveGeometry (https://doc.qt.io/qt-5/qwidget.html#saveGeometry) and restores it later.

        @Pada_ Did you check whether the geometry was stored correctly?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        2
        • P Pada_

          In Linux Qt 5.4, QSetting works fine if splitter_5 saveGeometry & saveStor is terminated or restarted.

          However, in Windows 8.1 Qt 5.4 it is the same source, but it does not work.

          This is true even if Regedit is deleted from the Window. Is there a workaround? Thank you.

          0_1551929859750_1.png

          cfdevC Offline
          cfdevC Offline
          cfdev
          wrote on last edited by
          #4

          @Pada_ How to use QSetting ?

          This, works everyWhere with m_splitter->saveState() :

          void Settings::setSplit_dlg(const QByteArray &sizes) {
          	m_settings -> beginGroup("splitters");
          	m_settings -> setValue("dlg_invoice", sizes );
          	m_settings -> endGroup();
          }
          
          1 Reply Last reply
          2

          • Login

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