[QGIS-Developer] Open plugin automatically when file is dragged onto QGIS

David Signer david at opengis.ch
Sun Nov 5 12:32:29 PST 2023


You can use an eventfilter. You can find an example here
https://github.com/opengisch/QgisModelBaker/blob/master/QgisModelBaker/qgismodelbaker.py#L507C7-L552

However, it may be appropriate to have a setting for this. In the plugin
mentioned above, the user is asked if they want to open this type of file
always with this plugin in the future.

Cheers
Dave

On Sun, Nov 5, 2023 at 1:54 AM Pankajeshwara Sharma via QGIS-Developer <
qgis-developer at lists.osgeo.org> wrote:

> Hello all,
>
> I would like a feature within QGIS so that when files with ".xyz"
> extension are dragged onto the application, would make my plugin to open
> automatically.
> This can prevent the user from having to go to the File menu and open the
> file.
>
> This is similar to when shapefiles are dragged onto QGIS, and the
> shapefiles are automatically loaded and displayed in QGIS.
> Except, dragging a file with a ".xyz" extension should result in my plugin
> (a dialog box from then plugin) to open.
>
> Is there a setting I can configure?
>
> Yours sincerely,
> Pankaj Sharma
> Research Fellow
> University of Auckland
> pankaj.sharma at auckland.ac.nz
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20231105/57993388/attachment.htm>


More information about the QGIS-Developer mailing list