5

I couldn't find a manual solution. But It is easily performed using PyQGIS. threshold = 50000 # 1:50.000 # get layout and items manager = QgsProject.instance().layoutManager() layout = manager.layoutByName("layout_name") mapItem = layout.itemById("map_name") scalebar = layout.itemById("scalebar_name") def map_extent_changed(): ...


4

Yes. You can define for example a project variable like this : my_area : attribute(@atlas_feature, 'Acres') And use it in an expression with : eval(@my_area) NB : the expression must have a meaning in the context scope where it's used


3

I believe this was addressed in the 3.18 release of QGIS but I haven't tried it yet. Feature: Color ramp legend improvements Edit I tried the new feature with a raster DEM and it works as described. One thing to note though is that the Autoupdate needs to be turned off and you have to double click the legend item to access the additional item settings.


3

For now, here is a workaround in the form of a Python script. It's quite easy to use. Just paste the script below into a new editor in the Python console, open a print layout, select a legend in the layout, select a layer in the main window Table of contents, then run the script. def invertLegendNodeOrder(): open_layouts = iface.openLayoutDesigners() ...


2

You need to add pages before attempting to move your items. Your current code tries to move items to "non existing pages". A demo below (I start from an existing empty layout named demo_multi with one page) project = QgsProject.instance() projectLayoutManager = project.layoutManager() layout = projectLayoutManager.layoutByName('demo_multi') def ...


2

You are doing nothing wrong here. The expression is correct. It just seems like, the attribute() as well as attributes() function does not work in print layout (at least in 3.16). I dont know why. I can only provide a rather poor workaround: Instead of a textfield, add an attribute table and select your layer as datasource and remove the header as well as ...


2

Your difficulty likely arises from QGIS and the server not communicating well about the dpi (dots per inch) resolution of the map requested from the server. Many WMS servers default to 90 or 96 dpi. Many computer screens operate at a "logical" (i.e., used for calculating display font sizes in all applications) of 96 or 120 dpi. These are fairly ...


2

You can find below a sample to do sorting using the "PyQGIS way" instead of the Python way. project = QgsProject.instance() projectLayoutManager = project.layoutManager() layout = projectLayoutManager.layoutByName('Your layout name') # You need to select in the layout GUI an existing # "QgsLayoutItemAttributeTable" (in fact, insertion # ...


Only top voted, non community-wiki answers of a minimum length are eligible