C++ (Qt)void MainWindow::readSettings(){ QSettings settings("/nastr.ini",QSettings::IniFormat); settings.beginGroup("MainWindow"); settings.value("font").toString(); settings.endGroup();} void MainWindow::writeSettings(){ QSettings settings("/nastr.ini",QSettings::IniFormat); settings.beginGroup("MainWindow"); settings.setValue("font", font()); settings.endGroup();}
C++ (Qt)QSettings settings(QCoreApplication::applicationDirPath() + QDir::separator() + "settings.ini", QSettings::IniFormat);
C++ (Qt)void MainWindow::readSettings(){ ... restoreGeometry(settings.value("geometry").toByteArray()); ...} void MainWindow::writeSettings(){ ... settings.setValue("geometry", saveGeometry()); ...}
C++ (Qt)QFont f = qvariant_cast<QFont>(settings.value("font"));
C++ (Qt)void MainWindow::readSettings(){ QSettings settings(QCoreApplication::applicationDirPath() + QDir::separator() + "nastr.ini", QSettings::IniFormat); settings.beginGroup("MainWindow"); QFont f = qvariant_cast<QFont>(settings.value("font")); settings.endGroup();} void MainWindow::writeSettings(){ QSettings settings(QCoreApplication::applicationDirPath() + QDir::separator() + "nastr.ini", QSettings::IniFormat); settings.beginGroup("MainWindow"); settings.setValue("font", setFont()); settings.setValue("geometry", saveGeometry()); settings.endGroup();}
C++ (Qt)settings.setValue("font", setFont());
C++ (Qt) ошибка: no matching function for call to 'MainWindow::setFont()'