-
-
Notifications
You must be signed in to change notification settings - Fork 599
Writting_plugins
Paweł Salawa edited this page Jan 16, 2018
·
1 revision
The easiest way to create your own plugin is to pick up a simplest existing plugin, that is similar to one you want to create, copy it and modify. For example to create new export plugin, it's probably the best to get CsvExport plugin. For import plugin, the CsvImport, and so on, and so on...
- Every plugin is a separate Qt project of shared library.
- Every plugin can be either integrated into
Plugins
project (official set of plugins) as a subproject, or it can be a independent project. The former one is easier to set up. - Plugin's
*.pro
file has to includeplugins.pri
from SQLiteStudio3 source code directory. If The plugin is set up asPlugins
subproject, the line in plugin'spro
file will look like:include($$PWD/../../SQLiteStudio3/plugins.pri)
- Every plugin requires the plugin class to inherit from specific SQLiteStudio plugin class (see tutorials for specific plugin types to learn which class to inherit)
- Every plugin requires the
SQLITESTUDIO_PLUGIN("mypluginname.json")
macro, just after theQ_OBJECT
macro in the plugin's class - Every plugin requires the
mypluginname.json
JSON file (click to learn what to put in that file) in the plugins directory, as it is referrenced by above macro. - If plugin provides icons or UI form files, they should be included in Qt resources file - just add a
mypluginname.qrc
file in plugin's project and add UI forms and/or icon files to that resource file.- UI form files should be added with
/forms
resource prefix, so they are available to FormManager - Icons should be added with any prefix, it's up to plugin implementation to provide that prefix and file name later for SQLiteStudio (certain plugin types have special method to implement for that)
- Every plugin that provides any resources in
qrc
file needs to callQ_INIT_RESOURCE(mypluginname)
macro in thePlugin::init()
method implementation andQ_CLEANUP_RESOURCE(mypluginname)
in thePlugin::deinit()
method implementation.
- UI form files should be added with
Each subpage from the list below starts with the name of the official plugin that is the best candidate to be copied and modified.
- GeneralPurposePlugin - writting general purpose plugin
- DbPlugin - writting database plugin
- ExportPlugin - writting export plugin
- ImportPlugin - writting import plugin
- PopulatePlugin - writting populating plugin
- MultiEditorWidgetPlugin - writting editor plugin (for editors in Form View, or Value Editor Dialog)
- SqlFormatterPlugin - writting SQL code formatter plugin
- ScriptingPlugin - writting scripting language plugin
- SyntaxHighlighterPlugin - writting syntax highlighting plugin
- CustomConfigWidgetPlugin - writting custom config widget plugin
- Plugin's json file
- Writting plugin dependent on other plugin
- New plugin from scratch - if you want to create a plugin the way it was done with most official plugins, not by copying ready solutions, read this one.
- Plugin UI forms - if you want your plugin to work in Console, but also be configurable in the GUI client
- GenericPlugin - a base implementation of the Plugin interface for external plugins
- BuiltInPlugin - a base implementation of the Plugin interface for built-in (compiled-in) plugins
- Writting new plugin types