mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-04 16:22:52 +08:00
- Fixed: using Qt5 plugin system based on Q_PLUGIN_METADATA
This commit is contained in:
36
samples/plugin/plugin.h
Normal file
36
samples/plugin/plugin.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/* Copyright (C) 2013 VATSIM Community / authors
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef SAMPLE_PLUGIN_H
|
||||
#define SAMPLE_PLUGIN_H
|
||||
|
||||
#include "blackmisc/plugins.h"
|
||||
|
||||
class CPlugin : public BlackMisc::IPlugin
|
||||
{
|
||||
public:
|
||||
CPlugin(BlackMisc::IPluginFactory &factory, BlackMisc::IContext &context);
|
||||
|
||||
virtual ~CPlugin();
|
||||
|
||||
virtual bool isValid() const { return m_ctorOK; }
|
||||
|
||||
virtual BlackMisc::IPluginFactory &getFactory() { return m_factory; }
|
||||
|
||||
private:
|
||||
bool m_ctorOK;
|
||||
BlackMisc::IPluginFactory &m_factory;
|
||||
BlackMisc::IContext &m_context;
|
||||
};
|
||||
|
||||
class CPluginFactory : public QObject, public BlackMisc::IPluginFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(BlackMisc::IPluginFactory)
|
||||
Q_PLUGIN_METADATA(IID BLACKMISC_IPLUGINFACTORY_IID)
|
||||
BLACKMISC_IMPLEMENT_IPLUGINFACTORY(CPlugin, "sample_plugin", "An example minimal plugin")
|
||||
};
|
||||
|
||||
#endif //SAMPLE_PLUGIN_H
|
||||
Reference in New Issue
Block a user