Project: QGIS

Version: 2.14.0

Feature: External Resource widget

A new form widget is now available. It is named "External resource" and it allows a more complete handling of attributes assigned to file paths storing. Here is a complete summary of the widget features:

  • You can set an extension filter to force the storing of fixed file formats. If a filter is set, the file selector will only show file names that are relevant to the filter (it is still possible to select any file by using '*' character in the search field). Filter syntax is the same than Qt widget QFileDialog::getOpenFileName.
  • You can set a default path. Each time a user triggers the widget, a file selector will open at the default path (if set). If no default path has been set, the file selector will use the last path selected from an "External resource" widget. If the widget has never been used, the file selector default to opening on the project path.
  • You can define and set relative path storing. Relative path storing will allow you to save only the part of the path which is after the default path (if default path is set) or the current project path. This particularly useful when you want to save long paths into limited size attributes (like text attributes for Shapefiles which are limited to 254 characters), or for creating self-contained project and data file archives for distribution.
  • Another new feature to make the widget easier to use is that file paths can now be displayed as hyperlinks. Clicking the hyperlink will directly open the linked file from QGIS. You can configure this option to display the full path of the file or only its file name. The file will be opened using the default handler for that file format from your operating system.
  • You can also use a URL instead of a file path. The widget will interpret it as a URL and you will be able to open the linked web page directly in your default web browser.
  • You can choose to store directory paths instead of file paths.
  • There is an integrated document viewer in this widget. You can use it to display pictures or webpages directly into QGIS. The file chooser for the integrated viewer will benefit from all the above mentioned options.

For more information on configuration options, you can use the tool tips of the configuration dialog box.

The main aim of this new widget is to fix and improve the two existing 'File name' and 'Photo' widgets, and replace them with a single unified widget. For the moment, you can still use the old widgets but they will be deprecated and removed for QGIS 3.0. We recommend to switch your projects to use the new 'External Resource' widget now.

This feature was developed by: