当前位置: 首页>>代码示例>>C++>>正文


C++ PluginInterface::getName方法代码示例

本文整理汇总了C++中PluginInterface::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginInterface::getName方法的具体用法?C++ PluginInterface::getName怎么用?C++ PluginInterface::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PluginInterface的用法示例。


在下文中一共展示了PluginInterface::getName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: initPluginWidget

void BoxWidget::initPluginWidget()
{
    QStringList title;
    title << tr("");
    pluginModel.setTitle(title);
//    pluginModel.insertRows(0,1,QModelIndex());
//    QModelIndex qindex = pluginModel.index(0,0,QModelIndex());
//    pluginModel.setData(qindex,tr("      "));
    pluginModel.insertRows(0,1,QModelIndex());
    QModelIndex qindex = pluginModel.index(0,0,QModelIndex());
    //set text
    pluginModel.setData(qindex, tr("UbuntuKylin Software Center"));
    //set icon
    pluginModel.setData(qindex,QIcon(QPixmap("://res/ubuntukylin-software-center.png")),Qt::DecorationRole);
    //set tooltip
    pluginModel.setData(qindex, tr("UbuntuKylin Software Center"),Qt::WhatsThisRole);

    QStringList icon_list;
    icon_list<<"://res/boot"<<"://res/camera";
    QStringList text_list;
    text_list << tr("Boot Manager") << tr("Camera");
    for (int index = 0;index < 2;++index)
    {
        pluginModel.insertRows(index + 1,1,QModelIndex());
        qindex = pluginModel.index(index + 1,0,QModelIndex());
        pluginModel.setData(qindex, text_list.at(index));
        //set icon
        pluginModel.setData(qindex,QIcon(QPixmap(icon_list.at(index))),Qt::DecorationRole);
        //set tooltip
        pluginModel.setData(qindex, text_list.at(index),Qt::WhatsThisRole);
    }

    int count =  PluginManager::Instance()->count();
    for (int i = 0;i < count;++i)
    {
        PluginInterface* ICommon = PluginManager::Instance()->getInterfaceByindex<PluginInterface>(i);
        QString picture = ICommon->getPicture();
        QString  pacture_path = QString(":/model/res/plugin/%1").arg(picture);
        pluginModel.setGuid(ICommon->getGuid());
//        pluginModel.insertRows(i + 1,1,QModelIndex());
//        qindex = pluginModel.index(i + 1,0,QModelIndex());
        pluginModel.insertRows(i + 3,1,QModelIndex());
        qindex = pluginModel.index(i + 3,0,QModelIndex());
        pluginModel.setData(qindex,ICommon->getName());
        pluginModel.setData(qindex,QIcon(QPixmap(pacture_path)),Qt::DecorationRole);
        pluginModel.setData(qindex,ICommon->getName(),Qt::WhatsThisRole);
    }
}
开发者ID:jay602,项目名称:youker-assistant,代码行数:48,代码来源:boxwidget.cpp

示例2: getScriptLastError

/**
  *Returns the javascript's last error for the given plugin if found, an empty QString else.
  */
QString Filter::getScriptLastError(QString plugin) {
    for (QVector<PluginInterface *>::iterator i = m_plugins.begin(); i != m_plugins.end(); i++) {
        PluginInterface *fiP = *i;
        if (fiP->getName() == plugin)
            return fiP->getScriptLastError();
    }

    return "";
}
开发者ID:darthvid,项目名称:sion,代码行数:12,代码来源:filter.cpp

示例3: getAttributeTip

/**
  * Return the attribute's tip for the given plugin if found, an empty QString else.
  */
QString Filter::getAttributeTip(QString plugin, QString name) {
    for (QVector<PluginInterface *>::iterator i = m_plugins.begin(); i != m_plugins.end(); i++) {
        PluginInterface *fiP = *i;
        if (fiP->getName() == plugin)
            return fiP->getAttributeTip(name);
    }

    return "";
}
开发者ID:darthvid,项目名称:sion,代码行数:12,代码来源:filter.cpp

示例4:

/**
  * Returns the attribute list for the given plugin if found, an empty list else.
  */
const QList<QString> Filter::getAttributes(QString plugin) {
    for (QVector<PluginInterface *>::iterator i = m_plugins.begin(); i != m_plugins.end(); i++) {
        PluginInterface *fiP = *i;
        if (fiP->getName() == plugin)
            return fiP->getAttributeNames();
    }

    return QList<QString>();
}
开发者ID:darthvid,项目名称:sion,代码行数:12,代码来源:filter.cpp

示例5: setScript

/**
  * Sets the javascript for the given plugin if found, an empty QString else.
  */
void Filter::setScript(QString plugin, QString script) {
    for (QVector<PluginInterface *>::iterator i = m_plugins.begin(); i != m_plugins.end(); i++) {
        PluginInterface *fiP = *i;
        if (fiP->getName() == plugin) {
#ifdef _VERBOSE_FILTER
            qDebug() << "Filter::setScript(" << m_virtualDirectoryPath << ", " << plugin << ", " << script << ")";
#endif
            fiP->setScript(script);
            return;
        }
    }
}
开发者ID:darthvid,项目名称:sion,代码行数:15,代码来源:filter.cpp

示例6: getScript

/**
  * Returns the javascript for the given plugin if found, an empty QString else.
  */
QString Filter::getScript(QString plugin) {
    for (QVector<PluginInterface *>::iterator i = m_plugins.begin(); i != m_plugins.end(); i++) {
        PluginInterface *fiP = *i;
        if (fiP->getName() == plugin) {
#ifdef _VERBOSE_FILTER
            qDebug() << "Filter::getScript(" << m_virtualDirectoryPath << ", " << plugin << ") -> " << fiP->getScript();
#endif
            return fiP->getScript();
        }
    }

    return "";
}
开发者ID:darthvid,项目名称:sion,代码行数:16,代码来源:filter.cpp

示例7: pluginsDir

void g19daemon::loadPlugins()
{
	PluginInterface *pluginint;
	QDir pluginsDir(qApp->applicationDirPath());
	QString name;
	
	name = settings->value("ActivePlugin").toString();
	pluginsDir.cd(PLUGINS_DIR);
	QDirIterator iterator(pluginsDir.absolutePath(), QStringList() << "*.so", QDir::Files, QDirIterator::NoIteratorFlags);

	while (iterator.hasNext())
	{
		iterator.next();
		QString filename = iterator.fileName();
		
		QPluginLoader pluginLoader(iterator.filePath());
		pluginLoader.setLoadHints(QLibrary::ResolveAllSymbolsHint);
		QObject *plugin = pluginLoader.instance();
		
		if (plugin)
		{
			pluginint = qobject_cast<PluginInterface *>(plugin);
			
			if (pluginint)
			{
				QObject *signalsource = pluginint->getQObject();
				connect(signalsource, SIGNAL(doAction(gAction, void *)), this, SLOT(doAction(gAction, void *)));

				if (pluginint->isPopup())
				{
					PopupPlugins.append(pluginint);
				}
				else
				{
					plugins.append(pluginint);

					if (pluginint->getName().compare(name) == 0)
					{
						activePlugin = plugins.indexOf(pluginint);
					}
				}
			}
		}
		else
		{
			QErrorMessage err(this);
			err.showMessage(pluginLoader.errorString());
			qDebug() << "\tError: " << pluginLoader.errorString();
		}
	}
开发者ID:mortendynamite,项目名称:g19daemon,代码行数:50,代码来源:g19daemon.cpp


注:本文中的PluginInterface::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。