Ok I can make it populate the Ini file now... with this:
void Porcupine::saveSettings()
{
settings.beginGroup("MainWindow");
settings.setValue("size", size());
settings.setValue("pos", pos());
settings.endGroup();
settings.beginGroup("network");
for(int index = 0; index < ui.ipaddressComboBox->count();index++)
ipAddressList.append(ui.ipaddressComboBox->itemText(index));
settings.setValue("ipaddressComboBox", ipAddressList);
settings.setValue("filename", fileNameList);
settings.endGroup();
ui.statusLogs->append(tr("Settings Saved"));
}
void Porcupine::saveSettings()
{
QSettings settings(QSettings::IniFormat, QSettings::UserScope,"Codematic", "Porcupine");
QStringList ipAddressList;
QStringList fileNameList;
settings.beginGroup("MainWindow");
settings.setValue("size", size());
settings.setValue("pos", pos());
settings.endGroup();
settings.beginGroup("network");
for(int index = 0; index < ui.ipaddressComboBox->count();index++)
ipAddressList.append(ui.ipaddressComboBox->itemText(index));
settings.setValue("ipaddressComboBox", ipAddressList);
settings.setValue("filename", fileNameList);
settings.endGroup();
ui.statusLogs->append(tr("Settings Saved"));
}
To copy to clipboard, switch view to plain text mode
I get this in the INI, which is good (i think)
[MainWindow]
pos=@Point(107 71)
size=@Size(785 480)
[network]
filename=@Invalid()
ipaddressComboBox=1.1.1.1, 2.2.2.2, 3.3.3.3
[MainWindow]
pos=@Point(107 71)
size=@Size(785 480)
[network]
filename=@Invalid()
ipaddressComboBox=1.1.1.1, 2.2.2.2, 3.3.3.3
To copy to clipboard, switch view to plain text mode
Now working getting it to read and populate the combo box...
Bookmarks