This is just a part of the program. I don't understand why doesn't it throws the error
'mojabaza' was not declared in this scope
'mojabaza' was not declared in this scope
To copy to clipboard, switch view to plain text mode
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
mojabaza.setDatabaseName(pot);
if (preveri.isFile())
{if (mojabaza.open()) ui->status->setText("[+]Povezava z bazo je uspela!");
}
else
ui->status->setText("[!]Povezava z bazo NI uspela!");
}
MainWindow::~MainWindow()
{
delete ui;
mojabaza.close(); ///?? should throw the error here
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
mojabaza=QSqlDatabase::addDatabase("QSQLITE");
mojabaza.setDatabaseName(pot);
QFileInfo preveri (pot);
if (preveri.isFile())
{if (mojabaza.open()) ui->status->setText("[+]Povezava z bazo je uspela!");
}
else
ui->status->setText("[!]Povezava z bazo NI uspela!");
this->model1=new QSqlQueryModel();
}
MainWindow::~MainWindow()
{
delete ui;
mojabaza.close(); ///?? should throw the error here
}
To copy to clipboard, switch view to plain text mode
Bookmarks