Commit 9bc8e964 authored by Martin Schultz's avatar Martin Schultz

added example code for QueuedCrossPluginInterface

parent 2827e283
......@@ -134,6 +134,47 @@ void ExamplePlugin::pluginsInitialized()
}
\endcode
The next example shows how to use a queued connection between two plugins:
\n
ExamplePlugin.hh:
\code
class ExamplePlugin: public QObject, BaseInterface, PluginConnectionInterface, [...]
{
Q_OBJECT
Q_INTERFACES(BaseInterface)
Q_INTERFACES(PluginConnectionInterface)
[...]
signals:
void crossPluginConnectQueued( QString, const char*, QString, const char*);
/// example signal which can be used to group objects in datacontrol
void void dataControlGroupObjects(IdList, QString);
[...]
void exampleFunction();
}
\endcode
ExamplePlugin.cc:
\code
[...]
void ExamplePlugin::pluginsInitialized()
{
[...]
emit crossPluginConnectQueued("exampleplugin",SIGNAL(dataControlGroupObjects(IdList, QString)),"datacontrol",SLOT(groupObjects(IdList, QString)));
}
void ExamplePlugin::exampleFunction()
{
//do whatever you want, especially use the signals you want, but don't create loops
// e.g. emit a bazillion addEmptObject signals
[...]
// finally group them by emitting the connected signal
emit dataControlGroupObjects(ids, "fancy group name");
}
\endcode
To use the ScriptInterface:
<ul>
<li> include PluginConnectionInterface.hh in your plugins header file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment