Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
9bc8e964
Commit
9bc8e964
authored
Jun 13, 2017
by
Martin Schultz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added example code for QueuedCrossPluginInterface
parent
2827e283
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
BasePlugin/PluginConnectionInterface.hh
BasePlugin/PluginConnectionInterface.hh
+41
-0
No files found.
BasePlugin/PluginConnectionInterface.hh
View file @
9bc8e964
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment