Tip of the Day Provider

The Tip of the Day Provider is a plugin feature that generates tips for the TipOfTheDay window accessible via the Help menu. Only one tip provider can be registered. Its feature name is the fixed string ".totd".

The entry point to a tip provider is the tip function passed to plugin.registerTipProvider(), which is called once each time a new tip is needed:


The next tip of the day.

The return value of the tip function should be one of the following:

  • A string.
  • A list of strings. The first string contains numbered place markers of the form %n where n is a number from 1 to 9. The remaining strings in the list (up to 9) will be substituted at the location of the markers.

Strings may contain HTML markup from the subset of HTML supported by Qt. Strings that derive from external sources should be sanitized using plugin.htmlEscape() if necessary before including them in a tip. The following special link types are also supported:

  • <a doc='location'>: Appends the given location to the configured DocumentationRoot to create a documentation URL.
  • <a act='action'>: Creates a hyperlink that will invoke the given action string when clicked.

A tip provider is actually a special form of custom action and has access to the custom action API. This can be used to query the state the application and provide tips that are customized to the user's settings. For example, lookupShortcut can be used to look up key bindings and plugin.installPrefix can be used to display paths using the correct install location.