aboutsummaryrefslogtreecommitdiffstats
path: root/doc/qtcreatordev/src/creating-plugins.qdoc
blob: b5af5fcbb034fec8c60dc5588a88bfef3568c91e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
    \page creating-plugins.html
    \title Creating Extensions and Plugins

    At its very core, \QC consists of a \e {plugin loader} that loads and runs a
    set of C++-based plugins and Lua-based extensions, which then actually
    provide the functionality that you know from \QC the IDE. So, even the main
    application window and menus are all provided by plugins. Plugins can use
    different means to provide other plugins access to their functionality and
    to allow them to extend certain aspects of the application.

    For example the \c Core plugin, which is the very basic plugin that must be
    present for \QC to run at all, provides the main window itself, and API
    for adding menu items, modes, editor types, navigation panels and many other
    things.

    The \c TextEditor plugin provides a framework and base implementation for
    different text editors with highlighting, completion and folding, that is
    then used by other plugins to add more specialized text editor types to \QC,
    like for editing C/C++ or \c {.pro} files.

    You can extend \QC by writing:

    \list
        \li Lua-based extensions
        \li C++-based plugins
    \endlist

    \section1 Lua-Based Extensions

    A Lua extension consists of a Lua script that specifies the extension and
    loads it. Therefore, you don't need to compile extensions for different
    platforms. Also, we aim to keep the exported Lua API more stable than the
    exported C++ API.

    However, the API doesn't support everything you can do with C++. Also,
    Lua is an interpreted language, which might negatively impact performance.

    For a list of supported Lua modules, see \l{\QC Lua API}.

    To create Lua-based extensions, see:

    \list
        \li \l{Getting Qt and \QC}
        \li \l{Creating Lua-Based Extensions}
        \li \l{Plugin Meta Data}
        \li \l{The Action Manager and Commands}
        \li \l{Distributing Extensions and Plugins}
    \endlist

    \section1 C++-Based Plugins

    A C++-based plugin provides you with access to all the exported \QC C++ API.

    However, you have to build and distribute the plugin for all the supported
    platforms. Also, the backwards compatibility of the API is limited, so you
    have to regularly adapt the plugin when the API it uses is changed.

    For a summary of API changes in selected libraries and plugins, see the
    \l{API change log}.

    After reading the following topics, you will understand the contents of a
    basic C++-based plugin, how to write a specification file for it, what its
    lifecycle is, and what the general principles are for extending its
    functionality and providing interfaces for other extensions and plugins.
    You can then write your first plugin.

    \list
        \li \l{Getting Qt and \QC}
        \li \l{Creating C++-Based Plugins}
        \li \l{Plugin Meta Data}
        \li \l{Plugin Life Cycle}
        \li \l{Adding Tests}
        \li \l{The Plugin Manager, the Object Pool, and Registered Objects}
        \li \l{The Action Manager and Commands}
        \li \l{Distributing Extensions and Plugins}
    \endlist

    \omit
    \section1 Design Principles

    \list
        \li \l{Aggregations}
        \li \l{Extending and Providing Interfaces}
    \endlist

    \section1 Creating 3rd-Party Plugins

    \list
        \li \l{A Note on Binary Compatibility}
        \li \l{Creating User-Installable Plugins}
    \endlist
    \endomit
*/