Important: Please read the Qt Code of Conduct -

QSettings: maximum value size?

  • Hi

    What's the maximum size of data I could expect to store in a QSettings key/value pair? Is it capped, or does it just depend on device storage space?


  • What exactly do you mean by maximum size of data?

    Amount of data in the value?
    Afaik there is no limit, but that might depend, where you store it.
    Default on window sis the registry, that might have some limits. If you store in a file (default on Linux) I think there should be no limits.

  • I think there are limits for the windows registry, actually.

  • If you force QSettings to use the ini file backend then you should be able to store anything that you can fit into a QVariant and have disk/memory space for.

    How practical this is in reality I am not sure. If you have a lot of data it might be better to store the data in a separate file that you can read/write incrementally and then store the filename for that using QSettings. That would give you greater control on how and when the bulky data is read/written.

Log in to reply