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


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

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


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

示例1: createValueEditorImpl

QWidget* QtnPropertyDelegateQStringList::createValueEditorImpl(QWidget* parent, const QRect& rect, QtnInplaceInfo* inplaceInfo)
{
    if (!owner().isEditableByUser())
    {
        QLineEdit *lineEdit = new QLineEdit(parent);
        lineEdit->setReadOnly(true);
        lineEdit->setText(owner().value());

        lineEdit->setGeometry(rect);

        return lineEdit;
    }

    QComboBox* editor = new QComboBox(parent);
    editor->setGeometry(rect);

    editor->addItems(m_items);

    new QtnPropertyQStringListComboBoxHandler(owner(), *editor);

    if (inplaceInfo)
    {
        editor->showPopup();
    }

    return editor;
}
开发者ID:kmkolasinski,项目名称:QtnProperty,代码行数:27,代码来源:PropertyDelegateQString.cpp

示例2: createEditor

QWidget* ChannelRoutingDelegate::createEditor ( QWidget *pParent,
	const QStyleOptionViewItem & option, const QModelIndex& index ) const
{
	if (!index.isValid())
		return NULL;

	if (index.column() != 0)
		return NULL;

	ChannelRoutingItem item = index.model()->data(index, Qt::DisplayRole).value<ChannelRoutingItem>();

	QComboBox* pComboBox = new QComboBox(pParent);
	pComboBox->addItems(item.options);
	pComboBox->setCurrentIndex(item.selection);
	pComboBox->setEnabled(true);
	pComboBox->setGeometry(option.rect);
	return pComboBox;
}
开发者ID:svn2github,项目名称:linuxsampler,代码行数:18,代码来源:qsamplerChannel.cpp

示例3: createValueEditorImpl

QWidget* QtnPropertyDelegateEnum::createValueEditorImpl(QWidget* parent, const QRect& rect, QtnInplaceInfo* inplaceInfo)
{
    const QtnEnumInfo* info = owner().enumInfo();

    if (!info)
        return 0;

    if (owner().isEditableByUser())
    {
        QComboBox* combo = new QComboBox(parent);
        info->forEachEnumValue([combo](const QtnEnumValueInfo &value)->bool {
            combo->addItem(value.name(), QVariant(value.value()));
            return true;
        });

        combo->setGeometry(rect);

        new QtnPropertyEnumComboBoxHandler(owner(), *combo);

        if (inplaceInfo)
            combo->showPopup();

        return combo;
    }
    else
    {
        const QtnEnumValueInfo* valueInfo = info->findByValue(owner());
        if (!valueInfo)
            return 0;

        QLineEdit* lineEdit = new QLineEdit(parent);
        lineEdit->setReadOnly(true);
        lineEdit->setText(valueInfo->name());

        lineEdit->setGeometry(rect);

        return lineEdit;
    }

}
开发者ID:power321,项目名称:QtnProperty,代码行数:40,代码来源:PropertyDelegateEnum.cpp

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