Hi,
where do you close your database connection? You have to use the QSqlDatabase close() function. In your case: db.close(). Put this in the destructor of your "Manager" class and the problem should be solved.
regds
big4mil
Hi,
where do you close your database connection? You have to use the QSqlDatabase close() function. In your case: db.close(). Put this in the destructor of your "Manager" class and the problem should be solved.
regds
big4mil
Hi,
I give it on destructor. But the problem is that, the destructor is not working. How can i do that. I want to call the destructor when I close the Mainwindow. How can I do that?
Please help me....
your destructor is called automatically when your mainwindow object is destroyed. How and where do you create your mainwindow object and how does your destructor looks like? Please paste your code, so we can help you.
Hi,
Thankyou for your help.
I solve the problum by setting this attribute on the constructor of main window.
setAttribute(Qt::WA_DeleteOnClose);
After setting this, the destructor is working when I close the main window.
and your problem is fixed?
This is described in the documentation:
http://doc.trolltech.com/4.3/qsqldat...removeDatabase
yeah, but that's not needed in that case. The call of the database close function will do it.
Bookmarks