Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qv4sqlerrors.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qv4sqlerrors_p.h"
5#include "private/qv4engine_p.h"
6#include "private/qv4object_p.h"
7
9
10using namespace QV4;
11
13{
14 Scope scope(engine);
15 ScopedObject sqlexception(scope, engine->newObject());
16 sqlexception->defineReadonlyProperty(QStringLiteral("UNKNOWN_ERR"), Value::fromInt32(SQLEXCEPTION_UNKNOWN_ERR));
17 sqlexception->defineReadonlyProperty(QStringLiteral("DATABASE_ERR"), Value::fromInt32(SQLEXCEPTION_DATABASE_ERR));
18 sqlexception->defineReadonlyProperty(QStringLiteral("VERSION_ERR"), Value::fromInt32(SQLEXCEPTION_VERSION_ERR));
19 sqlexception->defineReadonlyProperty(QStringLiteral("TOO_LARGE_ERR"), Value::fromInt32(SQLEXCEPTION_TOO_LARGE_ERR));
20 sqlexception->defineReadonlyProperty(QStringLiteral("QUOTA_ERR"), Value::fromInt32(SQLEXCEPTION_QUOTA_ERR));
21 sqlexception->defineReadonlyProperty(QStringLiteral("SYNTAX_ERR"), Value::fromInt32(SQLEXCEPTION_SYNTAX_ERR));
22 sqlexception->defineReadonlyProperty(QStringLiteral("CONSTRAINT_ERR"), Value::fromInt32(SQLEXCEPTION_CONSTRAINT_ERR));
23 sqlexception->defineReadonlyProperty(QStringLiteral("TIMEOUT_ERR"), Value::fromInt32(SQLEXCEPTION_TIMEOUT_ERR));
24 engine->globalObject->defineDefaultProperty(QStringLiteral("SQLException"), sqlexception);
25}
26
QJSValue globalObject() const
Returns this engine's Global Object.
QJSValue newObject()
Creates a JavaScript object of class Object.
Combined button and popup list for selecting options.
#define QStringLiteral(str)
void qt_add_sqlexceptions(QV4::ExecutionEngine *engine)
#define SQLEXCEPTION_TIMEOUT_ERR
#define SQLEXCEPTION_UNKNOWN_ERR
#define SQLEXCEPTION_DATABASE_ERR
#define SQLEXCEPTION_QUOTA_ERR
#define SQLEXCEPTION_VERSION_ERR
#define SQLEXCEPTION_SYNTAX_ERR
#define SQLEXCEPTION_TOO_LARGE_ERR
#define SQLEXCEPTION_CONSTRAINT_ERR
QJSEngine engine
[0]
static constexpr Value fromInt32(int i)
Definition qv4value_p.h:187