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

layer properties dialog does not call widget factory's supportsLayer() method #28061

Closed
qgib opened this issue Oct 27, 2018 · 4 comments
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Easy fix Vectors Related to general vector layer handling (not specific data formats)

Comments

@qgib
Copy link
Contributor

qgib commented Oct 27, 2018

Author Name: Ricardo Silva (Ricardo Silva)
Original Redmine Issue: 20240
Affected QGIS version: 3.3(master)
Redmine category:vectors


Vector layer properties dialogs can be extended by plugin authors by leveraging @QgsMapLayerConfigWidgetFactory@. This class defines the @supportsLayer()@ method, which would be useful for only attaching a custom properties panel if the layer meets some requirements (e.g. if it is a postgis layer). However, this method is never called by @QgsVectorLayerProperties::addPropertiesPageFactory()@, which results in the custom properties panel being shown all the time.

This issue seems fairly easy to fix, as it is just a matter of adding an @if@ clause that checks the result of the factory's @supportsLayer()@ method, similarly to the already existing check for @supportLayerPropertiesDialog@


Related issue(s): #28060 (relates)
Redmine related issue(s): 20239


@qgib
Copy link
Contributor Author

qgib commented Oct 27, 2018

Author Name: Ricardo Silva (Ricardo Silva)


@qgib
Copy link
Contributor Author

qgib commented Oct 27, 2018

Author Name: Harrissou Santanna (@DelazJ)


This issue seems fairly easy to fix, as it is just a matter of adding an if clause that checks the result of the factory's supportsLayer() method, similarly to the already existing check for supportLayerPropertiesDialog

Could you please provide a patch or better, a pull-request?

@qgib
Copy link
Contributor Author

qgib commented Oct 27, 2018

Author Name: Ricardo Silva (Ricardo Silva)


Yes, I can supply a PR. I cannot commit to a date, unfortunately, but it should be soon.

@qgib
Copy link
Contributor Author

qgib commented Oct 30, 2018

Author Name: Ricardo Silva (Ricardo Silva)


Applied in changeset a9f7f35.


  • done_ratio was changed from 0 to 100
  • status_id was changed from Open to Closed

@qgib qgib closed this as completed Oct 30, 2018
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Vectors Related to general vector layer handling (not specific data formats) Easy fix labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Easy fix Vectors Related to general vector layer handling (not specific data formats)
Projects
None yet
Development

No branches or pull requests

1 participant