WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. | Zuble QML Types | Zuble C++ Classes | Zuble Overview |
Zuble
0.1
Zuble Framework C++/QML extension API
|
This class allows QSqlDatabase objects to be accessed directly from QML code. (database sprocket) More...
#include <ZblDatabase.h>
Public Slots | |
void | removeThreadDatabases () |
Removes all databases that belong to the current thread. More... | |
Public Member Functions | |
ZblDatabase (QObject *parent=0) | |
~ZblDatabase () | |
QString | getText () |
void | setText (const QString &text) |
Q_INVOKABLE QObject * | sqlAddDatabase (const QString &driverType, const QString &connectionName) |
Adds a SQL database to the list of database connections. If a connection of the same name exists it is replaced with a new connection. More... | |
Q_INVOKABLE QObject * | sqlGetDatabase (const QString &connectionName) |
Obtains a SQL database from the list of database connections. The named connection must have previously been created by a call to ZblApp::sqlAddDatabase(). More... | |
Q_INVOKABLE void | sqlRemoveDatabase (const QString &connectionName) |
Removes a SQL database from the list of database connections. More... | |
Q_INVOKABLE QStringList | sqlGetConnectionNames () |
Obtains the names of SQL database connections. More... | |
Q_INVOKABLE bool | sqlContainsConnection (const QString &connectionName) |
Determines if a named SQL database connection exists. More... | |
Q_INVOKABLE bool | sqlIsDriverAvailable (const QString &driverName) |
Determines if a named SQL database driver is available. More... | |
Static Public Member Functions | |
static void | registerType () |
Registers ZblDatabase as a QML type. More... | |
static QObject * | newObject (QObject *parent) |
Sprocket object constructor for creating ZblDatabase objects in javascript background threads. More... | |
Protected Attributes | |
ZBL_DECLARE_LOGGED_OBJECT QString | m_text |
Properties | |
QString | text |
This class allows QSqlDatabase objects to be accessed directly from QML code. (database sprocket)
Definition at line 17 of file ZblDatabase.h.
Zbl::ZblDatabase::ZblDatabase | ( | QObject * | parent = 0 | ) |
Definition at line 12 of file ZblDatabase.cpp.
Referenced by newObject().
Zbl::ZblDatabase::~ZblDatabase | ( | ) |
Definition at line 22 of file ZblDatabase.cpp.
QString Zbl::ZblDatabase::getText | ( | ) |
Definition at line 46 of file ZblDatabase.cpp.
|
static |
Sprocket object constructor for creating ZblDatabase objects in javascript background threads.
parent | set to parent QObject or NULL for ZblDatabase to have no parent. |
Definition at line 37 of file ZblDatabase.cpp.
Referenced by registerType().
|
static |
Registers ZblDatabase as a QML type.
Definition at line 27 of file ZblDatabase.cpp.
|
slot |
Removes all databases that belong to the current thread.
void Zbl::ZblDatabase::setText | ( | const QString & | text | ) |
Definition at line 51 of file ZblDatabase.cpp.
QObject * Zbl::ZblDatabase::sqlAddDatabase | ( | const QString & | driverType, |
const QString & | connectionName | ||
) |
Adds a SQL database to the list of database connections. If a connection of the same name exists it is replaced with a new connection.
driverType | a database driver type to use for the connection |
connectionName | a name for the connection |
Definition at line 57 of file ZblDatabase.cpp.
bool Zbl::ZblDatabase::sqlContainsConnection | ( | const QString & | connectionName | ) |
Determines if a named SQL database connection exists.
connectionName | name of the connection to test |
Definition at line 86 of file ZblDatabase.cpp.
QStringList Zbl::ZblDatabase::sqlGetConnectionNames | ( | ) |
Obtains the names of SQL database connections.
Definition at line 79 of file ZblDatabase.cpp.
QObject * Zbl::ZblDatabase::sqlGetDatabase | ( | const QString & | connectionName | ) |
Obtains a SQL database from the list of database connections. The named connection must have previously been created by a call to ZblApp::sqlAddDatabase().
driverType | a database driver type to use for the connection |
connectionName | a name for the connection |
Definition at line 72 of file ZblDatabase.cpp.
bool Zbl::ZblDatabase::sqlIsDriverAvailable | ( | const QString & | driverName | ) |
Determines if a named SQL database driver is available.
driverName | name of the driver to test |
Definition at line 93 of file ZblDatabase.cpp.
void Zbl::ZblDatabase::sqlRemoveDatabase | ( | const QString & | connectionName | ) |
Removes a SQL database from the list of database connections.
Warning: There should be no open queries on the database connection when this function is called, otherwise a resource leak will occur.
connectionName | name of the connection to remove |
Definition at line 65 of file ZblDatabase.cpp.
|
protected |
Definition at line 123 of file ZblDatabase.h.
|
readwrite |
Definition at line 34 of file ZblDatabase.h.
Referenced by setText().
Zuble documentation copyright © 2019 Bob Dinitto. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Zuble is a derivative work of Qt version 5. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.