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


C++ QComboBox::setItemDelegate方法代码示例

本文整理汇总了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;
}
开发者ID:ZerGabriel,项目名称:vacuum-im,代码行数:27,代码来源:statusicons.cpp

示例2: QComboBox

QComboBox *VUtils::getComboBox(QWidget *p_parent)
{
    QComboBox *box = new QComboBox(p_parent);
    QStyledItemDelegate *itemDelegate = new QStyledItemDelegate(box);
    box->setItemDelegate(itemDelegate);

    return box;
}
开发者ID:liunianbanbo,项目名称:vnote,代码行数:8,代码来源:vutils.cpp

示例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;
}
开发者ID:lexxmark,项目名称:QtnProperty,代码行数:39,代码来源:PropertyDelegateQBrush.cpp


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