本文整理汇总了C++中PluginInfo::setConfigPage方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginInfo::setConfigPage方法的具体用法?C++ PluginInfo::setConfigPage怎么用?C++ PluginInfo::setConfigPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginInfo
的用法示例。
在下文中一共展示了PluginInfo::setConfigPage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadPlugin
/** Load a plugin by its location on the hard drive. */
bool PluginManager::loadPlugin(const QString &pluginAbsPath)
{
QPluginLoader pluginLoader(pluginAbsPath, this);
QObject *plugin = pluginLoader.instance();
if (plugin) {
BasicPlugin *basic = dynamic_cast<BasicPlugin*>(plugin);
basic->setParent(this);
SettingsPrivate *settings = SettingsPrivate::instance();
if (basic) {
PluginInfo pluginInfo;
pluginInfo.setAbsFilePath(pluginAbsPath);
pluginInfo.setPluginName(basic->name());
pluginInfo.setVersion(basic->version());
pluginInfo.setConfigPage(basic->isConfigurable());
pluginInfo.setEnabled(true);
settings->addPlugin(pluginInfo);
if (basic->isConfigurable()) {
QString pluginLang(":/translations/" + basic->name() + "_" + settings->language());
if (basic->translator.load(pluginLang)) {
QApplication::installTranslator(&basic->translator);
}
}
// Keep references of loaded plugins, to be able to unload them later
_loadedPlugins.insert(pluginAbsPath, basic);
} else {
return false;
}
basic->init();
if (MediaPlayerPlugin *mediaPlayerPlugin = qobject_cast<MediaPlayerPlugin*>(plugin)) {
this->loadMediaPlayerPlugin(mediaPlayerPlugin);
} else if (ItemViewPlugin *itemViewPlugin = qobject_cast<ItemViewPlugin*>(plugin)) {
this->loadItemViewPlugin(itemViewPlugin);
} else if (RemoteMediaPlayerPlugin *remoteMediaPlayerPlugin = qobject_cast<RemoteMediaPlayerPlugin*>(plugin)) {
this->loadRemoteMediaPlayerPlugin(remoteMediaPlayerPlugin);
} else if (TagEditorPlugin *tagEditorPlugin = qobject_cast<TagEditorPlugin*>(plugin)) {
this->loadTagEditorPlugin(tagEditorPlugin);
}
}
return plugin != nullptr;
}