* QgsFilePicker is intended to be used across whole QGIS application for file picking
* right now it supports only single file/folder selection
* it has advanced support of relative path
* QgsExternalRessourceWidget is the pending editor widget which integrates a photo/web viewer
* it can be properly accessible from the API and custom widgets
* new class to avoid duplicating code for legacy support
* old widgets will be removed from QGIS 3 (users will be invited to use the new widget in the config dialog)
* Use an hyperlink for file name: when checked the widget displays an hyperlink (in a QLabel) instead of a QLineEdit. The link is always clickable, even in non edit mode. In this mode, user can only change the content of the field by selecting a file with the file selector (which is opened with the "..." button). If you want to revert to editable QLineEdit file name widget, just unchek the option.
* Display the full path: when checked, the hyperlink will display the absolute path of the file. When unchecked, the hyperlink will display only the name of the file (useful if the file path is always long).
Default Path: this is the path that will be used by the file selector when opening. The file selector will start at this path (if the option is not empty).
* Store Relative paths to the default path: when checked, file names are stored relatively to the default path described above. It is useful to store long paths into text shapefiles attributes limited to 254 characters.
* Store relative paths to the project path: when checked, file names are stored relatively to the project (.qgs file) path. This option will override the "save paths" setting of the project because it is sometimes useful to store code/svg/layer path relatively but not for the file name attributes.
* File storage options are exclusive options to make the file selector select files (default mode) or only directories.
File Name editor widget:
* add a isFieldSupported method to the factory to allow File Name widget only on fields that are QStrings.
* add a new QSetting to save the last path used in the widget. Before the PR, users were always defaulted to QGIS home directory when using the file selector button. This QSetting could also be used for the photo widget.
* when you want to change the value of an already set attribute, file selector will point to this path.
* when the value of the attribute is null or non valid (not a file), the file selector will use the default path (if set), or the last used path or the home directory.
During rendering, two new variables will be available:
* `geometry_part_count`
* `geometry_part_num` (1-based index)
Useful to apply different styles to different parts of multipart
features
Applies to north arrow, copyright and scalebar.
- Changed dialogs to use QgsUnitSelectionWidget.
- Added QgsSymbolV2::OutputUnit enum to decorationitem.
- Updated to use mm, pixel, or percentage units.
- Added percentage to OutputUnit enum.
- Updated qgssymbolv2utils to include percentage.
- Updated qgsunitselectionwidget to include percentage.
Changed selection widget in its own commit
Added Percentage to OutputUnit enum.
Added percentage to switches in utils
(only works with Cartographic point label placement). When this
setting is active, the label distance applies from the bounds
of the rendered symbol for a point, instead of the point itself.
It's especially useful when the symbol size isn't fixed, eg if
it's set by a data defined size or when using different symbols
in a categorised renderer.
Sponsored by Andreas Neumann
In this placement mode, point label candidates are generated
following ideal cartographic placement rules, eg labels
placements are priortised in the order:
- top right
- top left
- bottom right
- bottom left
- middle right
- middle left
- top, slightly right
- bottom, slightly left
(respecting the guidelines from Krygier and Wood (2011) and other
cartographic textbooks)
Placement priority can also be set for an individual feature using
a data defined list of prioritised positions. This also allows for
only certain placements to be used, so eg for coastal features you
could prevent labels being placed over the land.
TODO:
- while the ordering can be customised by editing a project file,
there's no GUI to customise this ordering if you want to deviate
from this standard priority (and it's out of scope for this
current work)
- tests
Sponsored by Andreas Neumann