QSqlRelation露

The QSqlRelation class stores information about an SQL foreign key. More鈥�

Inheritance diagram of PySide2.QtSql.QSqlRelation

Synopsis露

Functions露

Detailed Description露

QSqlRelation is a helper class for QSqlRelationalTableModel . See setRelation() and relation() for details.

See also

QSqlRelationalTableModel QSqlRelationalDelegate Relational Table Model Example

class PySide2.QtSql.QSqlRelation露

PySide2.QtSql.QSqlRelation(QSqlRelation)

PySide2.QtSql.QSqlRelation(aTableName, indexCol, displayCol)

param QSqlRelation:

PySide2.QtSql.QSqlRelation

param aTableName:

str

param indexCol:

str

param displayCol:

str

Constructs an invalid QSqlRelation object.

For such an object, the tableName() , indexColumn() , and displayColumn() functions return an empty string.

See also

isValid()

Constructs a QSqlRelation object, where tableName is the SQL table name to which a foreign key refers, indexColumn is the foreign key, and displayColumn is the field that should be presented to the user.

PySide2.QtSql.QSqlRelation.displayColumn()露
Return type:

str

Returns the column from table tableName() that should be presented to the user instead of a foreign key.

PySide2.QtSql.QSqlRelation.indexColumn()露
Return type:

str

Returns the index column from table tableName() to which a foreign key refers.

PySide2.QtSql.QSqlRelation.isValid()露
Return type:

bool

Returns true if the QSqlRelation object is valid; otherwise returns false .

PySide2.QtSql.QSqlRelation.swap(other)露
Parameters:

other 鈥� PySide2.QtSql.QSqlRelation

Swaps this with other .

PySide2.QtSql.QSqlRelation.tableName()露
Return type:

str

Returns the name of the table to which a foreign key refers.