tooltip for playlist model
[jkt-jerboa.git] / include / SqlQuery.h
blob7857acbae96d50d5ad567670b2a5e3c178629a49
1 /* LICENSE NOTICE
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>
21 #include <QSqlQuery>
23 namespace Jerboa
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
32 * features.
34 class SqlQuery : public QSqlQuery
36 public:
37 /// Contruct an SqlQuery on the default database.
38 SqlQuery();
39 /// Construct an SQL query on a specified database.
40 SqlQuery(QSqlDatabase db);
41 /// Execute the current query.
42 bool exec();
43 /// Execute the specified query.
44 bool exec(const QString& query);
45 private:
46 void printError();
50 #endif