本文整理汇总了C++中PluginInterface::getPicture方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginInterface::getPicture方法的具体用法?C++ PluginInterface::getPicture怎么用?C++ PluginInterface::getPicture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginInterface
的用法示例。
在下文中一共展示了PluginInterface::getPicture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}