From d5ef41dc62d94ee9963bfa714bf5ea346997723d Mon Sep 17 00:00:00 2001 From: tianduanrui <2407223896@qq.com> Date: Sat, 6 Jan 2018 16:20:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=9A=84=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sql/qqtsql.cpp | 6 ++++++ src/sql/qqtsql.h | 3 ++- src/widgets/qqtmptablewidget.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sql/qqtsql.cpp b/src/sql/qqtsql.cpp index e8876d12..b6d1a540 100644 --- a/src/sql/qqtsql.cpp +++ b/src/sql/qqtsql.cpp @@ -54,3 +54,9 @@ void deleteDatabaseConn(QString connectionName) { QSqlDatabase::removeDatabase(connectionName); } + +void deleteDatabaseConn(QSqlDatabase &db) +{ + QString connectionName = db.connectionName(); + deleteDatabaseConn(connectionName); +} diff --git a/src/sql/qqtsql.h b/src/sql/qqtsql.h index 72278e1f..50906a1e 100644 --- a/src/sql/qqtsql.h +++ b/src/sql/qqtsql.h @@ -21,7 +21,7 @@ extern "C" { #endif /* __cplusplus */ #define DB_TYPE "QSQLITE" -#define DB_PATH "./db/" +#define DB_PATH "./db" #ifdef __cplusplus } @@ -38,5 +38,6 @@ QQTSHARED_EXPORT void openDatabase(QSqlDatabase& db); QQTSHARED_EXPORT void closeDatabase(QSqlDatabase& db); QQTSHARED_EXPORT void deleteDatabaseConn(QString connectionName); +QQTSHARED_EXPORT void deleteDatabaseConn(QSqlDatabase& db); #endif // QQTSQLDEFINE_H diff --git a/src/widgets/qqtmptablewidget.h b/src/widgets/qqtmptablewidget.h index 5e809c3b..0c563fe1 100644 --- a/src/widgets/qqtmptablewidget.h +++ b/src/widgets/qqtmptablewidget.h @@ -42,6 +42,7 @@ public: QQtTableWidget* selectedRows ( int column = 0 ); int pageNum(); int currentPage(); + //1-pagenum void setCurrentPage ( int page ); public slots: