Comments (10)
Hello, the subject is very interesting. I have a question, how or what would be the best way to program an action in python within a plugin. That is, the end user can use it without having to add code. Thank you
from courses.
Actions are defined for a layer and embedded within a QGIS Project. It makes it very easy mechanism to distribute your code to other users without having to write a plugin and simply sending them a qgis project. So if you share a qgis project that has actions defined in layers, the users can use it without writing any code.
from courses.
Thanks for the immediate response!
I have made a plugin, but I need to add the actions programmatically, that the end user who does not know anything about python can use. I saw that you can use QgsAction but I don't know how.
Passing on a project would be very restrictive, they ask me to be able to download a plugin from a repository and have everything already submitted and not as personalized as sharing a project. Thank you!!!
from courses.
Actions and Plugins are different mechanisms. You choose one or the other for distributing your code.
Actions MUST be linked to specific project and a specific layer. They are used only when you want to put customizations in a project.
QgsAction does not refer the Actions as described here but a QT Action (which is a menu item or a toolbar item).
If you already have a plugin and want some customisation, just build them as part of your plugin using PyQGIS API. Look at my course on how to do that https://courses.spatialthoughts.com/pyqgis-in-a-day.html
from courses.
Ok, conceptually: I need to develop certain functionalities for the end user which I have been developing a plugin with PyQgis (and using several examples from your course for which I greatly appreciate), but in a particular case when a user creates a point I need the form By default, it closes and allows you to select data from other layers and then resume creating the point with that data. For this, implement with QgsAction an action that the user can call and thus complete the functionality. But it doesn't work at all and I don't know if it's because I was missing something or if I'm thinking about it incorrectly.
What do you think, would you do it in a better way?
Thank you so much!
from courses.
QgsAction is not the Actions described here. So you are looking at the wrong place. You can solve your problem using PyQGIS and using QGIS Attribute Forms. Look at PyQGIS documentation and seek help on specifics at https://gis.stackexchange.com/
from courses.
Hello. I have a question. How can I import a python class implemented by me in a plugin from within an action. For example: I have a class A inside My_Plugin and I need to invoke A.my_method() from an action of a layer.
Thank you so much
from courses.
Try something like below
myPlugin = qgis.utils.plugins["PluginName"]
A = myPlugin.A()
A.my_method()
from courses.
Thank you so much. I'm going to try it. If you can walk you would become my idol, like some kind of rock star.
from courses.
It went perfect! you are a god
from courses.
Related Issues (12)
- Add missing screenshot for Georeferencing Topo Sheets and Scanned Maps
- Update the source of Significant Earthquale CSV
- Add Back to Top Links HOT 1
- Use spatial index to check fewer features in QGIS Actions Buffer example HOT 4
- End-to-End Google Earth Engine (Full Course Material) HOT 3
- Introduction to QGIS (Full Course Material) HOT 5
- Creating Publication Quality Charts with GEE (Full Course Material) HOT 2
- Install QGIS-LTR HOT 2
- Advanced QGIS (Full Course Material) HOT 4
- End-to-End Google Earth Engine (Supplementary Course Material) HOT 2
- Update QGIS Installation instructions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from courses.