This is just a part of the program. I don't understand why doesn't it throws the error
Qt Code:
  1. 'mojabaza' was not declared in this scope
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow)
  4. {
  5. ui->setupUi(this);
  6.  
  7. mojabaza=QSqlDatabase::addDatabase("QSQLITE");
  8. mojabaza.setDatabaseName(pot);
  9. QFileInfo preveri (pot);
  10. if (preveri.isFile())
  11. {if (mojabaza.open()) ui->status->setText("[+]Povezava z bazo je uspela!");
  12. }
  13. else
  14. ui->status->setText("[!]Povezava z bazo NI uspela!");
  15. this->model1=new QSqlQueryModel();
  16.  
  17. }
  18.  
  19. MainWindow::~MainWindow()
  20. {
  21. delete ui;
  22. mojabaza.close(); ///?? should throw the error here
  23. }
To copy to clipboard, switch view to plain text mode