本文整理汇总了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;
}
示例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;
}
示例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;
}
}
示例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;
}