Skip to content

Commit

Permalink
Fixing override of relations editor bug (#3455)
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ authored May 24, 2024
1 parent 38fe87a commit 22d1cf7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/inpututils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ const QUrl InputUtils::getThemeIcon( const QString &name )
return QUrl( path );
}

const QUrl InputUtils::getFormEditorType( const QString &widgetNameIn, const QVariantMap &config, const QgsField &field, const QgsRelation &relation )
const QUrl InputUtils::getFormEditorType( const QString &widgetNameIn, const QVariantMap &config, const QgsField &field, const QgsRelation &relation, const QString &editorTitle )
{
QString widgetName = widgetNameIn.toLower();

Expand Down Expand Up @@ -1129,7 +1129,7 @@ const QUrl InputUtils::getFormEditorType( const QString &widgetNameIn, const QVa
}

// Mind this hack - fields with `no-gallery-use` won't use gallery, but normal word tags instead
if ( field.name().contains( "nogallery", Qt::CaseInsensitive ) || field.alias().contains( "nogallery", Qt::CaseInsensitive ) )
if ( editorTitle.contains( "nogallery", Qt::CaseInsensitive ) )
{
useGallery = false;
}
Expand Down
2 changes: 1 addition & 1 deletion app/inpututils.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class InputUtils: public QObject
* \param config map coming from QGIS describing this field
* \param field qgsfield instance of this field
*/
Q_INVOKABLE static const QUrl getFormEditorType( const QString &widgetNameIn, const QVariantMap &config = QVariantMap(), const QgsField &field = QgsField(), const QgsRelation &relation = QgsRelation() );
Q_INVOKABLE static const QUrl getFormEditorType( const QString &widgetNameIn, const QVariantMap &config = QVariantMap(), const QgsField &field = QgsField(), const QgsRelation &relation = QgsRelation(), const QString &editorTitle = QString() );

/**
* \copydoc QgsCoordinateFormatter::format()
Expand Down
2 changes: 1 addition & 1 deletion app/qml/form/MMFormPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ Page {

source: {
if ( model.EditorWidget !== undefined ) {
return __inputUtils.getFormEditorType( model.EditorWidget, model.EditorWidgetConfig, model.Field, model.Relation )
return __inputUtils.getFormEditorType( model.EditorWidget, model.EditorWidgetConfig, model.Field, model.Relation, model.Name )
}

return ''
Expand Down

0 comments on commit 22d1cf7

Please sign in to comment.