Qsettings different results

I am using QSettings to try to figure out if INI is valid. (using status check ()) I made a targeted invalid INI file and downloaded it. The first time the code is called, it returns invalid, but each time after that, it returns to action. Is this a bug in my code?

+3
source share
2 answers

This is a Qt error caused by some global state. Note that the difference in results occurs regardless of whether you call deletewhat you need on your QSettings object. Here is a brief description of what happens when you first start it:

  • The result code is set to NoError.
  • , , .
  • , qsettings.cpp line 1530 (Qt-4.6.2)
  • (. qsettings.cpp 1552).
  • .

:

  • NoError.
  • , .
  • , , (. qsettings.cpp 1424).
  • , NoError - , .
+1

, - .

, QSettings::QSettings(fileName, format) c'tor ini . QConfFile::fromName ( qsettings.cpp). ( ), , (.. ). , .

0

Source: https://habr.com/ru/post/1733411/


All Articles