Provides access to Qt Help information from inside the Workbench.
More...
|
| Internal |
| This subcategory includes the internal classes of the org.blueberry.ui.qt.help plugin. Other plugins must not rely on these classes. They contain implementation details and their interface may change at any time. We mean it.
|
|
Provides access to Qt Help information from inside the Workbench.
This plug-in collects all Qt QCH files (*.qch) from plug-ins in the RESOLVED state and registers them internally. The plug-in can be configured using the CTK Config Admin service and it listens to certain event topics on the CTK Event Admin.
The following configuration properties for the service PID "org.blueberry.services.help" are supported:
- homePage A
QString
property containing the a qthelp url pointing to the applications home page.
The plug-in subscribes to the following event topics:
- org/blueberry/help/CONTEXTHELP_REQUESTED signals a request for showing context sensitive help. If no properties are attached to the event, a qthelp url is constructed using the currently active part ID from the workbench. If the url is invalid, the home page is shown instead.
Supported event properties are:
The example below demonstrates how to provide configuration data for the org.blueberry.ui.qt.help plug-in.
void start(ctkPluginContext *context) override
{
ctkServiceReference cmRef = context->getServiceReference<ctkConfigurationAdmin>();
ctkConfigurationAdmin *configAdmin = nullptr;
if (cmRef)
{
configAdmin = context->getService<ctkConfigurationAdmin>(cmRef);
}
if (configAdmin)
{
ctkConfigurationPtr conf = configAdmin->getConfiguration("org.blueberry.services.help", QString());
ctkDictionary helpProps;
helpProps.insert("homePage", "qthelp://org.company.plugin/bundle/index.html");
conf->update(helpProps);
context->ungetService(cmRef);
}
else
{
}
}
Requesting context help may look like this:
void requestHelp(ctkPluginContext *context)
{
if (context == nullptr)
{
return;
}
QList<QSharedPointer<ctkPlugin>> plugins = context->getPlugins();
{
if (p->getSymbolicName() == "org.blueberry.ui.qt.help" && p->getState() != ctkPlugin::ACTIVE)
{
try
{
p->start(ctkPlugin::START_TRANSIENT);
}
catch (const ctkPluginException &)
{
return;
}
}
}
ctkServiceReference eventAdminRef = context->getServiceReference<ctkEventAdmin>();
ctkEventAdmin *eventAdmin = nullptr;
if (eventAdminRef)
{
eventAdmin = context->getService<ctkEventAdmin>(eventAdminRef);
}
if (eventAdmin == nullptr)
{
}
else
{
ctkEvent ev("org/blueberry/ui/help/CONTEXTHELP_REQUESTED");
eventAdmin->postEvent(ev);
}
}