本文整理汇总了C++中PluginSpec::isEffectivelyEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginSpec::isEffectivelyEnabled方法的具体用法?C++ PluginSpec::isEffectivelyEnabled怎么用?C++ PluginSpec::isEffectivelyEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginSpec
的用法示例。
在下文中一共展示了PluginSpec::isEffectivelyEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QCoreApplication::setOrganizationName("Event Music Machine");
QCoreApplication::setOrganizationDomain("eventmusicmachine.de");
QCoreApplication::setApplicationName("Event Music Machine");
QFile styleFile(":/qss/default.qss");
styleFile.open(QFile::ReadOnly);
app.setStyleSheet(QString(styleFile.readAll()));
styleFile.close();
QSettings::setDefaultFormat(QSettings::IniFormat);
QSettings *settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "EMM", "emm");
PluginManager pluginManager;
PluginManager::setPluginIID(QLatin1String("de.eventmusicmachine.EmmPlugin"));
PluginManager::setSettings(settings);
// Load
const QStringList pluginPaths = getPluginPaths();
PluginManager::setPluginPaths(pluginPaths);
const PluginSpecSet plugins = PluginManager::plugins();
PluginSpec *coreplugin = 0;
foreach (PluginSpec *spec, plugins) {
if (spec->name() == QLatin1String(corePluginName)) {
coreplugin = spec;
break;
}
}
if (!coreplugin) {
QString nativePaths = QDir::toNativeSeparators(pluginPaths.join(QLatin1Char(',')));
const QString reason = QCoreApplication::translate("Application", "Could not find Core plugin in %1").arg(nativePaths);
displayError(msgCoreLoadFailure(reason));
return 1;
}
if (!coreplugin->isEffectivelyEnabled()) {
const QString reason = QCoreApplication::translate("Application", "Core plugin is disabled.");
displayError(msgCoreLoadFailure(reason));
return 1;
}
if (coreplugin->hasError()) {
displayError(msgCoreLoadFailure(coreplugin->errorString()));
return 1;
}
PluginManager::loadPlugins();
if (coreplugin->hasError()) {
displayError(msgCoreLoadFailure(coreplugin->errorString()));
return 1;
}
// shutdown plugin manager on the exit
QObject::connect(&app, &QCoreApplication::aboutToQuit, &pluginManager, &PluginManager::shutdown);
return app.exec();
}