Re: [QGIS-Developer] loadNamedStyle() is loading default style instead of QML file

2023-09-11 Thread Jacky Volpes via QGIS-Developer
Hi Alexandre, When the layer is a PostgreSQL layer, it's the method from QgsVectorLayer which is called: https://qgis.org/pyqgis/3.32/core/QgsVectorLayer.html#qgis.core.QgsVectorLayer.loadNamedStyle https://api.qgis.org/api/classQgsVectorLayer.html#a2bd3a21badac411179dbfbc724136a45 The

Re: [QGIS-Developer] Reading current measurement with python

2023-10-25 Thread Jacky Volpes via QGIS-Developer
Hi, If I understand well, it's possible that a styled layer could be sufficient...? See "Description" section on this style . Import the style in QGIS style

Re: [QGIS-Developer] Reading current measurement with python

2023-10-02 Thread Jacky Volpes via QGIS-Developer
Hi, You can have a look at this snippet: https://lists.osgeo.org/pipermail/qgis-developer/2023-May/065789.html Regards, -- Jacky Volpes Ingénieur SIG - Oslandia -- Le 02/10/2023 à 07:05, Simon Gröchenig via QGIS-Developer a écrit : Hi list, is it possible to get the current line/area

Re: [QGIS-Developer] Reading current measurement with python

2023-10-06 Thread Jacky Volpes via QGIS-Developer
Hi Simon, Ok, I understand your question now. Unfortunately, the measurement tool is not accessible with the python API. As I don't have the context explaining why you need this, I can propose you to find another way for your process, or, if you really need to get the measurement value, here

Re: [QGIS-Developer] Feature count for DB provider.

2022-06-28 Thread Jacky Volpes via QGIS-Developer
Hello Rémi, The function you refer to https://github.com/qgis/QGIS/blob/master/src/core/vector/qgsvectorlayerfeaturecounter.cpp#L76-L90 is only called when the feature count must be done for the symbols (for instance when a categorized symbology is used, then QGIS does not use estimated

Re: [QGIS-Developer] Inserting provider filter just before PostGIS layer is loaded?

2022-08-22 Thread Jacky Volpes via QGIS-Developer
Hi, I don't know any way to do this, except for using a workaround. But it will depend on your use-case. Maybe using query layers, such as QgsVectorLayer("table='(select * from . conditions>)' service='' key=''", "name>", "postgres") can help ? Regards, Jacky Le 09/08/2022 à 11:15,

Re: [QGIS-Developer] segmentation fault in standalone script using PyQGIS

2022-10-28 Thread Jacky Volpes via QGIS-Developer
Hi Mélanie, Have you initialized your standalone script as shown in https://docs.qgis.org/3.22/en/docs/pyqgis_developer_cookbook/intro.html#using-pyqgis-in-standalone-scripts ? Best regards, Jacky Le 28/10/2022 à 16:40, Mélanie Dol via QGIS-Developer a écrit : Hi Andrea, Thank you. I've

Re: [QGIS-Developer] segmentation fault in standalone script using PyQGIS

2022-10-31 Thread Jacky Volpes via QGIS-Developer
ase find attached my script. Regards, Mélanie On 10/28/22 4:55 PM, Jacky Volpes via QGIS-Developer wrote: Hi Mélanie, Have you initialized your standalone script as shown in https://docs.qgis.org/3.22/en/docs/pyqgis_developer_cookbook/intro.html#using-pyqgis-in-standalone-scripts ? Best regar

Re: [QGIS-Developer] Autocomplete python code in QGIS compiled

2023-01-11 Thread Jacky Volpes via QGIS-Developer
Exactly the same here! On Ubuntu 22.04 Regards, -- Jacky Volpes Ingénieur SIG - Oslandia Le 09/01/2023 à 17:12, matteo via QGIS-Developer a écrit : Hi all, maybe that's a silly question, but with all the self compiled QGIS versions that I have (3.22, 3.28, master, ecc) QGIS is not

Re: [QGIS-Developer] segmentation fault in standalone script using PyQGIS

2022-11-02 Thread Jacky Volpes via QGIS-Developer
the line "layer_settings.LabelPlacement = 4" should be changed to "layer_settings.placement = 4" you can also use the enum : "layer_settings.LabelPlacement = QgsPalLayerSettings.Placement.Horizontal" Many thanks and regards, Mélanie On 10/31/22 12:14 PM, Ja

Re: [QGIS-Developer] install plugin from github

2023-03-21 Thread Jacky Volpes via QGIS-Developer
Hi, I recommend that you clone the repository somewhere else on your computer, and add the path in QGIS settings, in the System > Environment variable section, in QGIS_PLUGINPATH (see capture below). This way you will always be able to put the correct path to the plugin. Because here for

Re: [QGIS-Developer] PyQGIS: how to modify default behavior of QgsRubberBand

2023-02-20 Thread Jacky Volpes via QGIS-Developer
Hi Joseph, Like you, rubber bands and drawing/paint stuff are quite obscure to me and I need to dig into it when I want something specific... I don't have a direct answer, but you could look into existing code doing similar things: the plugins "beePen" and "Bezier Editing" available in QGIS

Re: [QGIS-Developer] Digitizing with Edit Menu

2023-05-02 Thread Jacky Volpes via QGIS-Developer
Hello, Have you tried this following code? Using iface.mapCanvas().mapTool().pointsZM() is good for me with any digitizing tool, while drawing. # Measurement object (adapt with crs/transform context/ellipsoid) da = QgsDistanceArea() da.setSourceCrs(QgsProject.instance().crs(),

Re: [QGIS-Developer] Detect a Map Canvas Mouse Event

2023-04-11 Thread Jacky Volpes via QGIS-Developer
Hello, Here is a snipped of code that can help you. To test this you have to: - Show python console - enable the polygonal digitizing tool (must be the active tool before launching this snippet) - execute the code in the python editor - start digitizing - see the area printing in the console

Re: [QGIS-Developer] Temporarily disable map canvas right click showing Copy Coordinates

2023-04-13 Thread Jacky Volpes via QGIS-Developer
Maybe return True in your eventFilter, so that the event is not processed further by other widgets? Regards, -- Jacky Volpes Ingénieur SIG - Oslandia Le 13/04/2023 à 08:11, Catania, Luke A ERDC-RDE-GRL-VA CIV via QGIS-Developer a écrit : I thought I tried this before and it still showed

Re: [QGIS-Developer] Load Style and Save Style forms from python code

2023-05-11 Thread Jacky Volpes via QGIS-Developer
Hello, You can try this method , available in python bindings from 3.30: props = QgsVectorLayerProperties(iface.mapCanvas(), iface.messageBar(), iface.activeLayer()) props.loadStyle() or

Re: [QGIS-Developer] GSoC 2024 proposal : QGIS improve the graphical modeler UI and UX

2024-02-22 Thread Jacky Volpes via QGIS-Developer
Hi Valentin, That's quite an impressive proposal! I could not agree more with you about the need to have a better design, UX, and UI for the modeler. However, as Nyall already pointed out, you can be sure that the schedule will largely shift seeing the amount of work/features, and I also would

Re: [QGIS-Developer] Access to shapeDigitizeToolBar menu's text

2024-02-27 Thread Jacky Volpes via QGIS-Developer
Hi Luke, As you can see on the printed text, objects are QWigetAction, not QAction. This is because you get each category of the tool bar, where then each one contains one or more digitizing QActions. Here is a snippet that can help you explore the tool bar: sdtb =

Re: [QGIS-Developer] Access to shapeDigitizeToolBar menu's text

2024-03-06 Thread Jacky Volpes via QGIS-Developer
Hi Luke, It works with setDisabled on action_item. Be careful not to call setDisabled on every action of a category, then yes, it disables the entire icon. Updated snippet for example: actions_list = [] sdtb = iface.shapeDigitizeToolBar() for i, action_widget_item in