Important: Please read the Qt Code of Conduct -

QSettings not save settings

  • I am using QSettings to save connection parameters with a database. The parameters are informed through a QDialog. The [SAVE] button calls the saveParameters Slote.

    void Connecdialog::saveParameters() /Slot to save parameters in disc/

    /get parameters in QLineEdits/

    QSettings connecsettings( QSettings::IniFormat, QSettings::SystemScope, "Freedom", "TecTracker");

    connecsettings.setValue("dbname", connecdial->findChild<QLineEdit *>("qle_dbname")->text());
    connecsettings.setValue("host", connecdial->findChild<QLineEdit *>("qle_host")->text());
    connecsettings.setValue("user", connecdial->findChild<QLineEdit *>("qle_user")->text());
    connecsettings.setValue("password", connecdial->findChild<QLineEdit *>("qle_password")->text());
    connecsettings.setValue("port", connecdial->findChild<QSpinBox *>("qsb_port")->text());


    In saveParameters are collected existing data on lineEdits and passed to the QSettings object but the data is not being written to disk.

  • Sorry,

    Permission problem

Log in to reply