14 QMetaType type,
const QString &tableName) :
22 return (nm == other.nm
23 && table == other.table
31 && autoval == other.autoval);
46QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QSqlFieldPrivate)
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
94
95
96
97
98
99
100
101
102
103
104
107
108
109
110
111
112
113
116
117
118
119
122
123
124
125
126
127
128QSqlField::QSqlField(
const QString &fieldName, QMetaType type,
const QString &table)
129 : val(QVariant(type,
nullptr)),
130 d(
new QSqlFieldPrivate(fieldName, type, table))
135
136
138QSqlField::QSqlField(
const QSqlField &other)
142
143
145QSqlField& QSqlField::operator=(
const QSqlField& other)
149
150
151
154
155
156
157bool QSqlField::operator==(
const QSqlField& other)
const
159 return ((d == other.d || *d == *other.d)
160 && val == other.val);
164
165
167QSqlField::~QSqlField()
171
172
173void QSqlField::setRequiredStatus(RequiredStatus required)
180
181
182
183
184
185
188
189
190void QSqlField::setLength(
int fieldLength)
193 d->len = fieldLength;
197
198
199void QSqlField::setPrecision(
int precision)
206
207
208
209
210
211
212
215
216
217void QSqlField::setDefaultValue(
const QVariant &value)
223#if QT_DEPRECATED_SINCE(6
, 8
)
225
226
227
228void QSqlField::setSqlType(
int type)
236
237
238void QSqlField::setGenerated(
bool gen)
246
247
248
249
250
251
252
253
254
255
256
257
258
261
262
263
264
266
267
268void QSqlField::setValue(
const QVariant& value)
276
277
278
280void QSqlField::clear()
284 val = QVariant(d->type,
nullptr);
289
290
291void QSqlField::setName(
const QString& name)
298
299
300void QSqlField::setReadOnly(
bool readOnly)
307
308
309
310
311
314
315
316QString QSqlField::name()
const
322
323
324
325
326
327
328
329
330
331
332
335
336
337QMetaType QSqlField::metaType()
const
343
344
345void QSqlField::setMetaType(QMetaType type)
350 val = QVariant(type,
nullptr);
354
355
356
357
358
359
360
361
362
363
364
367
368
369
370
371
372
373
376
377
378
379
380
381
382
385
386
387bool QSqlField::isReadOnly()
const
393
394
395
396
397
398bool QSqlField::isNull()
const
404
405void QSqlField::detach()
411
412
413
414
415
416
417
418
421
422
423QSqlField::RequiredStatus QSqlField::requiredStatus()
const
429
430
431
432
433
434
435
436
437
438
441
442
443int QSqlField::length()
const
449
450
451
452
453
454
455
456
457
459
460
461int QSqlField::precision()
const
467
468
469QVariant QSqlField::defaultValue()
const
474#if QT_DEPRECATED_SINCE(6
, 8
)
476
477
478
479
480
481
482
483
484int QSqlField::typeID()
const
491
492
493
494
495
496
497
500
501
502bool QSqlField::isGenerated()
const
508
509
510
511bool QSqlField::isValid()
const
513 return d->type.isValid();
516#ifndef QT_NO_DEBUG_STREAM
519 QDebugStateSaver saver(dbg);
521 dbg <<
"QSqlField(" << f.name() <<
", " << f.metaType().name();
522 dbg <<
", tableName: " << (f.tableName().isEmpty() ? QStringLiteral(
"(not specified)") : f.tableName());
524 dbg <<
", length: " << f.length();
525 if (f.precision() >= 0)
526 dbg <<
", precision: " << f.precision();
527 if (f.requiredStatus() != QSqlField::Unknown)
528 dbg <<
", required: "
529 << (f.requiredStatus() == QSqlField::Required ?
"yes" :
"no");
530 dbg <<
", generated: " << (f.isGenerated() ?
"yes" :
"no");
531 if (!f.defaultValue().isNull())
532 dbg <<
", defaultValue: \"" << f.defaultValue() <<
'\"';
533 dbg <<
", autoValue: " << f.isAutoValue()
534 <<
", readOnly: " << f.isReadOnly() <<
')';
540
541
542
543
544
545
546
547
548
549
550
551
554
555
556bool QSqlField::isAutoValue()
const
562
563
564void QSqlField::setAutoValue(
bool autoVal)
567 d->autoval = autoVal;
571
572
573void QSqlField::setTableName(
const QString &tableName)
576 d->table = tableName;
580
581
582
583
584
585
586
587
588
590
591
592QString QSqlField::tableName()
const
599#include "moc_qsqlfield.cpp"
bool operator==(const QSqlFieldPrivate &other) const
QSqlFieldPrivate(const QString &name, QMetaType type, const QString &tableName)
QDebug operator<<(QDebug dbg, const QFileInfo &fi)