Skip to content

Plugin's_json_file

Paweł Salawa edited this page Jan 16, 2018 · 2 revisions

Plugin's JSON file

Each SQLiteStudio plugin uses a file with metadata, which describes what kind of plugin is this, who is the author, version of the plugin, etc. Having those information in the separate json file lets Qt to scan plugin files quickly (much faster than if it had to load the plugin) and learn what are available plugins, what are their dependencies, etc.

The metadata file is packed into the plugin binary output file at compile time, so the final result is still just one shared library, but Qt is able to read the metadata from such file without actually loading the shared library.

The "Plugin's JSON file" is a plain text file in json format.

Mandatory entries

  • type - it has to be the interface class, that the plugin implements, for example ExportPlugin, or GeneralPurposePlugin. See individual tutorial for desired plugin to learn which interface you should implement.
  • title - this is the name of the plugin as it will be presented to the user on UI, for example in configuration dialog.
  • description - this is displayed to the user when he/she clicks on Details of the plugin.
  • version - this is version of the plugin in format XYYZZ, which means that X is a major version, YY is a minor version and ZZ is a patch version. The XYYZZ is converted to X.Y.Z when presenting to the user. For example 12301 will be presented as 1.23.1.
  • author - name of the person/company who created/owns the plugin.

Optional entries

  • gui - boolean value informing if the plugin depends on the GUI client running. If true, then the there will be no attempt to load this plugin in the CLI. Otherwise SQLiteStudio will try to load the plugin in both CLI and GUI mode. If your plugin uses guiPlugin() statement in its "pro" file, then you should also define gui to true in the json file. Default (when ommited) is false.
  • dependencies - single name or array of names that this plugin depends on. More details: Writting plugin dependent on other plugin.
  • conflicts - array of plugin names that this plugin conflicts with. More details: Writting plugin dependent on other plugin.
  • minAppVersion - minimum SQLiteStudio version required, format same as for version entry
  • maxAppVersion - maximum SQLiteStudio version required, format same as for version entry
  • minQtVersion - minimum Qt version required, format same as for version entry
  • maxQtVersion - maximum Qt version required, format same as for version entry

Sample file

The absolute minimum for the Plugin's metadata file is following:

{
    "type":         "PluginTypeImplementedByThisPlugin",
    "title":        "Short, human-readable name",
    "description":  "Longer description of what the plugin introduces.",
    "version":      10000,
    "author":       "An author"
}