[QGIS-Developer] Making QgsRasterLayerProperties class independent again from QgisApp instance

Vincent Cloarec vcloarec at gmail.com
Mon Sep 23 09:29:51 PDT 2019


I think the TODO issues come from here but not sure :

https://github.com/vcloarec/QGIS/blob/4c7f33e830e574577916efd8275ba78fb78ae243/src/gui/raster/qgsrasterlayerproperties.cpp#L1738






Le lun. 23 sept. 2019 à 12:24, Alessandro Pasotti <apasotti at gmail.com> a
écrit :

>
> On Mon, Sep 23, 2019 at 6:15 PM Vincent Cloarec <vcloarec at gmail.com>
> wrote:
>
>> Hello,
>>
>> I have some difficulties in passing the Travis tests with this PR:
>> https://github.com/qgis/QGIS/pull/31942.
>>
>> As I am fed up to make turning the server for nothing and reject CO2, I
>> ask for help.
>>
>> The 'code layout' tests seem not to pass. Reading the log, I can find
>> this link http://tinyurl.com/yynt7m9a. Following this link, it seems the
>> problems come from warning: undocumented parameters and unknown command
>> '\TODO'.
>>
>> Can anyone confirm ?
>>
>
> Confirmed.
>
> You need to complete the documentation of a few methods.
> I don't know where the TODO comes from though.
>
>
>
>> Thanks.
>>
>> Vincent Cloarec
>> www.reos.site
>>
>>
>> Le lun. 23 sept. 2019 à 00:25, Vincent Cloarec <vcloarec at gmail.com> a
>> écrit :
>>
>>> Hello,
>>>
>>> Thanks Nyall for your advice.
>>>
>>> I have chosen to move the raster layer properties to the gui. As the
>>> widget is very convenient, no reason to rebuild my own. Moreover, it
>>> appears there is not a lot of code to change.
>>> So I purpose this PR: https://github.com/qgis/QGIS/pull/31942
>>> The tests seem to pass for QGIS, and I have tried to import the
>>> QgsRasterLayerProperties class to a standalone application only using the
>>> gui library, it is ok.
>>>
>>> Vincent Cloarec
>>> www.reos.site
>>>
>>>
>>> Le jeu. 19 sept. 2019 à 00:37, Nyall Dawson <nyall.dawson at gmail.com> a
>>> écrit :
>>>
>>>> On Thu, 19 Sep 2019 at 13:55, Vincent Cloarec <vcloarec at gmail.com>
>>>> wrote:
>>>> >
>>>> > In standalone applications, I am using the QgsRasterLayerProperties
>>>> class to manage rasters displayed in the map canvas.
>>>> >
>>>> > However, since QGis 3.8, this class is no longer independent from the
>>>> QgisApp instance because the methode
>>>> QgisApp::instance()->askUserForDatumTransform() is called from the
>>>> QgsRasterLayerProperties instance.
>>>> >
>>>> > As in my standalone applications, I don't have QgsApp instance (no
>>>> need), now this applications crash when the raster layer properties widget
>>>> opens ...
>>>> >
>>>> > So, after a look at the Qgis code, I am thinking about to make a PR
>>>> to make again the QgsRasterLayerProperties independant from the QgisApp
>>>> instance. I think it could be possible with a static method in the QgisApp
>>>> class. I have to work on it.
>>>>
>>>> Possibly -- but it's a band-aid solution only. There's a LOT of code
>>>> in the app library which will make assumptions that the QgisApp
>>>> instance is available, and that's why all this code is partitioned off
>>>> into the app library. app also has no stable API guarantees and you'll
>>>> continue to hit situations like this.
>>>>
>>>> I'd suggest two possible alternative ways forward:
>>>>
>>>> 1. Use the stable api classes exposes through the gui library to
>>>> rebuild your own raster layer properties dialog
>>>> 2. Submit a PR moving the raster layer properties class from app ->
>>>> gui and adding it to the stable API
>>>>
>>>> Both approaches are more upfront work, but are paths to much less pain
>>>> and future breakage...
>>>>
>>>> Nyall
>>>>
>>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
> --
> Alessandro Pasotti
> w3:   www.itopen.it
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190923/ba98867d/attachment.html>


More information about the QGIS-Developer mailing list