mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-13 00:07:27 -05:00
Hide relationship label widgets if not supported by connection
This commit is contained in:
parent
ad1b6a5fa0
commit
d28bbf207e
@ -58,6 +58,19 @@ QgsDbRelationWidget::QgsDbRelationWidget( QgsAbstractDatabaseProviderConnection
|
||||
mStrengthCombo->addItem( QgsRelation::strengthToDisplayString( strength ), QVariant::fromValue( strength ) );
|
||||
}
|
||||
|
||||
const Qgis::RelationshipCapabilities capabilities = mConnection->supportedRelationshipCapabilities();
|
||||
if ( !( capabilities & Qgis::RelationshipCapability::ForwardPathLabel ) )
|
||||
{
|
||||
mForwardLabelLineEdit->hide();
|
||||
mForwardLabel->hide();
|
||||
}
|
||||
|
||||
if ( !( capabilities & Qgis::RelationshipCapability::BackwardPathLabel ) )
|
||||
{
|
||||
mBackwardLabelLineEdit->hide();
|
||||
mReverseLabel->hide();
|
||||
}
|
||||
|
||||
const QStringList relatedTableTypes = mConnection->relatedTableTypes();
|
||||
mRelatedTableTypeCombo->addItems( relatedTableTypes );
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
<widget class="QLineEdit" name="mForwardLabelLineEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<widget class="QLabel" name="mForwardLabel">
|
||||
<property name="text">
|
||||
<string>Forward label</string>
|
||||
</property>
|
||||
@ -80,7 +80,7 @@
|
||||
<widget class="QComboBox" name="mRelatedTableTypeCombo"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<widget class="QLabel" name="mReverseLabel">
|
||||
<property name="text">
|
||||
<string>Reverse label</string>
|
||||
</property>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user