Actually it had nothing to do with CSV being the
source, but it was the json exporter passing
the values through all field formatters except for
the fallback.
This resulted in all fields using a 'Range' formatter
(which is the default for all numeric types) passing
through the formatter and being returned as strings
in the json. Worse, if the locale was not a "dot"
locale and decimal separator was on, the resulting
string could not be easily converted into its original
numeric type.
Now, instead of checking for the fallback formatter
only, there is a white list of formatters that
can be applied when we want a json.
This is a temporary solution because the "right" way
to do it would be either a flag in the formatter to
tell if it can be applied when converting to json
and/or other "data" formats (csv etc.) or a different
new method similar to representValue.
Do it also in case of datasets that have a single layer, in case they might
later be edited to have more layers
(except for a few drivers known to be always single layer)
If the active layer is not editable, the executor will
try to switch editing on.
If there are no selected features, the executor will
select all features before running.
Fixes an issue identified in the upcoming QGIS Map Design 2nd ed
(spoiler alert!) where it's impossible to utilise label text
substitutions if you also want to use word wrapping.
This isn't possible to directly fix, because we need to evaluate
the full label expression (including the word wrapping component)
in order to actually HAVE text to substitute into.
So, a new setting has been added to the label formatting tab
allowing users to directly set an auto-wrapping line ideal
line size. This is applied AFTER label text evaluation, substitutions,
and the 'wrap text on' character, so it can play correctly well with
all these other settings. This also has the nice side-effect
of making auto label text wrapping more accessible to new
users/those unfamiliar with the wordwrap expression function.
Fixes#20007, and cleans up a chapter of QMD 2ed ;)
At least using the linux sql server driver, time fields are not
correctly automatically converted to QTime variants. Instead
they are returned as a raw byte array containing the value.
Add special handling to ensure that these time values are
read regardless.
(there's already a test in place for this, which was failing
on Linux)