本文整理汇总了C++中QComboBox::setItemDelegate方法的典型用法代码示例。如果您正苦于以下问题:C++ QComboBox::setItemDelegate方法的具体用法?C++ QComboBox::setItemDelegate怎么用?C++ QComboBox::setItemDelegate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QComboBox
的用法示例。
在下文中一共展示了QComboBox::setItemDelegate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QComboBox
QMultiMap<int, IOptionsDialogWidget *> StatusIcons::optionsDialogWidgets(const QString &ANodeId, QWidget *AParent)
{
QMultiMap<int, IOptionsDialogWidget *> widgets;
if (FOptionsManager!=NULL && ANodeId==OPN_APPEARANCE)
{
QComboBox *cmbStatusIcons = new QComboBox(AParent);
cmbStatusIcons->setItemDelegate(new IconsetDelegate(cmbStatusIcons));
int index = 0;
for (QMap<QString, IconStorage *>::const_iterator it=FStorages.constBegin(); it!=FStorages.constEnd(); ++it)
{
QString name = it.value()->storageProperty(FILE_STORAGE_NAME,it.key());
cmbStatusIcons->addItem(it.value()->getIcon(SIK_ONLINE),name,it.key());
cmbStatusIcons->setItemData(index,it.value()->storage(),IconsetDelegate::IDR_STORAGE);
cmbStatusIcons->setItemData(index,it.value()->subStorage(),IconsetDelegate::IDR_SUBSTORAGE);
cmbStatusIcons->setItemData(index,true,IconsetDelegate::IDR_HIDE_STORAGE_NAME);
index++;
}
cmbStatusIcons->model()->sort(0);
widgets.insertMulti(OHO_APPEARANCE_ROSTER, FOptionsManager->newOptionsDialogHeader(tr("Contacts list"),AParent));
widgets.insertMulti(OWO_APPEARANCE_STATUSICONS, FOptionsManager->newOptionsDialogWidget(Options::node(OPV_STATUSICONS_DEFAULT),tr("Status icons:"),cmbStatusIcons,AParent));
}
return widgets;
}
示例2: QComboBox
QComboBox *VUtils::getComboBox(QWidget *p_parent)
{
QComboBox *box = new QComboBox(p_parent);
QStyledItemDelegate *itemDelegate = new QStyledItemDelegate(box);
box->setItemDelegate(itemDelegate);
return box;
}
示例3: createValueEditorImpl
QWidget* QtnPropertyDelegateQBrushStyle::createValueEditorImpl(QWidget* parent, const QRect& rect, QtnInplaceInfo* inplaceInfo)
{
if (owner().isEditableByUser())
{
QComboBox* combo = new QtnPropertyBrushStyleComboBox(parent);
combo->setLineEdit(nullptr);
combo->setItemDelegate(new QtnPropertyBrushStyleItemDelegate());
if (m_showAll)
{
for (auto bs = Qt::NoBrush; bs <= Qt::ConicalGradientPattern; bs = Qt::BrushStyle(bs + 1))
{
combo->addItem("", QVariant::fromValue(bs));
}
combo->addItem("", QVariant::fromValue(Qt::TexturePattern));
}
else
{
combo->addItem("", QVariant::fromValue(Qt::NoBrush));
combo->addItem("", QVariant::fromValue(Qt::SolidPattern));
combo->addItem("", QVariant::fromValue(Qt::HorPattern));
combo->addItem("", QVariant::fromValue(Qt::VerPattern));
combo->addItem("", QVariant::fromValue(Qt::CrossPattern));
combo->addItem("", QVariant::fromValue(Qt::BDiagPattern));
combo->addItem("", QVariant::fromValue(Qt::FDiagPattern));
combo->addItem("", QVariant::fromValue(Qt::DiagCrossPattern));
}
combo->setGeometry(rect);
new QtnPropertyBrushStyleComboBoxHandler(owner(), *combo);
if (inplaceInfo)
combo->showPopup();
return combo;
}
return nullptr;
}