Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qsqlresult_p.h
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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QSQLRESULT_P_H
6
#
define
QSQLRESULT_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists for the convenience
13
// of qsql*model.h . This header file may change from version to version
14
// without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtSql
/
private
/
qtsqlglobal_p
.
h
>
20
#
include
<
QtCore
/
qpointer
.
h
>
21
#
include
<
QtCore
/
qhash
.
h
>
22
#
include
"qsqlerror.h"
23
#
include
"qsqlresult.h"
24
#
include
"qsqldriver.h"
25
26
QT_BEGIN_NAMESPACE
27
28
// convenience method Q*ResultPrivate::drv_d_func() returns pointer to private driver. Compare to Q_DECLARE_PRIVATE in qglobal.h.
29
#
define
Q_DECLARE_SQLDRIVER_PRIVATE
(
Class
)
30
inline
const
Class
##
Private
*
drv_d_func
(
)
const
{
return
!
sqldriver
?
nullptr
:
reinterpret_cast
<
const
Class
*
>
(
static_cast
<
const
QSqlDriver
*
>
(
sqldriver
)
)
->
d_func
(
)
;
}
31
inline
Class
##
Private
*
drv_d_func
(
)
{
return
!
sqldriver
?
nullptr
:
reinterpret_cast
<
Class
*
>
(
static_cast
<
QSqlDriver
*
>
(
sqldriver
)
)
->
d_func
(
)
;
}
32
33
struct
QHolder
{
34
QHolder
(
const
QString &hldr = QString(), qsizetype index = -1):
holderName
(
hldr
),
holderPos
(
index
) { }
35
bool
operator
==(
const
QHolder
&h)
const
{
return
h.holderPos == holderPos && h.holderName == holderName; }
36
bool
operator
!=(
const
QHolder
&h)
const
{
return
h.holderPos != holderPos || h.holderName != holderName; }
37
QString
holderName
;
38
qsizetype
holderPos
;
39
};
40
41
class
Q_SQL_EXPORT
QSqlResultPrivate
42
{
43
Q_DECLARE_PUBLIC(QSqlResult)
44
45
public
:
46
QSqlResultPrivate(QSqlResult *q,
const
QSqlDriver *drv)
47
: q_ptr(q),
48
sqldriver(
const_cast
<QSqlDriver *>(drv))
49
{ }
50
virtual
~QSqlResultPrivate() =
default
;
51
52
void
clearValues
()
53
{
54
values.clear();
55
bindCount = 0;
56
}
57
58
void
resetBindCount
()
59
{
60
bindCount = 0;
61
}
62
63
void
clearIndex
()
64
{
65
indexes.clear();
66
holders.clear();
67
types.clear();
68
}
69
70
void
clear
()
71
{
72
clearValues
(
)
;
73
clearIndex
(
)
;
74
}
75
76
virtual
QString
fieldSerial
(
qsizetype
)
const
;
77
QString
positionalToNamedBinding
(
const
QString &query)
const
;
78
QString
namedToPositionalBinding
(
const
QString &query);
79
QString
holderAt
(
int
index)
const
;
80
81
QSqlResult *
q_ptr
=
nullptr
;
82
QPointer
<
QSqlDriver
>
sqldriver
;
83
QString
sql
;
84
QSqlError
error
;
85
86
QString
executedQuery
;
87
QHash
<
int
,
QSql
::
ParamType
>
types
;
88
QList
<QVariant>
values
;
89
using
IndexMap = QHash<QString, QList<
int
>>;
90
IndexMap
indexes
;
91
92
using
QHolderVector
=
QList
<
QHolder
>;
93
QHolderVector
holders
;
94
95
QSqlResult
::
BindingSyntax
binds
= QSqlResult::PositionalBinding;
96
QSql
::
NumericalPrecisionPolicy
precisionPolicy
= QSql::LowPrecisionDouble;
97
int
idx
= QSql::BeforeFirstRow;
98
int
bindCount
= 0;
99
bool
active
=
false
;
100
bool
isSel
=
false
;
101
bool
forwardOnly
=
false
;
102
bool
positionalBindingEnabled
=
true
;
103
bool
qmarkNotationSupported
=
true
;
104
105
static
bool
isVariantNull
(
const
QVariant &variant);
106
};
107
108
QT_END_NAMESPACE
109
110
#
endif
// QSQLRESULT_P_H
QList
Definition
qlist.h:82
QObjectData::q_ptr
QObject * q_ptr
Definition
qobject.h:73
QPaintEngine::active
uint active
Definition
qpaintengine.h:202
QSqlResultPrivate
Definition
qsqlresult_p.h:42
QSqlResultPrivate::holderAt
QString holderAt(int index) const
Definition
qsqlresult.cpp:22
QSqlResultPrivate::QHolderVector
QList< QHolder > QHolderVector
Definition
qsqlresult_p.h:92
QSqlResultPrivate::qmarkNotationSupported
bool qmarkNotationSupported
Definition
qsqlresult_p.h:103
QSqlResultPrivate::namedToPositionalBinding
QString namedToPositionalBinding(const QString &query)
Definition
qsqlresult.cpp:82
QSqlResultPrivate::holders
QHolderVector holders
Definition
qsqlresult_p.h:93
QSqlResultPrivate::positionalToNamedBinding
QString positionalToNamedBinding(const QString &query) const
Definition
qsqlresult.cpp:39
QSqlResultPrivate::isVariantNull
static bool isVariantNull(const QVariant &variant)
Definition
qsqlresult.cpp:598
QSqlResultPrivate::isSel
bool isSel
Definition
qsqlresult_p.h:100
QSqlResultPrivate::idx
int idx
Definition
qsqlresult_p.h:97
QSqlResultPrivate::sqldriver
QPointer< QSqlDriver > sqldriver
Definition
qsqlresult_p.h:82
QSqlResultPrivate::bindCount
int bindCount
Definition
qsqlresult_p.h:98
QSqlResultPrivate::precisionPolicy
QSql::NumericalPrecisionPolicy precisionPolicy
Definition
qsqlresult_p.h:96
QSqlResultPrivate::positionalBindingEnabled
bool positionalBindingEnabled
Definition
qsqlresult_p.h:102
QSqlResultPrivate::binds
QSqlResult::BindingSyntax binds
Definition
qsqlresult_p.h:95
QSqlResultPrivate::clearValues
void clearValues()
Definition
qsqlresult_p.h:52
QSqlResultPrivate::fieldSerial
virtual QString fieldSerial(qsizetype) const
Definition
qsqlresult.cpp:27
QSqlResultPrivate::clearIndex
void clearIndex()
Definition
qsqlresult_p.h:63
QSqlResultPrivate::error
QSqlError error
Definition
qsqlresult_p.h:84
QSqlResultPrivate::values
QList< QVariant > values
Definition
qsqlresult_p.h:88
QSqlResultPrivate::sql
QString sql
Definition
qsqlresult_p.h:83
QSqlResultPrivate::indexes
IndexMap indexes
Definition
qsqlresult_p.h:90
QSqlResultPrivate::forwardOnly
bool forwardOnly
Definition
qsqlresult_p.h:101
QSqlResultPrivate::executedQuery
QString executedQuery
Definition
qsqlresult_p.h:86
QSqlResultPrivate::types
QHash< int, QSql::ParamType > types
Definition
qsqlresult_p.h:87
QSqlResult::clear
void clear()
Clears the entire result set and releases any associated resources.
Definition
qsqlresult.cpp:837
QSqlResult::resetBindCount
void resetBindCount()
Resets the number of bind parameters.
Definition
qsqlresult.cpp:860
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qIsAlnum
static bool qIsAlnum(QChar ch)
Definition
qsqlresult.cpp:32
QHolder
Definition
qsqlresult_p.h:33
QHolder::holderName
QString holderName
Definition
qsqlresult_p.h:37
QHolder::operator==
bool operator==(const QHolder &h) const
Definition
qsqlresult_p.h:35
QHolder::holderPos
qsizetype holderPos
Definition
qsqlresult_p.h:38
QHolder::QHolder
QHolder(const QString &hldr=QString(), qsizetype index=-1)
Definition
qsqlresult_p.h:34
QHolder::operator!=
bool operator!=(const QHolder &h) const
Definition
qsqlresult_p.h:36
qtbase
src
sql
kernel
qsqlresult_p.h
Generated on
for Qt by
1.18.0