Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. #include <QSettings>
  4. #include <QDebug>
  5.  
  6. MainWindow::MainWindow(QWidget *parent) :
  7. QMainWindow(parent),
  8. ui(new Ui::MainWindow)
  9. {
  10. ui->setupUi(this);
  11. QSettings * qsettings = new QSettings(":/config.ini",QSettings::IniFormat);
  12. bool status = qsettings->value("preview","").toBool();
  13. qDebug() << status;
  14.  
  15. }
  16.  
  17. MainWindow::~MainWindow()
  18. {
  19. delete ui;
  20. }
To copy to clipboard, switch view to plain text mode 

Once i could do it but now i don't know whats wrong. When i googled this problem i just saw that this impossible but i enshure that i did it before.