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

Raster layer properties dialog cannot be extended #28060

Closed
qgib opened this issue Oct 27, 2018 · 7 comments · Fixed by #41557
Closed

Raster layer properties dialog cannot be extended #28060

qgib opened this issue Oct 27, 2018 · 7 comments · Fixed by #41557
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! GUI/UX Related to QGIS application GUI or User Experience Rasters Related to general raster 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: 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


@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: 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?

@qgib
Copy link
Contributor Author

qgib commented Oct 27, 2018

Author Name: Alessandro Pasotti (@elpaso)


Something like QgsMapLayerPropertiesBase makes sense to me, would you like to make a pull request?

@qgib
Copy link
Contributor Author

qgib commented Oct 27, 2018

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 :)

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Rasters Related to general raster layer handling (not specific data formats) labels May 25, 2019
@gioman
Copy link
Contributor

gioman commented Jan 30, 2021

@ricardogsilva is this still relevant?

@gioman gioman added the Feedback Waiting on the submitter for answers label Jan 30, 2021
@ricardogsilva
Copy link
Contributor

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

@gioman gioman added GUI/UX Related to QGIS application GUI or User Experience and removed Feedback Waiting on the submitter for answers labels Jan 31, 2021
@Samweli
Copy link
Contributor

Samweli commented Feb 15, 2021

cc @Samweli

@ricardogsilva @gioman working on a PR for this issue.

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! GUI/UX Related to QGIS application GUI or User Experience Rasters Related to general raster layer handling (not specific data formats)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants