Bug report #20240

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

Added by Ricardo Silva almost 2 years ago. Updated almost 2 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Vectors
Affected QGIS version:3.3(master) Regression?:No
Operating System: Easy fix?:Yes
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:28061

Description

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 issues

Related to QGIS Application - Bug report #20239: Raster layer properties dialog cannot be extended Open 2018-10-27

Associated revisions

Revision a9f7f354
Added by Ricardo Silva almost 2 years ago

vector layer properties now checks if config widget factory supports layer

previously the factory would always be used, even if it did not
support the active layer

fixes #20240

Revision 5c0cc0bb
Added by Ricardo Silva almost 2 years ago

vector layer properties now checks if config widget factory supports layer

previously the factory would always be used, even if it did not
support the active layer

fixes #20240

(cherry picked from commit a9f7f3542e2424b0b8cbd500c077ea648d6f24f6)

History

#1 Updated by Ricardo Silva almost 2 years ago

  • Related to Bug report #20239: Raster layer properties dialog cannot be extended added

#2 Updated by Harrissou Santanna almost 2 years ago

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?

#3 Updated by Ricardo Silva almost 2 years ago

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

#4 Updated by Ricardo Silva almost 2 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF