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. Read from .ini file with QSettings and real-time performance question
QtWS25 Last Chance

Read from .ini file with QSettings and real-time performance question

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.6k 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-qul
    wrote on last edited by
    #1

    Hello

    I have a question about real-time performance and use of QSettings class. I have parameters stored in an .ini file and want to access these with help of the QSettings class. What i wonder is how QSettings handles the data.
    See the following code:

    @QSettings* settings;
    settings = new QSettings(file, QSettings::IniFormat);@

    Does this mean that the file is parsed and stored in the objecs settings or does it only open the file?
    If it only opens the file, then I assume that it will be quite time consuming to read the data from the file every time I want to access it?

    Thank you for your input!
    /qul

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      I have never benchmarked QSettings, but I can tell you that in real life I've seen large apps with huge settings objects being created for every change in the program's preferences: and it's unnoticeable to the user. The thing is fast.

      I think that once you create the object, it's parsed. But you would have to check QSettings source code to be sure.

      (Z(:^

      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