Obsolete Members for QSqlField

QSqlField 的以下成员已被弃用。提供这些成员是为了保持旧源代码的正常运行。我们强烈建议不要在新代码中使用它们。

公共函数

(deprecated in 6.0) QSqlField(const QString &fieldName, QVariant::Type type, const QString &table = QString())
(deprecated in 6.0) void setType(QVariant::Type type)
(deprecated in 6.0) QVariant::Type type() const

成员函数文档

[deprecated in 6.0] QSqlField::QSqlField(const QString &fieldName, QVariant::Type type, const QString &table = QString())

自 6.0 版起,该函数已被弃用。我们强烈建议不要在新代码中使用该函数。

请使用构造函数QMetaType

这是一个重载函数。

table 中构造一个名为fieldName 的空字段,其变体类型为type

[deprecated in 6.0] void QSqlField::setType(QVariant::Type type)

自 6.0 版起,该函数已被弃用。我们强烈建议不要在新代码中使用该函数。

请使用setMetaType() 代替。

将字段的变量类型设置为type

另请参阅 type() 和metaType

[deprecated in 6.0] QVariant::Type QSqlField::type() const

自 6.0 版起,该函数已被弃用。我们强烈建议不要在新代码中使用该函数。

请使用metaType() 代替。

返回存储在数据库中的字段类型。请注意,实际值可能有不同的类型,因为数值太大而无法存储在 long int 或 double 中时,通常会存储为字符串,以防止精度降低。

另请参阅 setType() 和metaType

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.