2 This file is part of Jerboa.
4 Jerboa is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option), version 3 of the license.
9 Jerboa is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with Jerboa. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef _JERBOA_SQLQUERY_H
18 #define _JERBOA_SQLQUERY_H
20 #include <QSqlDatabase>
25 /** A subclass of QSqlQuery with added debugging features.
26 * When one of the \ref exec members is called, if an error
27 * occurs, information is printed to the debug stream.
29 * On non-Windows platforms, a backtrace is also printed.
31 * This class may later gain some automatic error-recovery
34 class SqlQuery
: public QSqlQuery
37 /// Contruct an SqlQuery on the default database.
39 /// Construct an SQL query on a specified database.
40 SqlQuery(QSqlDatabase db
);
41 /// Execute the current query.
43 /// Execute the specified query.
44 bool exec(const QString
& query
);