-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Raster layer properties dialog cannot be extended #28060
Comments
Author Name: Ricardo Silva (Ricardo Silva)
|
Author Name: Ricardo Silva (Ricardo Silva) Upon closer inspection, it seems @QgsOptionsDialogBase@ is very generic and is used in lots of places, so this kind of functionality does not seem like it belongs there. Perhaps a new class that derives from @QgsOptionDialogBase@ and is a base for both layer properties dialogs is in order? |
Author Name: Alessandro Pasotti (@elpaso) Something like QgsMapLayerPropertiesBase makes sense to me, would you like to make a pull request? |
Author Name: Ricardo Silva (Ricardo Silva) Yes, I'm willing to submit a PR. I cannot commit to any date for it though. But I hope to be able to submit it soon :) |
@ricardogsilva is this still relevant? |
yes AFAIK the reported issue still exists. I've not been able to produce a PR for it yet. However, Kartoza is currently working on a project where we plan to tackle this. cc @Samweli |
@ricardogsilva @gioman working on a PR for this issue. |
Author Name: Ricardo Silva (Ricardo Silva)
Original Redmine Issue: 20239
Affected QGIS version: 3.3(master)
Redmine category:rasters
The vector layer properties dialog can be extended by calling @QgisInterface.registerMapLayerConfigWidgetFactory()@
Plugin authors can create a class that derives from @QgsMapLayerConfigWidgetFactory@ and implements its virtual methods, especially @createWidget()@ and this allows adding custom panels to the Vector layer properties dialog.
Unfortunately it is not possible to extend the Raster layer properties dialog in this way, which kind of feels more like a bug than a missing feature.
Looking at QGIS' source code, both @QgsRasterLayerProperties@ and @QgsVectorLayerProperties@ inherit from @QgsOptionsDialogBase@, so it seems like moving the code that is currently present in the vector layer properties to the base class would fix this. The relevant method is @QgsVectorLayerProperties::addPropertiesPageFactory()@. This method is only called in @QgisApp::showLayerProperties()@ - currently it is only called for vector layers, but it would be possible to call it also with raster layers
Related issue(s): #28061 (relates)
Redmine related issue(s): 20240
The text was updated successfully, but these errors were encountered: