This aligns the default selection behavior of the postgres and oracle source
selection with the rest of the application and other providers like geopackage.
For newcomers, the MultiSelection is rather confusing. Especially with the current
behavior inside the unified data source dialog, that remembers previous selections
it's very hard to clear pre-existing selections in large lists that are partially
hidden.
Avoids situations like
1. Line length of 3cm
2. Repeat distance of 2cm
3. Label size is 1.5 cm
2cm 1cm
/--Label--/----/
i.e. the labels are off center and gravitate toward line starts
Instead, we first calculate how many complete repeats we can fit
in, and then divide the line into even sections of this length,
avoiding the situation where some leftover segment of the line
end isn't big enough for the label to fit.
QgsPathResolver::setPathPreprocessor allows setting a custom path pre-processor
function, which allows for manipulation of paths and data sources prior
to resolving them to file references or layer sources.
The processor function must accept a single string argument (representing the
original file path or data source), and return a processed version of this path.
The path pre-processor function is called before any bad layer handler.
Example - replace an outdated folder path with a new one:
def my_processor(path):
return path.replace('c:/Users/ClintBarton/Documents/Projects', 'x:/Projects/')
QgsPathResolver.setPathPreprocessor(my_processor)
Example - replace a stored database host with a new one:
def my_processor(path):
return path.replace('host=10.1.1.115', 'host=10.1.1.116')
QgsPathResolver.setPathPreprocessor(my_processor)
Example - replace stored database credentials with new ones:
def my_processor(path):
path= path.replace("user='gis_team'", "user='team_awesome'")
path = path.replace("password='cats'", "password='g7as!m*'")
return path
QgsPathResolver.setPathPreprocessor(my_processor)
Attempts to allocate memory for at least the specified number of geometries.
If the number of geometries is known in advance, calling this function
prior to adding geometries will prevent reallocations and memory fragmentation.
click on a label toggles this label
Unlike in marquee mode, where users must hold ctrl while dragging
over labels to hide them, when only a click on an existing label
is made we trigger a toggle of the label. It's a more intuitive
UX.
which controls a distance from the feature where callout lines end
Makes for visually more appealing callouts vs drawing them right
up against the edges of features