13 QMetaType type,
const QString &tableName) :
21 return (nm == other.nm
22 && table == other.table
30 && autoval == other.autoval);
45QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QSqlFieldPrivate)
49
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
93
94
95
96
97
98
99
100
101
102
103
106
107
108
109
110
111
112
115
116
117
118
121
122
123
124
125
126
127QSqlField::QSqlField(
const QString &fieldName, QMetaType type,
const QString &table)
128 : val(QVariant(type,
nullptr)),
129 d(
new QSqlFieldPrivate(fieldName, type, table))
134
135
137QSqlField::QSqlField(
const QSqlField &other)
141
142
144QSqlField& QSqlField::operator=(
const QSqlField& other)
148
149
150
153
154
155
156bool QSqlField::operator==(
const QSqlField& other)
const
158 return ((d == other.d || *d == *other.d)
159 && val == other.val);
163
164
166QSqlField::~QSqlField()
170
171
172void QSqlField::setRequiredStatus(RequiredStatus required)
179
180
181
182
183
184
187
188
189void QSqlField::setLength(
int fieldLength)
192 d->len = fieldLength;
196
197
198void QSqlField::setPrecision(
int precision)
205
206
207
208
209
210
211
214
215
216void QSqlField::setDefaultValue(
const QVariant &value)
222#if QT_DEPRECATED_SINCE(6
, 8
)
224
225
226
227void QSqlField::setSqlType(
int type)
235
236
237void QSqlField::setGenerated(
bool gen)
245
246
247
248
249
250
251
252
253
254
255
256
257
260
261
262
263
265
266
267void QSqlField::setValue(
const QVariant& value)
275
276
277
279void QSqlField::clear()
283 val = QVariant(d->type,
nullptr);
288
289
290void QSqlField::setName(
const QString& name)
297
298
299void QSqlField::setReadOnly(
bool readOnly)
306
307
308
309
310
313
314
315QString QSqlField::name()
const
321
322
323
324
325
326
327
328
329
330
331
334
335
336QMetaType QSqlField::metaType()
const
342
343
344void QSqlField::setMetaType(QMetaType type)
349 val = QVariant(type,
nullptr);
353
354
355
356
357
358
359
360
361
362
363
366
367
368
369
370
371
372
375
376
377
378
379
380
381
384
385
386bool QSqlField::isReadOnly()
const
392
393
394
395
396
397bool QSqlField::isNull()
const
403
404void QSqlField::detach()
410
411
412
413
414
415
416
417
420
421
422QSqlField::RequiredStatus QSqlField::requiredStatus()
const
428
429
430
431
432
433
434
435
436
437
440
441
442int QSqlField::length()
const
448
449
450
451
452
453
454
455
456
458
459
460int QSqlField::precision()
const
466
467
468QVariant QSqlField::defaultValue()
const
473#if QT_DEPRECATED_SINCE(6
, 8
)
475
476
477
478
479
480
481
482
483int QSqlField::typeID()
const
490
491
492
493
494
495
496
499
500
501bool QSqlField::isGenerated()
const
507
508
509
510bool QSqlField::isValid()
const
512 return d->type.isValid();
515#ifndef QT_NO_DEBUG_STREAM
518 QDebugStateSaver saver(dbg);
520 dbg <<
"QSqlField(" << f.name() <<
", " << f.metaType().name();
521 dbg <<
", tableName: " << (f.tableName().isEmpty() ? QStringLiteral(
"(not specified)") : f.tableName());
523 dbg <<
", length: " << f.length();
524 if (f.precision() >= 0)
525 dbg <<
", precision: " << f.precision();
526 if (f.requiredStatus() != QSqlField::Unknown)
527 dbg <<
", required: "
528 << (f.requiredStatus() == QSqlField::Required ?
"yes" :
"no");
529 dbg <<
", generated: " << (f.isGenerated() ?
"yes" :
"no");
530 if (!f.defaultValue().isNull())
531 dbg <<
", defaultValue: \"" << f.defaultValue() <<
'\"';
532 dbg <<
", autoValue: " << f.isAutoValue()
533 <<
", readOnly: " << f.isReadOnly() <<
')';
539
540
541
542
543
544
545
546
547
548
549
550
553
554
555bool QSqlField::isAutoValue()
const
561
562
563void QSqlField::setAutoValue(
bool autoVal)
566 d->autoval = autoVal;
570
571
572void QSqlField::setTableName(
const QString &tableName)
575 d->table = tableName;
579
580
581
582
583
584
585
586
587
589
590
591QString QSqlField::tableName()
const
598#include "moc_qsqlfield.cpp"
bool operator==(const QSqlFieldPrivate &other) const
QSqlFieldPrivate(const QString &name, QMetaType type, const QString &tableName)
Combined button and popup list for selecting options.
QDebug operator<<(QDebug dbg, const QFileInfo &fi)