Qt 4.8
Functions
qdeclarativesqldatabase_p.h File Reference
#include <QtScript/qscriptengine.h>
#include <QtCore/qglobal.h>

Go to the source code of this file.

Functions

void qt_add_qmlsqldatabase (QScriptEngine *engine)
 

Function Documentation

◆ qt_add_qmlsqldatabase()

void qt_add_qmlsqldatabase ( QScriptEngine engine)

Definition at line 429 of file qdeclarativesqldatabase.cpp.

Referenced by QDeclarativeScriptEngine::QDeclarativeScriptEngine().

430 {
431  QScriptValue openDatabase = engine->newFunction(qmlsqldatabase_open_sync, 4);
432  engine->globalObject().setProperty(QLatin1String("openDatabaseSync"), openDatabase);
433 
434  QScriptValue sqlExceptionPrototype = engine->newObject();
435  for (int i=0; sqlerror[i]; ++i)
436  sqlExceptionPrototype.setProperty(QLatin1String(sqlerror[i]),
438 
439  engine->globalObject().setProperty(QLatin1String("SQLException"), sqlExceptionPrototype);
440 }
QScriptValue newFunction(FunctionSignature signature, int length=0)
Creates a QScriptValue that wraps a native (C++) function.
static QScriptValue qmlsqldatabase_open_sync(QScriptContext *context, QScriptEngine *engine)
QScriptValue globalObject() const
Returns this engine&#39;s Global Object.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QScriptValue newObject()
Creates a QtScript object of class Object.
void setProperty(const QString &name, const QScriptValue &value, const PropertyFlags &flags=KeepExistingFlags)
Sets the value of this QScriptValue&#39;s property with the given name to the given value.
The QScriptValue class acts as a container for the Qt Script data types.
Definition: qscriptvalue.h:57
static const char * sqlerror[]