This commit is contained in:
blackdal 2017-05-29 19:59:39 +04:30
parent d780bf234a
commit 0d8bd9b96b
3 changed files with 5 additions and 2 deletions

View File

@ -328,6 +328,10 @@ Database::Database(const Database &other, QObject *parent)
Database::~Database()
{
Q_D(Database);
if (d->db.isOpen())
d->db.close();
if (d_ptr)
delete d_ptr;
}

View File

@ -46,7 +46,6 @@ TableModel *DatabaseModel::model(QString tableName) const
qWarning("Table with name '%s' not found in model",
qUtf8Printable(tableName));
Q_UNREACHABLE();
return 0;
}

View File

@ -155,7 +155,7 @@ TableModel::TableModel(int typeId, QString tableName)
_typeId = typeId;
_name = tableName;
_className = tableMetaObject->className();
qDebug() << "my name is" << _className;
//#ifdef NUT_NAMESPACE
// if(_className.startsWith(QT_STRINGIFY(NUT_NAMESPACE) "::"))
// _className = _className.replace(QT_STRINGIFY(NUT_NAMESPACE) "::", "");