SQLSELECT id, name FROM dir d
QSqlQuery q(db); q.exec("select id, name from dir d"); q.next(); QUuid uid=q.value(0).value<QUuid>();
QUuid id; QSqlQuery q(db); db.transaction(); q.prepare("select dscr from dir where id=?"); q.bindValue(0,QVariant::fromValue(id));
#define VUUID(variant) variant.value<QUuid>()
QUuid uid=VUUID(q.value(0));
QUuid uid=q.value(0).value<QUuid>();
CHAR_TO_UUIDFunction: Converts the CHAR(32) ASCII representation of an UUID (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) to the CHAR(16) OCTETS representation (optimized for storage).Format: CHAR_TO_UUID( <string> )Example: select char_to_uuid('93519227-8D50-4E47-81AA-8F6678C096A1') from rdb$database;
#include <qsqldriverplugin.h>#include <qstringlist.h>#include "qsql_ibpp.h"#include <QDebug>class QFBDriverPlugin : public QSqlDriverPlugin{ Q_PLUGIN_METADATA( IID "org.qt-project.Qt.QSqlDriverFactoryInterface" )public: QFBDriverPlugin(); QSqlDriver* create(const QString &); QStringList keys() const;};QFBDriverPlugin::QFBDriverPlugin() : QSqlDriverPlugin(){ qDebug() << "111";}QSqlDriver* QFBDriverPlugin::create(const QString &name){ qDebug() << "222"; if (name == QLatin1String("QFIREBIRD")) { QFBDriver* driver = new QFBDriver(); return driver; } return 0;}QStringList QFBDriverPlugin::keys() const{ qDebug() << "333"; QStringList l; l << QLatin1String("QFIREBIRD"); return l;}