Skip to main content
2 of 2
Removed tag prefix from question title as per Jeff Atwood style preference
underdark
  • 84.5k
  • 22
  • 233
  • 415

pass custom command line arguments?

Is there a way to start QGIS with custom command line arguments and to access those arguments at runtime in a plugin?

Background: I'm trying to start QGIS using a third party application(click on a GIS-Button, QGIS opens with a predefined project using the --project flag). After the project has finished loading I want to register a listener to a given layer inside that project. The name of the layer has to be passed somehow to QGIS. As the name may vary, my best guess was to append that somehow to the command line arguments. The intention of this process is to be able to perform selection, zoom and pan options in QGIS which are triggered by a third party application and, if the corresponding button is clicked, to send data (e.g. areas) back to the third party application for further use.

Basically I've got everything working except for the registering of the layer, which has to be done manually at the moment.

werkuh
  • 327
  • 2
  • 11