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. QSettings - how to clear the error?
Forum Updated to NodeBB v4.3 + New Features

QSettings - how to clear the error?

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 3.5k 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.
  • K Offline
    K Offline
    kartlee
    wrote on last edited by
    #1

    Hi,

    After I call sync(), I get AccessError when I checked the status. Then I fix the permission through program and call sync() again. This synced the settings but the error is not cleared. Is there any way I can forcefully clear it before calling second sync()?

    -Karthik

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kartlee
      wrote on last edited by
      #2

      Is there a way to access setStatus(..) of QSettingPrivate by subclassing?

      -Karthik

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kartlee
        wrote on last edited by
        #3

        From Qsettings.cpp of -

        "
        /*
        We only set an error if there isn't one set already. This way the user always gets the
        first error that occurred. We always allow clearing errors.
        */
        void QSettingsPrivate::setStatus(QSettings::Status status) const
        "/

        So there should be a public function in QSettings.cpp to clear the errors. Is there any reason why it was skipped?

        Is there anyway to access the private date of QSettings and clear the error?

        -Karthik

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          It looks like QSettings doesn't reset the status (which might be a good thing or a bad thing, depends), but there should be a way to reset it on demand (your use case is a perfect one).

          Do you mind filing a bug report / feature request?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            I completely agree with Lukas Geyer's perfect answer.
            Only one thing in addition, it would be good to public a link to your bug report here. This allows people voting for your request and may increase its priority.

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kartlee
              wrote on last edited by
              #6

              Hi,

              Thanks for your comments. I will file an enhancement request. Can you please give instructions how to file with Qt since this is my first report with them?

              BTW, is there a way to access the private member ( inside qsettings_p ) and get access to setStatus function? I tried subclassing QSettings and QSettingPrivate but that won't work.

              -Karthik

              1 Reply Last reply
              0
              • L Offline
                L Offline
                lgeyer
                wrote on last edited by
                #7

                [quote author="kartlee" date="1326236201"]Hi,
                Thanks for your comments. I will file an enhancement request. Can you please give instructions how to file with Qt since this is my first report with them?[/quote]
                Just follow "this":http://labs.qt.nokia.com/2010/03/02/how-to-file-a-qt-bug-report-in-the-new-bug-tracker/ link.

                [quote author="kartlee" date="1326236201"]BTW, is there a way to access the private member ( inside qsettings_p ) and get access to setStatus function? I tried subclassing QSettings and QSettingPrivate but that won't work.[/quote]

                Theoretically yes, practically no.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kartlee
                  wrote on last edited by
                  #8

                  [quote author="Lukas Geyer" date="1326190237"]It looks like QSettings doesn't reset the status (which might be a good thing or a bad thing, depends), but there should be a way to reset it on demand (your use case is a perfect one).

                  Do you mind filing a bug report / feature request?[/quote]

                  https://bugreports.qt.nokia.com/browse/QTBUG-23857

                  -Karthik

                  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