summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets/code/doc_src_qplugin.cpp
blob: 2d6e4a430f909497d11a1b6e108ec46e1392bde6 (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
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

//! [0]
namespace Foo
{
    struct MyInterface { ... };
}

Q_DECLARE_INTERFACE(Foo::MyInterface, "org.examples.MyInterface")
//! [0]


//! [1]
class MyInstance : public QObject
{
    Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDummyPlugin" FILE "mymetadata.json")
};
//! [1]


//! [2]
Q_IMPORT_PLUGIN(qjpeg)
//! [2]


//! [3]
TEMPLATE      = app
QTPLUGIN     += qjpeg qgif    # image formats
//! [3]