Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing override of relations editor bug #3455

Merged
merged 3 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading